Class Transform
Ladybug Transform instance
Inheritance
Inherited Members
Namespace: Ladybug
Assembly: ladybug.dll
Syntax
public class Transform
Remarks
Represents basic location, size, scale, and rotation information
Properties
| Improve this Doc View SourceBounds
The outer bounds of the Transform
Declaration
public Rectangle Bounds { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Rectangle |
DefaultScale
Default scale value
Declaration
public static Vector2 DefaultScale { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Location
Read-only location value of the Transform
Declaration
public Vector2 Location { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Remarks
To move the Transform, use Move(Int32, Int32), SetPosition(Int32, Int32, BoxHandle), or their overloads.
Rotation
The rotation value of the Transform, in degrees
Declaration
public float Rotation { get; }
Property Value
Type | Description |
---|---|
System.Single |
Scale
The scale of the Transform
Declaration
public Vector2 Scale { get; }
Property Value
Type | Description |
---|---|
Microsoft.Xna.Framework.Vector2 |
Methods
| Improve this Doc View SourceMove(Vector2)
Moves the Transform, updating its position
Declaration
public void Move(Vector2 newPos)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | newPos | Vector2 value to move the Transform by |
Move(Int32, Int32)
Moves the Transform, updating its position
Declaration
public void Move(int xMove, int yMove)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | xMove | Distance to move the Transform by horizontally, in pixels |
System.Int32 | yMove | Distance to move the Transform by vertically, in pixels |
RotateBy(Single)
Rotates the Transform
Declaration
public void RotateBy(float newRot)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newRot | Value to rotate the Transform by, in degrees |
Remarks
This method rotates the Transform relative to its current rotation. To set the Transform's rotation to an absolute value, use SetRotation(Single)
ScaleBy(Vector2)
Scales the Transform
Declaration
public void ScaleBy(Vector2 newScale)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | newScale | Value to scale the transform by |
Remarks
This method scales the Transform relative to its current scale. To set the Transform's scale to an absolute value, use SetScale(Single)
ScaleBy(Single)
Scales the Transform
Declaration
public void ScaleBy(float newScale)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newScale | Value to scale the transform by |
Remarks
This method scales the Transform relative to its current scale. To set the Transform's scale to an absolute value, use SetScale(Single)
SetBounds(Rectangle)
Sets the Transform's bounds
Declaration
public void SetBounds(Rectangle rectangle)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Rectangle | rectangle | New Bounds for the Transform |
SetPosition(Vector2, BoxHandle)
Sets the position of the Transform
Declaration
public void SetPosition(Vector2 newPos, BoxHandle handle = BoxHandle.TopLeft)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | newPos | New location of the Transform |
BoxHandle | handle | The handle of the Transform's Bounds used to place it in its new Position |
SetPosition(Int32, Int32, BoxHandle)
Sets the position of the Transform
Declaration
public void SetPosition(int x, int y, BoxHandle handle = BoxHandle.TopLeft)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | New x coordinate of the Transform |
System.Int32 | y | New y coordinate of the Transform |
BoxHandle | handle | The handle of the Transform's Bounds used to place it in its new Position |
SetRotation(Single)
Sets the Transform's rotation
Declaration
public void SetRotation(float newRot)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newRot | Transform's new rotation value, in degrees |
SetScale(Vector2)
Sets the Transform's Scale
Declaration
public void SetScale(Vector2 newScale)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Xna.Framework.Vector2 | newScale | Transform's new scale value |
SetScale(Single)
Sets the Transform's Scale
Declaration
public void SetScale(float newScale)
Parameters
Type | Name | Description |
---|---|---|
System.Single | newScale | Transform's new scale value |