GameObject

Manages all components and transform in the world. Can be overridden.

Constructors

this
this()

Creates basic GameObject with transform and connection to transform's emitter.

this
this(Component[] newComponents...)

Allows you to create an object with a set list of components you already have.

Members

Functions

addChild
void addChild(GameObject newChild)

Adds object to the children, adds it to the scene graph.

addComponent
void addComponent(Component newComponent)

Adds a component to the object.

changeName
void changeName(string newName)

Change the name of the object.

draw
void draw()

Called once per frame to draw all children.

findScene
Scene findScene()

Searche the parent tree until we find the scene object

getComponent
T getComponent()

Gets a component of the given type.

refresh
void refresh(Description node)

Refreshes the object with the given YAML node.

refreshComponent
void refreshComponent(ClassInfo componentType, Component.Description desc)

Refresh the component of the given type.

refreshComponent
void refreshComponent(Component.Description desc)

Refresh the component of the given type.

refreshComponent
void refreshComponent(string componentName, Component.Description desc)

Refresh the component of the given type.

removeChild
void removeChild(GameObject oldChild)

Removes the given object as a child from this object.

shutdown
void shutdown()

Called when the game is shutting down, to shutdown all children.

toDescription
Description toDescription()

Create a description from a GameObject.

toRepresentation
Description toRepresentation()

To complement the descriptions, and make serialization easier.

update
void update()

Called once per frame to update all children and components.

Properties

light
Light light [@property setter]
Light light [@property getter]

The light attached to this object.

Static functions

create
GameObject create(const Description desc)

Create a GameObject from a description object.

fromRepresentation
GameObject fromRepresentation(Description desc)

To complement the descriptions, and make serialization easier.

Structs

Description
struct Description

The struct that will be directly deserialized from the ddl.

Variables

id
uint id;

The ID of the object.

scene
Scene scene;

THIS IS ONLY SET IF THIS OBJECT IS SCENE _ROOT

stateFlags
ObjectStateFlags* stateFlags;

The current update settings

transform
Transform transform;

The current transform of the object.

Meta