Method GetPointedObject
GetPointedObject(int, int, int, int, Object)
Returns the the object of the scene that is located "under" the given pixel coordinates.
Declaration
public Scene.Object GetPointedObject(int windowWidth, int windowHeight, int pixelX, int pixelY, Scene.Object prevObject = null)
Parameters
Type | Name | Description |
---|---|---|
int | windowWidth | |
int | windowHeight | |
int | pixelX | |
int | pixelY | |
Scene.Object | prevObject |
Returns
Type | Description |
---|---|
Scene.Object | An object located under the given pixel coordinates or
|
Remarks
If several objects are located "under" given pixel
coordinates (at different altitudes), a priority list from top
to bottom is established. Calling the method again with
prevObject
set to previous returned object
makes possible to get the next object in the list.
If the windowWidth
and windowHeight
parameters are both equal to -1
the function will use instead the resolution of the KitchenDraw
drawing window. If the pixelX
, pixelY
parameters are both equal to -1
the
function will respectively use instead the position of the
mouse in X and Y according to the KitchenDraw drawing
window.