button resize

Jim Lyons jimlyons at earthlink.net
Sat Aug 16 09:35:00 EDT 2003


Andrew (and any other new recruits from HC days),

Andrew wrote recently:
> ...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.

First, pace yourself! There's lot's of new, really great stuff to learn
about. Start with "About Revolution for Hypercard Developers" in the
Docs, and then "About Groups and Backgrounds". Making the switch from
thinking about cards and backgrounds to cards and groups took me a while
but it is fundamental to understanding the Revolution way. You'll like
it. Learn about custom properties early on, too. You'll like them.

> The main problem that I'm having with Revolution is getting
> an image's rect to be the right size. ...

Other folks answered about this. You'll definitely want to do all your
image work in PhotoShop and "Save for Web" in the size and quality you
want. And if you don't already know how to use ImageReady, get out the
book -- sounds like you'll be wanting to use some animated GIFs too. ;^)

> 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.

... and transparency, and animated GIFs, and graphic objects, and
built-in animations, and .... I can't wait to see what you make! Note
that there's an important difference between showing an image and
showing a button whose icon is set to an image. Check the docs and the
list archives for the best info about this.

> 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.

You can also place multiple frames in an "animated" GIF that you just
set to which frame you want. You can use this technique if you don't
need to show different frames of the GIF on different buttons at the
same time, and that probably would apply to your main character. In the
stack contributions at the RunRev site is an example of controlling
animated GIFs from a script.

> ... [need multiple images available on several cards] ...
> Is there any way to have these images somehow "belong" to
> the stack so they could be referenced from any card?

This was answered in another message too, involving using a group and
the backgroundBehavior property. Like I said, lots to learn and enjoy.
(I am just now grokking the frontscripts and the backscripts. Oh, boy!)

Jim Lyons



More information about the use-livecode mailing list