Copying parts of pictures to the front
J. Landman Gay
jacque at hyperactivesw.com
Tue Jan 29 22:56:01 EST 2002
Ken Norris <pixelbird at interisland.net> wrote:
> The pict with the 'Up' state
> buttons is onscreen (actually placed there with the addColor XCMD command
> and transition at openStack). The pict with the 'down' buttons is in an
> offscreen (it actually exists only in memory until called) gWorld (a
> companion to xDraw). At mouseDown, the handler that activates the graphic
> instantly copies the part of the pict ('down' button') which matches the
> button rect to the screen, temporarily covering that part of the 'up' button
> pict, holds it there until mouseUp when it disappears.
> I'm not sure how to do this with RR, but it shouldn't be difficult with
> native color, should it?
It is a snap in RR, it's all built in. You won't need any of the
work-arounds necessary in HC. Here's what you do:
1. Import all the pictures. You can use your existing PICT files if you
want, but they will not work cross platform and PICT is an inefficient
format. For best results, convert them first to jpg or gif and then
import them into the stack.
2. Once imported, make a note of each image's ID number, then hide the
image. You can store them anywhere in the stack, it doesn't matter
where, they will never be displayed directly. Some people make a
separate card to store icon images, other people just hide the image on
any convenient card.
3. Create a bunch of transparent buttons. Set the icon of each button to
the correct "up" image ID and set its hilite icon to the "down" image ID.
That's it. If the button has autohiliting set, it will work exactly the
way you want automatically. If you don't want to use autohiliting, then
just script "set the hilite of btn x to true" to show the "down" icon.
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the Use-livecode