OrthographicCamera
Package: Libraries.Game.Graphics · Inherits from: Libraries.Language.Object, Libraries.Game.Graphics.Camera
Actions
GetZoom()
The GetZoom action returns the current level of zoom used by the camera. The default value is 1.
Returns
number
Initialize(number viewportWidth, number viewportHeight)
Initializes the camera by giving a width and height for the camera to show in virtual space.
Parameters
viewportWidthnumberviewportHeightnumber
Move(number x, number y)
This action will move the camera by the given amount on each axis.
Parameters
xnumberynumber
Move(Libraries.Compute.Vector2 vector)
This action will move the camera by the amount of the given 2D vector.
Parameters
vectorLibraries.Compute.Vector2
Rotate(number degrees)
This action will rotate the camera by the given number of degrees around the camera's direction vector. If the camera has been SetToOrthographic(), then this vector should be perpendicular to the 2D plane of the screen space.
Parameters
degreesnumber
Scale(number scale)
This action will scale the size of the camera lens while maintaining the position of the bottom left corner of the viewing area.
Parameters
scalenumber: The amount to scale the camera lens.
ScaleTo(number width, number height)
This action will scale the size of the camera lens while maintaining the position of the bottom left corner of the viewing area.
Parameters
widthnumber: The width the lens should be after scaling.heightnumber: The height the lens should be after scaling.
SetPosition(number x, number y)
This action will set the camera's position in 2D space. If used in a 3D environment, it will set the camera's x and y position without affecting its z position.
Parameters
xnumberynumber
SetPosition(Libraries.Compute.Vector2 vector)
This action will set the camera's position in 2D space. If used in a 3D environment, it will set the camera's x and y position without affecting its z position.
Parameters
vectorLibraries.Compute.Vector2
SetToOrthographic(number viewportWidth, number viewportHeight)
This action will set the camera to an orthographic projection using a viewport of the given width and height.
Parameters
viewportWidthnumberviewportHeightnumber
SetToOrthographic()
This action will set the camera to an orthographic projection using a viewport fitting the game's full width and height.
SetZoom(number zoom)
The SetZoom action will set the zoom level of the camera. A value of 1 will use the default zoom. A smaller value will zoom the camera out, while a larger value will zoom the camera in.
Parameters
zoomnumber
Update()
This action recalculates the camera's position and data. This should be used after the camera has been manipulated in any way.
Inherited Actions
64 actions from Libraries.Game.Graphics.Camera
- Follow(Libraries.Interface.Item3D item, number behind, number above)
- Follow(Libraries.Interface.Item2D item)
- Follow(Libraries.Interface.Item3D item)
- GetAimHeight()
- GetCombinedMatrix()
- GetDirection()
- GetDistanceAbove()
- GetDistanceBehind()
- GetFar()
- GetFollowAngle()
- GetFollowItem()
- GetFollowItem2D()
- GetFollowSmoothing()
- GetFrustum()
- GetHeight()
- GetInverseCombinedMatrix()
- GetNear()
- GetPickRay(number screenX, number screenY)
- GetPickRay(number screenX, number screenY, number viewportX, number viewportY, number viewportWidth, number viewportHeight)
- GetPosition()
- GetProjectionMatrix()
- GetUp()
- GetViewMatrix()
- GetWidth()
- IsFollowTurning()
- IsFollowing()
- JumpToFollowPosition()
- LookAt(Libraries.Compute.Vector3 target)
- LookAt(number x, number y, number z)
- Move(Libraries.Compute.Vector3 vector)
- Move(number x, number y, number z)
- Rotate(Libraries.Compute.Quaternion quaternion)
- Rotate(Libraries.Compute.Vector3 axis, number degrees)
- Rotate(number axisX, number axisY, number axisZ, number degrees)
- Rotate(Libraries.Compute.Matrix4 transform)
- RotateAround(Libraries.Compute.Vector3 point, Libraries.Compute.Vector3 axis, number degrees)
- ScreenToWorldCoordinates(Libraries.Compute.Vector3 coords)
- ScreenToWorldCoordinates(Libraries.Compute.Vector3 coords, number viewportX, number viewportY, number viewportWidth, number viewportHeight)
- ScreenToWorldCoordinates(number x, number y)
- ScreenToWorldCoordinates(number x, number y, boolean useNearPlane)
- SetAimHeight(number height)
- SetDirection(number x, number y, number z)
- SetDirection(Libraries.Compute.Vector3 newDirection)
- SetDistanceAbove(number distance)
- SetDistanceBehind(number distance)
- SetFar(number value)
- SetFollowAngle(number degrees)
- SetFollowSmoothing(number seconds)
- SetFollowTurning(boolean turning)
- SetHeight(number height)
- SetNear(number value)
- SetPosition(Libraries.Compute.Vector3 newPosition)
- SetPosition(number x, number y, number z)
- SetSize(number width, number height)
- SetUp(number x, number y, number z)
- SetUp(Libraries.Compute.Vector3 newUp)
- SetWidth(number width)
- SetYawPitchRoll(number yaw, number pitch, number roll)
- StopFollowing()
- Transform(Libraries.Compute.Matrix4 transform)
- UpdateFollow(number seconds)
- WorldToScreenCoordinates(number x, number y, number z)
- WorldToScreenCoordinates(Libraries.Compute.Vector3 coords)
- WorldToScreenCoordinates(Libraries.Compute.Vector3 coords, number viewportX, number viewportY, number viewportWidth, number viewportHeight)