LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!
Hello.
I am trying to make a little desktop toy that is made up of an animated character that walks around on the desktop. I have a set of png images with Alpha channels for the animation but I cannot find out how to set the background of the stack to transparent. Anyone have any ideas other than using image masks to maks out the stack?
Hi Klaus.
Actually, what I would like is to be able to somehow adjust the Blend level of the background of the stack or card so that the .png is the only thing visible on the stack. I guess this is not possible though?
EDIT: Using the window shape means I have to double the amount of images I import into the stack, one for the image and 1 for te mask and then also make sure they match up perfectly. This is quite hard and time consuming. I thought there might be another possible way around this technique.
You may well already have seen this, from what you mention above, but this RevUp article by Scott Rossi http://www.runrev.com/newsletter/may/is ... NW70S38853 should help you get to grips with everything involved here.
Also the mask image is not necessarily a duplicate image. You can just set the mask image by reference, ie you have imported the image you want to use as the window shape (the mask image). Then set the window shape to the id of the imported image. You don't have to do this with a separate image imported solely for making the window shape.
Last edited by SparkOut on Wed Jul 15, 2009 9:28 am, edited 1 time in total.
bidgeeman wrote:EDIT: Using the window shape means I have to double the amount of images I import into the stack, one for the image and 1 for te mask and then also make sure they match up perfectly. This is quite hard and time consuming. I thought there might be another possible way around this technique.
Cheers
Bidge
You only need ONE transparent PNG image which will act as the image AND the mask. So they will always match perfectly!
But see also SparkOut's link, Scott Rossi is THE graphics god!
Sparkout....that was very useful. Thanks.
Klaus....If you have an animated image sequence where the shape changes constantly you also need a masking image sequence that matches the shape of each image. Just one image as a mask would only mask out the first image in the sequence but would not match the rest.
Ja Klaus, das hab' ich gewusst, obwohl ich oft Fehler mache, das weiss ich auch!
and Bidge... there is some info about animated stacks in that same newsletter, just repeatedly set the windowshape of the stack to the new image reference on a timed basis. As Scott notes, if you keep all the images the same (rectangular) size regardless of the non-transparent image within the rect, then you avoid problems with having to control the window location versus the image location.
yes, but you were talking about PNG files and that format does not
(unfortunately) animation per se like the animated GIF format.
So I thought you would like to make an animation from PNG images***
like your animation inside of a button we were talking aboput a
couple of days before.
Which is definitviely possible and also looks very smooth!
Check some of Scott Rossi's examples on his website: http://www.tactilemedia.com
-> Software ->Tutorials
Klause.
Thanks for the link. Yes you are right re: png images.The animation I am doing is more of a character based...I am just working on a stack now. I will post it to show you what I mean. Maybe there is something else you could suggets when you see it.
If you have access to the "old" RevOnline (version 3.0 or lower) then also look for Malte Brille's info stack about "the disadvantages of gif images" with a comparison of animated gifs versus a step by step manipulation of png images to achieve smooth animation.
Oh...I'm not sure how to get to the old revonline...I wish I could. I bought my copy of Rev a couple of weeks ago so it has the latest version of revonline. I might email Malte and see if he could emal me a copy.