I am trying to add some scroll bars in Sprite using ScrollRect. Sprite starts blank and when I add something to 500, 500, it should be scrolled, because it is outside of the viewport Unfortunately, by adding 10x10 sprite to 500, 500, my Sprite changed to 510, 510 We can not, but 10, 10 :: - (.
We all know that the size of DisplayObjectContainers has changed what has been put in them. But I did not know till today that if you were 500, 500 If you put something, then Sprite / DObjContainer 0 to 500 to 500 Will not take the car, but will jump directly to 500 500. As a distraction, I can not put some scrollbar whose content fluctuates. I need 0, 0 and 0 if something is placed at 500, 500 , Then the height of the prehistory should be increased with 500+ which is the height of something.
Thoughts? Insight?
Thanks in advance: - D, scrollmasters :: - D. < / P>
It does not change the altitude / width of the sprite So, I'm not sure that this will help you. But if you control the scrolling code, then you can calculate the size of your object (considering it to be original is always 0,0) and Adding x + width and y + height is something like that.
var rect: rectangle = sp.getBounds (sp); Var w: number = math (Rect.x) + rect.width; Var H: Numbers = Math (Rect.y) + rect.height;
If you add children to a negative offset, but this is not the case with your statement, then you are using Math.abs
, so you Can escape that step.
Comments
Post a Comment