WoopWoop-Docs
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Properties | Private Attributes | List of all members
WoopWoop.Transform Class Reference

Represents the transformation component of an entity. More...

Inheritance diagram for WoopWoop.Transform:
WoopWoop.Component

Public Member Functions

void AddChild (string childUUID)
 Adds a child entity to this transform.
 
void AddChild (Entity child)
 Adds a child entity to this transform.
 
void AddChild (Transform childTransform)
 Adds a child entity to this transform.
 
Transform[] GetChildren ()
 Gets an array of child transforms.
 
int GetChildCount ()
 Gets the count of child entities.
 
Vector2 GetPivotPointOffset ()
 Calculates the pivot-point offset of the transform.
 
- Public Member Functions inherited from WoopWoop.Component
void Attach (Entity entity)
 Attaches the component to an entity.
 
virtual void Awake ()
 Awake is called when the component is initialized, regardless of whether or not the script is enabled.
 
virtual void Start ()
 Called when the component is started if it's enabled.
 
virtual void Update (float deltaTime)
 Called every frame to update the component's state.
 
virtual void OnEndOfFrame ()
 Called on the end of every frame.
 
virtual void Stop ()
 Called when the component is removed.
 
virtual void OnDrawGizmo ()
 Tells the renderer how to draw the object's editor gizmos.
 

Public Attributes

Pivot pivot = Pivot.Center
 The pivot point of the transform.
 
Action? onTransformChanged
 Event invoked when the transform is changed.
 

Properties

Transform parent [get, private set]
 The parent transform of this transform.
 
Vector2 Position [get, set]
 Gets or sets the position of the transform.
 
Vector2 Scale [get, set]
 Gets or sets the scale of the transform.
 
float Angle [get, set]
 Gets or sets the rotation angle (in degrees) of the transform.
 
- Properties inherited from WoopWoop.Component
Entity entity [get, private set]
 The entity to which this component is attached.
 
Transform transform [get]
 The transform of the entity to which this component is attached.
 
bool Enabled = true [get, set]
 Determines whether the component is enabled.
 

Private Attributes

Vector2 position = Vector2.Zero
 The position of the transform.
 
List< string > childrenUUIDs = new List<string>()
 The UUIDs of child entities.
 
Vector2 scale = Vector2.One
 
float angle = 0
 

Detailed Description

Represents the transformation component of an entity.

Member Function Documentation

◆ AddChild() [1/3]

void WoopWoop.Transform.AddChild ( Entity child)

Adds a child entity to this transform.

Parameters
childThe child entity to add.

◆ AddChild() [2/3]

void WoopWoop.Transform.AddChild ( string childUUID)

Adds a child entity to this transform.

Parameters
childUUIDThe UUID of the child entity.

◆ AddChild() [3/3]

void WoopWoop.Transform.AddChild ( Transform childTransform)

Adds a child entity to this transform.

Parameters
childThe child entity transform to add.

◆ GetChildCount()

int WoopWoop.Transform.GetChildCount ( )

Gets the count of child entities.

Returns
The count of child entities.

◆ GetChildren()

Transform[] WoopWoop.Transform.GetChildren ( )

Gets an array of child transforms.

Returns
An array of child transforms.

◆ GetPivotPointOffset()

Vector2 WoopWoop.Transform.GetPivotPointOffset ( )

Calculates the pivot-point offset of the transform.

Returns
The calculated pivot-point offset.

Member Data Documentation

◆ angle

float WoopWoop.Transform.angle = 0
private

◆ childrenUUIDs

List<string> WoopWoop.Transform.childrenUUIDs = new List<string>()
private

The UUIDs of child entities.

◆ onTransformChanged

Action? WoopWoop.Transform.onTransformChanged

Event invoked when the transform is changed.

◆ pivot

Pivot WoopWoop.Transform.pivot = Pivot.Center

The pivot point of the transform.

◆ position

Vector2 WoopWoop.Transform.position = Vector2.Zero
private

The position of the transform.

◆ scale

Vector2 WoopWoop.Transform.scale = Vector2.One
private

Property Documentation

◆ Angle

float WoopWoop.Transform.Angle
getset

Gets or sets the rotation angle (in degrees) of the transform.

◆ parent

Transform WoopWoop.Transform.parent
getprivate set

The parent transform of this transform.

◆ Position

Vector2 WoopWoop.Transform.Position
getset

Gets or sets the position of the transform.

◆ Scale

Vector2 WoopWoop.Transform.Scale
getset

Gets or sets the scale of the transform.


The documentation for this class was generated from the following file: