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

#include <ScriptComponent.hpp>

Inheritance diagram for ScriptComponent:
Component PyScriptComponent

Public Member Functions

virtual void Input ()
 Called once per frame to handle any new input.
 
virtual void Update (float dt)
 
virtual void Render ()
 
- 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

A largely virtual component which is set up to be inherited and overriden by Python created components.

Member Function Documentation

◆ GetType()

ComponentType ScriptComponent::GetType ( )
static

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

◆ Input()

void ScriptComponent::Input ( )
virtual

Called once per frame to handle any new input.

Reimplemented from Component.

Reimplemented in PyScriptComponent.

◆ Render()

void ScriptComponent::Render ( )
virtual

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

Reimplemented from Component.

Reimplemented in PyScriptComponent.

◆ Update()

void ScriptComponent::Update ( float dt)
virtual

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.

Reimplemented in PyScriptComponent.


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