World position -> pixel position?
by Jason McIntosh · in Torque Game Builder · 03/01/2005 (5:33 pm) · 4 replies
Is there a function to translate a world position to screen coordinates?
About the author
#2
03/02/2005 (5:10 am)
What, it wasn't overflowing before? :P
#3
- Melv.
03/02/2005 (5:23 am)
It was overflowing before but now it's spilling over and starting to wet my knees! ;)- Melv.
#4
Added the following functions...
getWorldPoint() - Converts fxSceneWindow2D GUI position to fxSceneGraph2D World-Position.
getWindowPoint() - Converts fxSceneGraph2D World-Position to fxSceneWindow2D GUI position.
getCanvasPoint() - Converts fxSceneWindow2D GUI position to Canvas GUI position (main window).
getIsWindowPoint() - Checks if fxSceneGraph2D World-Position is currently being displayed in fxSceneWindow2D GUI.
These additional functions allow conversion for Canvas (main window) pixels, fxSceneWindow2D GUI pixels and fxSceneGraph2D World-Position (world-units).
Expect these in the next update.
- Melv.
03/20/2005 (6:34 am)
FYIAdded the following functions...
getWorldPoint() - Converts fxSceneWindow2D GUI position to fxSceneGraph2D World-Position.
getWindowPoint() - Converts fxSceneGraph2D World-Position to fxSceneWindow2D GUI position.
getCanvasPoint() - Converts fxSceneWindow2D GUI position to Canvas GUI position (main window).
getIsWindowPoint() - Checks if fxSceneGraph2D World-Position is currently being displayed in fxSceneWindow2D GUI.
These additional functions allow conversion for Canvas (main window) pixels, fxSceneWindow2D GUI pixels and fxSceneGraph2D World-Position (world-units).
Expect these in the next update.
- Melv.
Associate Melv May
Perhaps "fxSceneWindow2D::getScreenPosition( %worldPosition, %extrapolate? )" would be an apt function which returns the screen coordindate and if "%extrapolate?" is true then it extrapolates where (in pixels) it would be but if that's false then return nothing as it's off screen.
Okay, I'm convinced. On the TODO list. List growing to overflowing. ;)
- Melv.