forums

TNT Basic Forums > Programming Q&A
Buttons animated
< Last Thread     Next Thread >
Author
Thread        Post A Reply

06-15-2005 13:32

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

Hi,

I'm tring to find out if there is a way to make like a button animated when the mouse tuch is it, I now that You can make the button change to a diffrent image when the mouse tuch is it,

does anybudy now how,

Thanks,
Stephen

06-15-2005 15:26

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

TNT doesn't support animated buttons, apart from the up, over and down 'rollover' types. You could bypass the button code completely and use 'point in rect' to detect mouse overs and change the image programatically. You would need to store a value to indicate the last image and increment it (or similar) if point in rect returns true. You would also need to test for mouse down events. If you used a sprite for the button image you could use collsion detection to get the hit, and animate it with MOAN...

06-15-2005 17:05

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

Oopsy...

You'd also need to test for the cursor leaving the button, in order to return to the default state. You'd need to know if the mouse was over the button last time through the loop, you could use the image index for this, and check to see if it has left yet.

06-18-2005 16:17

Posted by:
Stephen Lund

Location:
Michigan USA

Click Here to Email Stephen Lund   Find more posts by Stephen Lund

Thanks,

Thanks for the advice,

Stephen,

06-18-2005 20:02

Posted by:
allnodcoms

Location:
hertfordshire (England)

Click Here to Email allnodcoms   Find more posts by allnodcoms

You're Welcome!

Danny

All times are GMT        Post A Reply

Forum Jump:
< Last Thread     Next Thread >

< Contact Us - TNT Basic >

Powered by: vBulletin Lite Version 1.0.1 Lite
Copyright © Jelsoft Enterprises Limited 2000.