actionscript 3 - AS3 - Finding an objects x and y position relative to the stage -


I am new to action script 3 and I have a character that you can control, the stage scroll right platform But he can fire the missiles. The problem I am facing is the missile created through these co-orders:

  bullet.x = hero.mc.x; bullet.y = hero.mc.y   

On the screen until it's okay, it has been properly scrolled. I agree because these tablets are not using Canvas X, Y and using phase X, Y, so I am thinking about how to know X and Y of your hero in relation to the canvas. Can be born!

Thank you, and if you need more information then let me know, I'm new to all this. Thank you

You can do this with you. Your solution would be:

  bulletPos = bullet.parent.localToGlobal (new point (bullet.x, bullet.y)); Be careful, however, because these are the last resort, generally, you will have all the elements using the same 'layer', so the comparison is easy and fast.   

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -