Change image on mouse press

Started by Candle, Thu 17/11/2005 23:02:22

Previous topic - Next topic

Candle

I have a keypad that will have an image so when you click on the keypad button it shows a diff image showing you pressed the button.
How could I Ã,  code itÃ,  ?I could do a mouseover but would like to do a keypress.

Image of keypad


I think I got it, but this one error ? what do I have wrong?

Display("1.", btnPlay.PushedGraphic);

---------------------------
Compile Error
---------------------------
There was an error compiling your script. The problem was:

In: 'Room 73 script'



Error (line 14): undefined symbol 'btnPlay'


SSH

Is it a GUI or using hotspots?
12

Candle

Is using hotspots with images .

Ashen

#3
On a general note, that line wouldn't actually do anything. Well, it'd display '1.', but it wouldn't change anything - the extra parameter (btnPlay.NormalGraphic) is useless.

I think you're using SSH's Keypad Module, right? So, I can't really help, not knowing how it works.

I'd guess, however, that it uses GUIs (hence the reference to btnPlay) and you don't want to (since you said so in the thread). You probably need to replace that line with one that changes the image of the object you're using instead, something like:

   oPlay.Graphic = 27; // where '27' is the spriteslot of the new image.

If you want more help, you'll have to post code (or wait for someone who knows more about the module).

Oh, and if you are using SSH's module, could you edit your title - or at least the first post - to say so?
I know what you're thinking ... Don't think that.

PyroMonkey

You might have to reference the module in the function you're using or something, in the () after the function command, but I haven't used modules yet so I wouldn't know.
 

Candle

I just went with the images staying on so thanks anyways.

SMF spam blocked by CleanTalk