If you want to get the true width of a Sprite so that when you add a child sprite to it the proportions match what you were expecting, then you can use this expression:
sprite.width / sprite.scaleX
The training queue system we are using for Pioneers Online is very similar to EVE's training system. We have a graphical bar representing skills waiting to be trained. Each skill has a variable time requirement, and we'd like this to be reflected in the graphical bar. In order to determine the appropriate width of a fill sprite, a proportion is calculated and is then used to set the width. I had forgotten that I scaled the empty bar in CS4, and this caused some headaches when I tried to add children to it.
No comments:
Post a Comment