button resize

Mark Talluto revlists at canelasoftware.com
Fri Aug 15 15:29:01 EDT 2003


On Friday, August 15, 2003, at 12:33 PM, Andrew wrote:

> Hey, Revolution list.  I'm new to revolution, but I have much 
> experience with Hypercard.
> I was wondering if you fine folks could give me some tips on how to 
> deal with images and animation in Revolution.
> The main problem that I'm having with Revolution is getting an image's 
> rect to be the right size.  Say I create a cartoon of a man in 
> photoshop and I paste him into Revolution.  Then my little man becomes 
> an "image" in Revolution language.  However, when I paste him in, the 
> rect of the image is the size of the entire card!  How can I get the 
> rect of my little man to be exactly the size of him?

Is the image being created in 72 dpi?  If not, the image will be sized 
larger that it may have been intended when imported in to Rev.


>
> Now a slightly more complicated question:
> I used to make games in Hypercard by animating the icons of buttons.  
> The buttons could move around the screen while their icons were 
> changing simultaneously.  Revolution has me excited because of its 
> capability to handle large, colorful images.
> In trying to animate these images, the only thing I can figure out is 
> to have a new image for each "frame" of the animation.  Then I would 
> program the script to hide one image (the first frame) and show the 
> next image (the second frame) in the same place.  The trouble with 
> this is the following:  Say every card of the stack is a different 
> "level" of my game.  Then, I would need a copy of all my little man in 
> all his poses on every card; that would mean a whole bunch of hidden 
> images sitting around at the same.  Is there any way to have these 
> images somehow "belong" to the stack so they could be referenced from 
> any card?   Is this the best way to do what I'm trying to do, or am I 
> approaching the animation thing wrong?
>
>

You could bring the image in once.  Store them on a card called 
"storage".  Then create buttons and set their id to the id of the 
image.  You will then have a very efficient method for storing this 
images in memory.  The buttons will only make a reference to the image 
and not add to your overhead.


Best regards,
Mark Talluto
http://www.canelasoftware.com




More information about the use-livecode mailing list