iOS Image/Sprite Animation?
gcanyon at gmail.com
Thu Nov 28 23:51:11 EST 2013
On Thu, Nov 28, 2013 at 8:26 PM, Alejandro Tejada <capellan2000 at gmail.com>wrote:
> The text of an image is more compact because it is
> actually the compressed original file itself in jpg or
> png format.
So if you want to set the alpha data at the same time, png is the only way,
I just tested, and learned all sorts of things:
Getting the text defaults to png.
Setting the text also sets the dimension of the target -- setting the text
of a 200x200 image to the text of a 100x100 image doesn't bork the image
the way it would with the imageData. Instead the target is converted to
100x100, and ends up just fine.
It also seems that if the original is re-sized, the target will still end
up at 100x100, and fine.
If the lockLoc of an image is false and the image is not its original size,
then getting the imageData will reset the image's dimensions back to their
originals. This also means that if image 1 starts out at 100x100, you
resize it to 150x100, then you set the rect of image 2 to 100x100 and set
the imageData of image 2 to the imageData of image 1, then image 1 will
reset to 100x100, and image 2 will look like image 1. If image 1's lockLoc
is true, then doing the same would not work; image 2 would have bogus data
in it. However, setting the text of image 2 to the text of image 1 will
More information about the Use-livecode