I have textures with different sizes. When I put them in a movieclip, it takes the first texture as its size and resizes all others. How can I fix it? Thank you.
[Problem] textures with different sizes in a movieclip(3 posts) (2 voices)
A MovieClip is basically an Image that switch its own texture every so often (I think).
With Starling, a texture can have a "frame" property :
you may be familiar with this if you use TexturePacker for example where when you trim your images, the transparent edges are removed however the image displayed when used in starling is the same relative size as the original one, this is because TexturePacker has defined a frame rectangle which tells starling that the texture would be of that size even if the actual bitmap is smaller (trimmed).
What you can do then, is to make all of your frames of the same size by adding transparent borders so all your animation frames are of the same size, then in TexturePacker use the trim functionality so those transparent edges are removed but it will create the frame property for you, and then they will all be used in the texture objects, and the MovieClip will always have the base image size you're using for each frame.
That or you can redefine the frame rectangle of your texture objects 'manually' by looping through each of them before constructing your MovieClip with the textures.
Thank you for your answer. it worked like a charm!
You must log in to post.