Otter  0.9.88
2d Game Development Framework based on SFML.Net
 All Classes Namespaces Functions Variables Enumerations Properties
Otter.Skeleton Class Reference

A Component that can manage a set of Bone Components that can move Entities around. Sort of like a system similar to Spine or Spriter, but moving actual Entities around instead of just textures. More...

Inherits Otter.Component.

Public Member Functions

void AddAllBonesToScene ()
 Adds every Bone in the Skeleton's Entity to the Scene that the Skeleton's Entity is in. More...
 
Bone AddBone (Bone bone)
 Add a Bone to the Skeleton. More...
 
Bone AddBone (string parentName, string name, Bone bone=null)
 Add a Bone to the Skeleton. More...
 
Bone AddBone (Enum parentName, Enum name, Bone bone=null)
 Add a Bone to the Skeleton. More...
 
Bone AddBone (Bone parent, Bone bone=null)
 Add a Bone to the Skeleton. More...
 
Bone AddBone (string name, Bone bone=null)
 Add a Bone to the Skeleton. More...
 
Bone AddBone (Enum id, Bone bone=null)
 Add a Bone to the Skeleton. More...
 
Bone GetBone (string name)
 Retrieve a Bone by its string name. More...
 
Bone GetBone (Enum name)
 Retrieve a Bone by its Enum name. More...
 
Bone GetBone (int id)
 Retrieve a Bone by its int id. More...
 
Bone GetBone (Entity e)
 Retrieve a Bone by its Entity. More...
 
List< BoneGetBones ()
 A list of all the Bones contained in this Skeleton. More...
 
void LoadXml (string xml)
 Load a Skeleton from XML data. More...
 
void RemoveAllBonesFromScene ()
 Remove all the Entities controlled by the Bones in this Skeleton from the Scene. More...
 
Bone RemoveBone (string name, Bone bone=null)
 Remove a Bone from the Skeleton. More...
 
Bone RemoveBone (Enum id)
 Remove a Bone from the Skeleton. More...
 
Bone RemoveBone (Bone bone)
 Remove a Bone from the Skeleton. More...
 
override void Render ()
 Called during the Render on the parent Entity. More...
 
override void Update ()
 Called during the Update on the parent Entity. More...
 
- Public Member Functions inherited from Otter.Component
virtual void Added ()
 Called when the Component is added to the Entity. More...
 
virtual void Removed ()
 Called when the Component is removed from the Entity. More...
 
void RemoveSelf ()
 Removes the Component from its parent Entity. More...
 
virtual void UpdateFirst ()
 Called during the UpdateFirst on the parent Entity. More...
 
virtual void UpdateLast ()
 Called during the UpdateLast on the parent Entity. More...
 
GetComponent< T > ()
 Gets the first Component of type T from this Component's Entity. More...
 
List< T > GetComponents< T > ()
 Gets a list of Components of type T from this Component's Entity. More...
 

Public Attributes

bool RenderBones
 Determines if the Skeleton should render debug displays for each Bone. More...
 
- Public Attributes inherited from Otter.Component
Entity Entity
 The parent Entity of the Component. More...
 
bool RenderAfterEntity = true
 Determines if the Component should render after the Entity has rendered. More...
 
bool Visible = true
 Determines if the Component will render. More...
 
float Timer = 0
 How long the Component has been alive (added to an Entity and updated.) More...
 

Properties

Bone Base [get]
 The base bone (the first bone added to the Skeleton.) More...
 
Bone this[Enum name] [get]
 Get a Bone by enum name out of the Skeleton. More...
 
Bone this[string name] [get]
 Get a Bone by enum name out of the Skeleton. More...
 
- Properties inherited from Otter.Component
Scene Scene [get]
 The Scene that the parent Entity is in. More...
 
Collider Collider [get]
 The first Collider of the parent Entity. More...
 
Graphic Graphic [get]
 The first Graphic of the parent Entity. More...
 
List< GraphicGraphics [get]
 The list of Graphics from the parent Entity. More...
 
List< ColliderColliders [get]
 The list of Colliders from the parent Entity. More...
 

Detailed Description

A Component that can manage a set of Bone Components that can move Entities around. Sort of like a system similar to Spine or Spriter, but moving actual Entities around instead of just textures.

Member Function Documentation

void Otter.Skeleton.AddAllBonesToScene ( )

Adds every Bone in the Skeleton's Entity to the Scene that the Skeleton's Entity is in.

Bone Otter.Skeleton.AddBone ( Bone  bone)

Add a Bone to the Skeleton.

Parameters
boneThe Bone to add.
Returns
The added Bone.
Bone Otter.Skeleton.AddBone ( string  parentName,
string  name,
Bone  bone = null 
)

Add a Bone to the Skeleton.

Parameters
parentNameThe name of the Bone to parent this bone to.
nameThe name of the Bone being added.
boneThe Bone being added.
Returns
The added Bone.
Bone Otter.Skeleton.AddBone ( Enum  parentName,
Enum  name,
Bone  bone = null 
)

Add a Bone to the Skeleton.

Parameters
parentNameThe name of the Bone to parent this bone to.
nameThe name of the Bone being added.
boneThe Bone being added.
Returns
The added Bone.
Bone Otter.Skeleton.AddBone ( Bone  parent,
Bone  bone = null 
)

Add a Bone to the Skeleton.

Parameters
parentThe parent Bone.
boneThe Bone being added.
Returns
The added Bone.
Bone Otter.Skeleton.AddBone ( string  name,
Bone  bone = null 
)

Add a Bone to the Skeleton.

Parameters
nameThe name of the Bone being added.
boneThe Bone being added.
Returns
The added Bone.
Bone Otter.Skeleton.AddBone ( Enum  id,
Bone  bone = null 
)

Add a Bone to the Skeleton.

Parameters
idThe id of the bone being added.
boneThe Bone being added.
Returns
The added Bone.
Bone Otter.Skeleton.GetBone ( string  name)

Retrieve a Bone by its string name.

Parameters
nameThe name of the Bone.
Returns
The Bone with that name.
Bone Otter.Skeleton.GetBone ( Enum  name)

Retrieve a Bone by its Enum name.

Parameters
nameThe name of the Bone.
Returns
The Bone with that name.
Bone Otter.Skeleton.GetBone ( int  id)

Retrieve a Bone by its int id.

Parameters
idThe id of the Bone.
Returns
The Bone with that id.
Bone Otter.Skeleton.GetBone ( Entity  e)

Retrieve a Bone by its Entity.

Parameters
eThe Entity that the desired Bone belongs to.
Returns
The Bone with that Entity.
List<Bone> Otter.Skeleton.GetBones ( )

A list of all the Bones contained in this Skeleton.

Returns
A list of Bones.
void Otter.Skeleton.LoadXml ( string  xml)

Load a Skeleton from XML data.

Parameters
xmlThe XML data to parse.
void Otter.Skeleton.RemoveAllBonesFromScene ( )

Remove all the Entities controlled by the Bones in this Skeleton from the Scene.

Bone Otter.Skeleton.RemoveBone ( string  name,
Bone  bone = null 
)

Remove a Bone from the Skeleton.

Parameters
nameThe name of the Bone to remove.
boneThe Bone to return if no Bone was removed.
Returns
The removed Bone, or the Bone passed into the method if no Bone was removed.
Bone Otter.Skeleton.RemoveBone ( Enum  id)

Remove a Bone from the Skeleton.

Parameters
id
Returns
Bone Otter.Skeleton.RemoveBone ( Bone  bone)

Remove a Bone from the Skeleton.

Parameters
bone
Returns
override void Otter.Skeleton.Render ( )
virtual

Called during the Render on the parent Entity.

Reimplemented from Otter.Component.

override void Otter.Skeleton.Update ( )
virtual

Called during the Update on the parent Entity.

Reimplemented from Otter.Component.

Member Data Documentation

bool Otter.Skeleton.RenderBones

Determines if the Skeleton should render debug displays for each Bone.

Property Documentation

Bone Otter.Skeleton.Base
get

The base bone (the first bone added to the Skeleton.)

Bone Otter.Skeleton.this[Enum name]
get

Get a Bone by enum name out of the Skeleton.

Parameters
nameThe name of the bone to retrieve.
Returns
The Bone with that name.
Bone Otter.Skeleton.this[string name]
get

Get a Bone by enum name out of the Skeleton.

Parameters
nameThe name of the bone to retrieve.
Returns
The Bone with that name.

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