Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

BackgroundMap Class Reference

Provides a class for a static background. By default, this class will use background 0 unless otherwise specified. Note that there are a couple of types of backgrounds that it handles. More...

#include <Backgrounds.hpp>

Inheritance diagram for BackgroundMap:

Inheritance graph
[legend]
Collaboration diagram for BackgroundMap:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BackgroundMap (TileManagerScreen screen, int tile_index, int map_index, TileManagerColors bg_colors, int bg_num=0)
 Simply reinvokes the base-class constructor.

TileErrorCode load (const uint16 *bg_map=0)
 Loads the data into memory, and then updates the map to display the background. If bg_map is NULL, each tile is displayed in order. If bg_map is specified, the map (which must be 32 x 24) is used to load the tiles onto the screen. Note that backgrounds created with CreateBackground in The GIMP create a bg_map.


Private Types

typedef TileManagerBase inherited
 Typedef to aid in changing class heirarchies without a lot of code change.


Detailed Description

Provides a class for a static background. By default, this class will use background 0 unless otherwise specified. Note that there are a couple of types of backgrounds that it handles.

There are two types of backgrounds supported by the BackgroundMap object.

  1. A complete background picture. Only the tile data is provided, and the map is populated with all of the numbers from 0 to the last tile resulting in each tile being displayed in the order that it appears in the data.
  2. A background picture with a map. In some cases, the background may have a lot of repeating tiles (the background color of a simple image for example) so it may be much more efficient to provide a tileset of only unique tiles, and then provide a map of the order that the tiles appear.


Member Function Documentation

TileErrorCode BackgroundMap::load const uint16 *  bg_map = 0  ) 
 

Loads the data into memory, and then updates the map to display the background. If bg_map is NULL, each tile is displayed in order. If bg_map is specified, the map (which must be 32 x 24) is used to load the tiles onto the screen. Note that backgrounds created with CreateBackground in The GIMP create a bg_map.

Parameters:
bg_map The map of the order to display the tiles, or each one in order if 0.


The documentation for this class was generated from the following files:
Generated on Fri Apr 22 13:47:45 2005 for PhoenixRising NDS Library by doxygen 1.3.6