Actionscript 3: get display object at pixel

后端 未结 2 772
一整个雨季
一整个雨季 2021-01-12 10:40

How can I enumerate display objects under a pixel relative to the stage?

Clarification: I want to write a function which get (x,y)

2条回答
  •  伪装坚强ぢ
    2021-01-12 11:01

    The hitTestPoint() method will get you information if a DisplayObject is at the specified point (http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObject.html#hitTestPoint())

    To get a list of objects you would have to recursively investigate all children of the stage, I don't think there is a predefined function for that.

    Alternatively: What are you trying to achieve? Maybe you can just use events and make them bubble?

提交回复
热议问题