Resource: getCurrentCameraPosition();
by Brian Wilson · in Torque Game Builder · 04/11/2005 (9:42 pm) · 3 replies
Since this function doesn't appear to be built in, I thought I'd share my implementation.It's just a small resource(that I didn't see worthy of listing in the resource section) for those of you who can use it.
function getCurrentCameraPosition()
{
// capture the camera area
%CurrentCameraArea = sceneWindow2D.getCurrentCameraArea();
// parse getCurrentCameraArea() into vars
%x1 = getWord(%CurrentCameraArea, 0);
%y1 = getWord(%CurrentCameraArea, 1);
%width = getWord(%CurrentCameraArea, 2);
%height = getWord(%CurrentCameraArea, 3);
// calculate the position of the camera
%x2 = x1 + (width/2);
%y2 = y1 + (height/2);
//----------
// Returns: Un-comment the one (and only one) you want to use
//----------
// Simple return of the pivot point of the camera
//return( %x2 SPC %y2);
// standard return of the pivot point of the camera along with dimensions
//return( %x2 SPC %y2 SPC %width SPC %height);
}
Torque 3D Owner Matthew Langley
Torque
function getCurrentCameraPosition()
forgot the a