开发者

AS3: Point for display object x, y?

开发者 https://www.devze.com 2022-12-25 11:34 出处:网络
Right now I have a point that I have to update with the x and y of a display object to use with the hitTestPoint object; is there any way I can get a point from a display object without havin开发者_Go

Right now I have a point that I have to update with the x and y of a display object to use with the hitTestPoint object; is there any way I can get a point from a display object without havin开发者_Go百科g to make a new point var and continually update its x and y?


Try this:

// Your display object you want to get the position from
var something:DisplayObject; 

// Retrieve the position as a Point object
var position:Point = something.transform.pixelBounds.topLeft;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号