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

Class used for importing OgmoProject files quickly, and loading levels created in Ogmo Editor (http://ogmoeditor.com) Currently OgmoProjects must export in XML Co-ords for Tiles and Entities, and Bitstring for Grids. More...

Public Member Functions

 OgmoProject (string source, string imagePath="")
 Create an OgmoProject from a source .oep file. More...
 
void RemapAsset (string searchPath, string replacement)
 Assign a replacement asset for a Tilemap when LoadLevel is called. More...
 
GetValue< T > (string name, string data="")
 Get a value from an Ogmo level. More...
 
GetValue< T > (Enum name, string source="")
 Get a value from an Ogmo level. More...
 
GetValueFromFile< T > (string name, string path)
 
string GetLayerData (string name, string data="")
 
void LoadLevel (string data, Scene scene)
 Load level data from a string into a Scene. More...
 
void LoadLevelFromFile (string path, Scene scene)
 Load data into a Scene from a source .oel file. More...
 
void RegisterTag (int tag, string layerName)
 Register a collision tag on a grid layer loaded from the oel file. More...
 
void RegisterTag (Enum tag, string layerName)
 Register a collision tag on a grid layer loaded from the oel file. More...
 
Entity GetEntityFromLayerName (string layerName)
 Get the Entity that was created for a specific Ogmo layer. More...
 
List< string > GetLayerNames ()
 Get a list of all the known layer names from the .oep file. More...
 

Public Attributes

bool DisplayGrids = true
 Determines if grid layers will render in the game. Only applies at loading time. More...
 
string ImagePath
 The default image path to search for tilemaps in. More...
 
bool UseCameraBounds = true
 Determines if loaded levels will use camera bounds in the Scene. More...
 
bool UseAtlas
 Determines if tilemaps are located in an Atlas. More...
 
Color BackgroundColor
 The default background color of the Ogmo Project. More...
 
Color GridColor
 The default background grid color of the Ogmo Project. More...
 
Dictionary< string, OgmoLayerLayers = new Dictionary<string, OgmoLayer>()
 The known layers loaded from the Ogmo Editor oep file. More...
 
Dictionary< string, string > TileMaps = new Dictionary<string, string>()
 Mapping the tile layers to file paths. More...
 
Dictionary< string, EntityEntities = new Dictionary<string, Entity>()
 The entities stored to create tilemaps and grids. Cleared every time LoadLevel is called. More...
 
string CreationMethodName = "CreateFromXml"
 The name of the method to use for creating Entities when loading an .oel file into a Scene. More...
 
int BaseTileDepth
 The drawing layer to place the first loaded tile map on. More...
 
int TileDepthIncrement = 100
 Determines the drawing layers for each subsequently loaded tile map. For example, the first tilemap will be at Layer 0, the second at Layer 100, the third at Layer 200, etc. More...
 

Properties

string CurrentLevel [get, set]
 The level data last loaded with LoadLevel() More...
 

Detailed Description

Class used for importing OgmoProject files quickly, and loading levels created in Ogmo Editor (http://ogmoeditor.com) Currently OgmoProjects must export in XML Co-ords for Tiles and Entities, and Bitstring for Grids.

Constructor & Destructor Documentation

Otter.OgmoProject.OgmoProject ( string  source,
string  imagePath = "" 
)

Create an OgmoProject from a source .oep file.

Parameters
sourceThe path to the .oep file.
imagePathThe default image path to use for loading tilemaps.

Member Function Documentation

Entity Otter.OgmoProject.GetEntityFromLayerName ( string  layerName)

Get the Entity that was created for a specific Ogmo layer.

Parameters
layerNameThe name of the layer to find.
Returns
The Entity created for that layer.
List<string> Otter.OgmoProject.GetLayerNames ( )

Get a list of all the known layer names from the .oep file.

Returns
T Otter.OgmoProject.GetValue< T > ( string  name,
string  data = "" 
)

Get a value from an Ogmo level.

Template Parameters
TThe type of value.
Parameters
nameThe name of the value.
dataThe level data to use. If left blank will use the CurrentLevel.
Returns
The value cast to type T.
T Otter.OgmoProject.GetValue< T > ( Enum  name,
string  source = "" 
)

Get a value from an Ogmo level.

Template Parameters
TThe type of value.
Parameters
nameThe name of the value.
sourceThe level data to use. If left blank will use the CurrentLevel.
Returns
The value cast to type T.
void Otter.OgmoProject.LoadLevel ( string  data,
Scene  scene 
)

Load level data from a string into a Scene.

Parameters
dataThe level data to load.
sceneThe Scene to load into.
void Otter.OgmoProject.LoadLevelFromFile ( string  path,
Scene  scene 
)

Load data into a Scene from a source .oel file.

Parameters
pathThe oel to load.
sceneThe Scene to load into.
void Otter.OgmoProject.RegisterTag ( int  tag,
string  layerName 
)

Register a collision tag on a grid layer loaded from the oel file.

Parameters
tagThe tag to use.
layerNameThe layer name that should use the tag.
void Otter.OgmoProject.RegisterTag ( Enum  tag,
string  layerName 
)

Register a collision tag on a grid layer loaded from the oel file.

Parameters
tagThe enum tag to use. (Casts to int!)
layerNameThe layer name that should use the tag.
void Otter.OgmoProject.RemapAsset ( string  searchPath,
string  replacement 
)

Assign a replacement asset for a Tilemap when LoadLevel is called.

Parameters
searchPathThe asset path to find (searches at the end of the string!)
replacementThe full path to replace the matching asset with.

Member Data Documentation

Color Otter.OgmoProject.BackgroundColor

The default background color of the Ogmo Project.

int Otter.OgmoProject.BaseTileDepth

The drawing layer to place the first loaded tile map on.

string Otter.OgmoProject.CreationMethodName = "CreateFromXml"

The name of the method to use for creating Entities when loading an .oel file into a Scene.

bool Otter.OgmoProject.DisplayGrids = true

Determines if grid layers will render in the game. Only applies at loading time.

Dictionary<string, Entity> Otter.OgmoProject.Entities = new Dictionary<string, Entity>()

The entities stored to create tilemaps and grids. Cleared every time LoadLevel is called.

Color Otter.OgmoProject.GridColor

The default background grid color of the Ogmo Project.

string Otter.OgmoProject.ImagePath

The default image path to search for tilemaps in.

Dictionary<string, OgmoLayer> Otter.OgmoProject.Layers = new Dictionary<string, OgmoLayer>()

The known layers loaded from the Ogmo Editor oep file.

int Otter.OgmoProject.TileDepthIncrement = 100

Determines the drawing layers for each subsequently loaded tile map. For example, the first tilemap will be at Layer 0, the second at Layer 100, the third at Layer 200, etc.

Dictionary<string, string> Otter.OgmoProject.TileMaps = new Dictionary<string, string>()

Mapping the tile layers to file paths.

bool Otter.OgmoProject.UseAtlas

Determines if tilemaps are located in an Atlas.

bool Otter.OgmoProject.UseCameraBounds = true

Determines if loaded levels will use camera bounds in the Scene.

Property Documentation

string Otter.OgmoProject.CurrentLevel
getset

The level data last loaded with LoadLevel()


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