Copying parts of pictures to the front

Ken Norris (dialup) pixelbird at interisland.net
Wed Jan 30 00:26:01 EST 2002


on 1/29/02 7:54 PM, J. Landman Gay at jacque at hyperactivesw.com wrote:
 
> 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.
----------
Yes, this I know.
---------- 
> 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.
----------
I know this, too. No problem so far.
----------
> Set the icon of each button to
> the correct "up" image ID and set its hilite icon to the "down" image ID.
----------
This is what I'm trying to avoid. There are about 80 buttons, all similar
but different. The main picts..er..uh..images, are full screen. Everything
is there, including the images of the buttons (which have complex colors,
shading, text), in one FULL SCREEN image. The transparent buttons are all
aligned properly with the image. In my HC stack, Uli's xGWorld holds the
FULL SCREEN PICT (image) of the 'down' buttons, located congruently (thus,
the buttons align with it as well), but not visible. The handler for
animating the buttons uses the rect of the button to copy that portion of
the gWorld image and temporarily (until the mouse is up) place it on the
screen right over the corresponding portion of the 'up' state image, similar
to RR's icon hiliting. Very neat, doesn't require drawing separate button
icons. The buttons are in rows, so all the text parts had to align, too. I
wouldn't have wanted to do that for each separate button.

If I have to do each button separately as you sugggest, it will mean cutting
and pasting 156 separate images for the emulator version and at least 79
images each for the other two sets, for a grand total of 314 images!  If
there is significant memory savings in doing so, I might consider it, but I
have to weigh that against the labor involved.

So, what I'm looking for is either:

1) A script that instantly shows and hides the button rect PORTION of the
'down' full screen image into the SAME PORTION (rect) of the 'up' full
screen image. Best labor-saving idea if it will work.

...or

2) Write a script that automates the selection, copying, and pasting of the
button rect's images (all 314 of them) into icons.

....or...can I do this?:

3) Use the 'up' full screen image in the background, and just hilite with
the 'down' image icons. That will lower the copy and paste process to just
80 images. That's still a bunch, though.
----------
> 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.
----------
Go RR!!! This'll be great for the 'pilot light' buttons, too. I just don't
want to do all that copying and pasting again (waaah, snivel, snivel).

Thanks, Jacque, and good night all,

Ken N.




More information about the use-livecode mailing list