This project is read-only.

Introduction

The OgmoXNA library and content pipeline extension project is designed to work directly with the files produced by Matt Thorson's Ogmo Editor (http://ogmoeditor.com. The library makes it easy to load and use the project and subsequent series of level files created with Ogmo Editor by providing each element of them to you as neutral, consumable, managed objects. You can then take the data presented, and use it exactly as you choose to in your personal project without having to bend to a certain design principle as you may find from other editor libraries.

Getting Started

The first thing you should do before working intimately with OgmoXNA is to head over to the Ogmo Editor help page at http://ogmoeditor.com/index.php?p=help and familiarize yourself with the project and level XML layout. Once you fully understand how those files are setup the layout of OgmoXNA will make a lot more sense.

Next you'll want to get a copy of either the OgmoXNA binaries (http://ogmoxna.codeplex.com/releases/view/44296) or the source tree (http://ogmoxna.codeplex.com/releases/view/44296), and add the respective binary reference or project to your game's solution. You will need to add the OgmoXNA.dll file found in either the Windows or Xbox360 directory depending on which type of project you are trying to build. You will also need to add a reference to the OgmoXNAContentPipelineExtensions.dll file to your content project.

Loading a Level

All the work of loading an Ogmo Editor project and level can be taken care of with a single line of code once the following criteria are met:
  • You have the above mentioned libraries referenced in your project.
  • You have added the Ogmo Editor level you want to load to your content project, and have set the importer and processor to Ogmo Editor Level Importer and Ogmo Editor Level Processor respectively.
  • You have changed the Ogmo Editor Level Processor Project parameter to point the Ogmo Editor project associated with the level. This will be a file path relative to the level being loaded. So, if the project file and level file are in the same directory then simply enter the project file name.
  • You have all required texture assets copied to the content project's folder (but NOT added to the content project!) in a path as determined by your project file settings. Information on how this is setup is available at the Ogmo Editor help page mentioned above.

Once this preliminary setup is complete you can load a level as such:

protected void LoadContent()
{
    OgmoLevel ogmoLevel = this.Content.Load<OgmoLevel>("myOgmoLevel");
}


This will give you an OgmoLevel object that contains all defined layers, tilesets, values, objects, a reference to the OgmoProject defined by the project file, and everything else that you can currently define in Ogmo Editor. Through this one object you can gain access to everything your project and level files have to offer, and proceed to setup your game using this information as you see fit.

An example of using this information to create a very simple platform game is available in the Downloads section with the OgmoXNA source.

Last edited Apr 26, 2010 at 1:15 AM by deadpixelsociety, version 1

Comments

No comments yet.