Page 1 of 1

button on screen

PostPosted: Sun May 15, 2005 5:24 am
by Chai
let me ask some think
is it's have scrip for created or made button on screen
(For mouse press down on screen) like the .... normal button

- on press "z" button
- on mouse down the pic like the press "z" button

sorry it's hard to explain
thank you for your answer

PostPosted: Sun May 15, 2005 7:45 am
by ondy1985
It is very hard to understand what exactly do you mean, because your english is awful ;), but I'll try.

As far as I was able to understand, you want to create virtual button that will change it's appearence on keypress or mouse click. It's pretty simple and it can be done without any scripting.

1. Create actor called Button (or whatever),
2. In the actor properties dialog choose "Add animation" and add the animation for the button that should be played when it's not pressed, you can name it e.g. Unpressed.
3. Then add second animation that shows teh pressed button and call it e.g. Pressed.

That's for the button appearence. Now you have to add some events. As for the mouse, it's like this:

4. Create a "Mouse button down" event and assign it to the Left mouse button. Choose "Change Animation" from the action list an then select the "Pressed" animation.
5. Create a "Mouse button up" event and assign it to the Left mouse button. Choose "Change Animation" from the action list an then select the "Unpressed" animation.

For the key, it's quite similar. You will just create a "Key down" event and do the same as for the "Mouse button down" event. Then create "Key up" event and add the same action as for the "Mouse button up" event.

Hope it helps.

[edit]
I forgot to write that the starting animation for the button should be the "Unpressed" animation.
[/edit]