button on screen

Game Editor comments and discussion.

button on screen

Postby Chai » Sun May 15, 2005 5:24 am

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
User avatar
Chai
 
Posts: 361
Joined: Sat Apr 30, 2005 2:26 pm
Location: Thailand
Score: 30 Give a positive score

Postby ondy1985 » Sun May 15, 2005 7:45 am

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]
User avatar
ondy1985
 
Posts: 99
Joined: Thu May 05, 2005 7:43 pm
Location: Slovakia
Score: 1 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron