souleng
Game engine providing full Python scripting support
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Transform Struct Reference

#include <Transform.hpp>

Inheritance diagram for Transform:
Component

Public Member Functions

void Input () override
 Called once per frame to handle any new input.
 
void Update (float dt) override
 
void Render () override
 
void SetWidth (float w)
 Sets the width of this GameObject.
 
void SetHeight (float h)
 Sets the height of this GameObject.
 
Vector2 GetPosition ()
 Retrieves the position of this GameObject's top left corner.
 
bool ContainsPoint (float x, float y)
 Checks if the coordinates specified are contained inside this GameObject.
 
void MoveTo (float x, float y)
 Moves this GameObject's top left corner to the specified coordinates.
 
SDL_FRect GetRect () const
 Returns the underlying rectangle for this GameObject's Transform.
 
- Public Member Functions inherited from Component
void SetGameObject (std::weak_ptr< GameObject > ent)
 Sets the GameObject this component is attached to.
 
std::shared_ptr< GameObjectGetGameObject ()
 Retrieves the GameObject this component is attached to, behind a shared pointer.
 
template<typename T >
std::shared_ptr< T > GetComponent ()
 Alias for GetGameObject()->GetComponent<T>(), for easier scripting.
 

Static Public Member Functions

static ComponentType GetType ()
 Returns the type of this component to make querying GetComponent easier.
 
- Static Public Member Functions inherited from Component
static ComponentType GetType ()
 Returns the type of this component to make querying GetComponent easier.
 

Additional Inherited Members

- Protected Attributes inherited from Component
std::weak_ptr< GameObjectmGameObject
 

Detailed Description

Component representing the position and size of a GameObject. This component is automatically attached to any constructed GameObject

Member Function Documentation

◆ GetType()

ComponentType Transform::GetType ( )
static

Returns the type of this component to make querying GetComponent easier.

◆ Input()

void Transform::Input ( )
overridevirtual

Called once per frame to handle any new input.

Reimplemented from Component.

◆ Render()

void Transform::Render ( )
overridevirtual

Called once per frame to render any necessary parts of this component to the screen

Reimplemented from Component.

◆ Update()

void Transform::Update ( float dt)
overridevirtual

Called once per frame for any timing specific logic

Parameters
deltaTimeThe tick rate of the game, in seconds. Useful for things like velocity calculations

Reimplemented from Component.


The documentation for this struct was generated from the following files: