antun
01-14-2003, 02:06 PM
There's an easy way to do a button with various states.
Create the three states of the button (up/over/down), as three separate images. Create a multi-frame resource for them, and name it.
Then implement it with the <basebutton /> component:
<canvas>
<resource name="myButton">
<frame src="btn_up.png" />
<frame src="btn_over.png" />
<frame src="btn_down.png" />
</resource>
<basebutton resource="myButton" />
</canvas>
The various states will automatically be called based on the mouse events. The art assets used in this tip are attached to this message.
Enjoy!
Create the three states of the button (up/over/down), as three separate images. Create a multi-frame resource for them, and name it.
Then implement it with the <basebutton /> component:
<canvas>
<resource name="myButton">
<frame src="btn_up.png" />
<frame src="btn_over.png" />
<frame src="btn_down.png" />
</resource>
<basebutton resource="myButton" />
</canvas>
The various states will automatically be called based on the mouse events. The art assets used in this tip are attached to this message.
Enjoy!