pushbutton routine

This forum is meant for people to share their knowledge by writing their own tutorials for Adventure Maker.

Moderators: time-killer-games, Vengeance66, Candle, reneuend, GM-Support

pushbutton routine

Postby reneuend » Thu Jul 03, 2014 5:45 am

Fixed (July 6th, 2014):

Here is a simple routine you can use for any hot spot you want to set up as a pushbutton that when clicked will looked depressed for a couple seconds. I will add more features to it when l can actually get to a computer instead of typing from a phone.
I haven't tested this but I know it's close. I will fix if it isn't correct. I just don't have access to a computer until Sunday.

1. Create an image of a button
2. Create a copy of the button from step 1 and make it looked pressed in. The filename should be the same as the other image but with "_2" at the end of the name.
3. Create 1 hotspot and display the button.
4. Create a variant variable called, "imgfile"
4. Call the subroutine below in this hotspot.

In your hotspot call the subroutine shown below.
Example:

Put the following in the Advanced tab:

Code: Select all
imgfile = "btn.jpg"
pushButton()


Now put the following subroutine in the advanced procedures tab.

Code: Select all
Sub pushButton ()
    Dim imgfile2
    'Example: If imgfile="btn.jpg" then imgfile2="btn_2.jpg"
    Imgfile2 = left (imgfile, len (imgfile)-6) & "_2" & right (imgfile, 4)
    Action.LoadAPicture hotspot (Action.GetHotspotNumber), imgfile2
    Action.CreateTimedEvent 2, "Action.LoadAPicture hotspot (Action.GetHotspotNumber), imgfile", false
End Sub


I'll add a video How-To later and add a link at the end of this post.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2686
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA

Re: pushbutton routine

Postby Vengeance66 » Thu Jul 03, 2014 8:48 am

Cool! :)
Stay a while and listen...

Rainbow Enterainment - http://rainbowenter.com/
User avatar
Vengeance66
Administrator
 
Posts: 630
Joined: Wed Oct 13, 2010 2:17 pm
Location: Macedonia

Re: pushbutton routine

Postby skype6 » Thu Jul 03, 2014 12:09 pm

Great, now just to figure out how this works!
User avatar
skype6
Frequent Poster
 
Posts: 114
Joined: Fri Jan 10, 2014 2:17 pm

Re: pushbutton routine

Postby reneuend » Thu Jul 03, 2014 6:03 pm

I'll give a better explanation on Sunday.
---


Image
Image
User avatar
reneuend
Administrator
 
Posts: 2686
Joined: Sat Nov 22, 2008 8:37 pm
Location: Midwest Cornfield, USA


Return to Post Your Own Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron