GLLib: GLLibPlayer : Tileset

GLLib

GLLibPlayer : Tileset
[GLLibPlayer]

tile set loading/drawing function More...

Functions

static void Tileset_Destroy (int nLayer, boolean bFreeBufferImage)
 Delete a layer from the player.
static void Tileset_Destroy (int nLayer)
 Delete a layer from the player.
static void Tileset_Draw (Graphics g, int dx, int dy, int nLayer)
 Draw a specific onto destination Graphics.
static void Tileset_Draw (Graphics g, int nLayer)
 Draw a specific onto destination Graphics.
static final Graphics Tileset_GetBufferGraphics (int p_iLayer, int p_iImage)
 Get the graphics context of one of the images being used as a buffer for this layer.
static final Graphics Tileset_GetBufferGraphics (int p_iLayer)
 Get the graphics context of the image being used as a buffer for this layer.
static final Image Tileset_GetBufferImage (int p_iLayer, int p_iImage)
 Get one of the images that is being used as a buffer for this layer.
static final Image Tileset_GetBufferImage (int p_iLayer)
 Get the image that is the buffer for this layer.
static final int[] Tileset_GetCamera (int nLayer)
 Get the camera position of a specific layer.
static final int Tileset_GetCameraX (int nLayer)
 Get the camera X position of a specific layer.
static final int Tileset_GetCameraY (int nLayer)
 Get the camera Y position of a specific layer.
static final int Tileset_GetLayerHeight (int nLayer)
 Get the pixel height of a specific layer.
static final int Tileset_GetLayerTileCountHeight (int nLayer)
 Get the tile count height of a specific layer.
static final int Tileset_GetLayerTileCountWidth (int nLayer)
 Get the tile count width of a specific layer.
static final int Tileset_GetLayerWidth (int nLayer)
 Get the pixel width of a specific layer.
static final int Tileset_GetTile (int nLayer, int x, int y)
 Get value of a specific tile.
static final int Tileset_GetTileFlags (int nLayer, int x, int y)
 Get the flags information of a specific tile.
static void Tileset_Init (int nDestWidth, int nDestHeight, int nTileWidth, int nTileHeight)
 Initialize the GLLibPlayerTileSet engine.
static void Tileset_LoadLayer (int nLayer, byte[] MapSizes, byte[] MapData, byte[] MapFlip, ASprite MapSprite, int iUseCB, int origin, int wrappingX, int wrappingY)
 Load a tileset layer into the player.
static void Tileset_LoadLayer (int nLayer, byte[] MapSizes, byte[] MapData, byte[] MapFlip, ASprite MapSprite, boolean bUseCB, int origin, int wrappingX, int wrappingY)
 Load a tileset layer into the player.
static final void Tileset_SetCamera (int nLayer, int x, int y)
 Set the camera position of a specific layer.
static void Tileset_Update (int nLayer)
 Update a specific layer circular buffer (back buffer) but does nothing if this layer is not using a circular buffer.

Variables

static final int WRAP_CLAMP = 0
 wrappng parameter, specify that the tileset is to be repeated only once
static final int WRAP_REPEAT = 1
 wrappng parameter, specify that the tileset is to be repeated indefinitely

Detailed Description

tile set loading/drawing function

GLLibPlayer does not need to be instanciated to use those function


Function Documentation

static void Tileset_Destroy ( int  nLayer,
boolean  bFreeBufferImage 
) [static, package, inherited]

Delete a layer from the player.

Parameters:
nLayer Layer to delete.
bFreeBufferImage Free buffer image

static void Tileset_Destroy ( int  nLayer  )  [static, package, inherited]

Delete a layer from the player.

Image and data are going to be freed.

Parameters:
nLayer Layer to delete.

static void Tileset_Draw ( Graphics  g,
int  dx,
int  dy,
int  nLayer 
) [static, package, inherited]

Draw a specific onto destination Graphics.

If this layer is using a circular buffer it will be drawn to destination using correct order. If this layer is not using a circular buffer, every tile will be drawn to fill the destination.

Parameters:
g Graphics destination.
dx X offset in the destination.
dy Y offset in the destination.
g Graphics destination.
nLayer Layer to draw. Use -1 to draw every valid layer.

static void Tileset_Draw ( Graphics  g,
int  nLayer 
) [static, package, inherited]

Draw a specific onto destination Graphics.

If this layer is using a circular buffer it will be drawn to destination using correct order. If this layer is not using a circular buffer, every tile will be drawn to fill the destination.

Parameters:
g Graphics destination.
nLayer Layer to draw. Use -1 to draw every valid layer.

static final Graphics Tileset_GetBufferGraphics ( int  p_iLayer,
int  p_iImage 
) [static, package, inherited]

Get the graphics context of one of the images being used as a buffer for this layer.

NOTE: Current implementation always uses 1 image, so for now you can always use this method with 1 parameter

Parameters:
p_iLayer Layer whose buffer graphics context we want
p_iImage Image index we want
Returns:
the graphics context of the buffer

static final Graphics Tileset_GetBufferGraphics ( int  p_iLayer  )  [static, package, inherited]

Get the graphics context of the image being used as a buffer for this layer.

Parameters:
p_iLayer Layer whose buffer graphics context we want
Returns:
the graphics context of the buffer

static final Image Tileset_GetBufferImage ( int  p_iLayer,
int  p_iImage 
) [static, package, inherited]

Get one of the images that is being used as a buffer for this layer.

NOTE: Current implementation always uses 1 image, so for now you can always use this method with 1 parameter

Parameters:
p_iLayer Layer whose buffer we want as an image
p_iImage Image index we want
Returns:
the Image that is being used to buffer this layer

static final Image Tileset_GetBufferImage ( int  p_iLayer  )  [static, package, inherited]

Get the image that is the buffer for this layer.

Defaults to first image (only one usually)

Parameters:
p_iLayer Layer whose buffer we want as an image
Returns:
the Image that is being used to buffer this layer

static final int [] Tileset_GetCamera ( int  nLayer  )  [static, package, inherited]

Get the camera position of a specific layer.

Parameters:
nLayer Layer of which you want to know the Camera position.
Returns:
a 2 int array with the x and y in pixel of the camera. (null if entry params are invalid).
See also:
Tileset_GetCameraX, Tileset_GetCameraY
Deprecated:
use Tileset_GetCameraX and Tileset_GetCameraY instead

static final int Tileset_GetCameraX ( int  nLayer  )  [static, package, inherited]

Get the camera X position of a specific layer.

Parameters:
nLayer Layer of which you want to know the Camera position.
Returns:
camera X position

static final int Tileset_GetCameraY ( int  nLayer  )  [static, package, inherited]

Get the camera Y position of a specific layer.

Parameters:
nLayer Layer of which you want to know the Camera position.
Returns:
camera Y position

static final int Tileset_GetLayerHeight ( int  nLayer  )  [static, package, inherited]

Get the pixel height of a specific layer.

Parameters:
nLayer Layer of the tile to query.
Returns:
the pixel height of the requested layer. (-1 if entry params are invalid).

static final int Tileset_GetLayerTileCountHeight ( int  nLayer  )  [static, package, inherited]

Get the tile count height of a specific layer.

Parameters:
nLayer Layer of the tile to query.
Returns:
the tile count height of the requested layer. (-1 if entry params are invalid).

static final int Tileset_GetLayerTileCountWidth ( int  nLayer  )  [static, package, inherited]

Get the tile count width of a specific layer.

Parameters:
nLayer Layer of the tile to query.
Returns:
the tile count width of the requested layer. (-1 if entry params are invalid).

static final int Tileset_GetLayerWidth ( int  nLayer  )  [static, package, inherited]

Get the pixel width of a specific layer.

Parameters:
nLayer Layer of the tile to query.
Returns:
the pixel width of the requested layer. (-1 if entry params are invalid).

static final int Tileset_GetTile ( int  nLayer,
int  x,
int  y 
) [static, package, inherited]

Get value of a specific tile.

Parameters:
nLayer Layer of the tile to query.
x X Position of the tile to query.
y Y Position of the tile to query.
Returns:
the value of the requested tile. (-1 if entry params are invalid).

static final int Tileset_GetTileFlags ( int  nLayer,
int  x,
int  y 
) [static, package, inherited]

Get the flags information of a specific tile.

Parameters:
nLayer Layer of the tile to query.
x X Position of the tile to query.
y Y Position of the tile to query.
Returns:
the flags value of the requested tile. (-1 if entry params are invalid).

static void Tileset_Init ( int  nDestWidth,
int  nDestHeight,
int  nTileWidth,
int  nTileHeight 
) [static, package, inherited]

Initialize the GLLibPlayerTileSet engine.

You cannot use tileset before you call this function.

Parameters:
nDestWidth Destination Width in pixel; Usually Screen Width.
nDestHeight Destination Height in pixel; Usually Screen Height.
nTileWidth tile widh
nTileHeight tile height

static void Tileset_LoadLayer ( int  nLayer,
byte[]  MapSizes,
byte[]  MapData,
byte[]  MapFlip,
ASprite  MapSprite,
int  iUseCB,
int  origin,
int  wrappingX,
int  wrappingY 
) [static, package, inherited]

Load a tileset layer into the player.

Parameters:
nLayer Layer to load. It will replace the information if this layer is allready loaded.
MapSizes Array of short containing this layer size in tile count. Array generated by Aurora (.game).
MapData Array of byte containing the value of each position of the map. The Size of this array should be w*h in tile count. Byte array generated by Aurora (.game).
MapFlip Array of byte containing the flip value of each tile on the map. The Size of this array should be w*h in tile count. Byte array generated by Aurora (.game). can be null, in which case no flip will occurs on the tile
MapSprite Sprite to use to draw each tile. If this sprite contains any frame, the engine will use PaintFrame to draw each tile of this layer. If the sprite contains only module, the tile will be drawn with PaintModule.
iUseCB possible values are
-1 to disable circular buffer
nLayer to allocate a circular buffer for this layer
0..n to reuse the previously allocated buffer of layer 0..n.
origin set the position of coord 0,0 in layer. 0.top left, 1.bottom left
wrappingX tileset wrapping policy in X direction
wrappingY tileset wrapping policy in Y direction
origin set the position of coord 0,0 in tileset (either GLLib.TOP or GLLib.BOTTOM)

static void Tileset_LoadLayer ( int  nLayer,
byte[]  MapSizes,
byte[]  MapData,
byte[]  MapFlip,
ASprite  MapSprite,
boolean  bUseCB,
int  origin,
int  wrappingX,
int  wrappingY 
) [static, package, inherited]

Load a tileset layer into the player.

Parameters:
nLayer Layer to load. It will replace the information if this layer is allready loaded.
MapSizes Array of short containing this layer size in tile count. Array generated by Aurora (.game).
MapData Array of byte containing the value of each position of the map. The Size of this array should be w*h in tile count. Byte array generated by Aurora (.game).
MapFlip Array of byte containing the flip value of each tile on the map. The Size of this array should be w*h in tile count. Byte array generated by Aurora (.game). can be null, in which case no flip will occurs on the tile
MapSprite Sprite to use to draw each tile. If this sprite contains any frame, the engine will use PaintFrame to draw each tile of this layer. If the sprite contains only module, the tile will be drawn with PaintModule.
bUseCB True if you want to use a Circular buffer (backbuffer) for this layer. Usually this should only be used with the background layer, when drawing this layer, it will overwrite what was on the destination, without transparancy.
Note:
Using this will create an image of the size of the destination.
Parameters:
origin set the position of coord 0,0 in layer. 0.top left, 1.bottom left
wrappingX tileset wrapping policy in X direction
wrappingY tileset wrapping policy in Y direction
origin set the position of coord 0,0 in tileset (either GLLib.TOP or GLLib.BOTTOM)
Deprecated:
use Tileset_LoadLayer(int nLayer, byte[] MapSizes, byte[] MapData, byte[] MapFlip, ASprite MapSprite, int iUseCB, int origin, int wrappingX, int wrappingY) instead

static final void Tileset_SetCamera ( int  nLayer,
int  x,
int  y 
) [static, package, inherited]

Set the camera position of a specific layer.

Parameters:
nLayer Layer of which you want to set the Camera position.
x the new X Position of the camera.
y the new Y Position of the camera.

static void Tileset_Update ( int  nLayer  )  [static, package, inherited]

Update a specific layer circular buffer (back buffer) but does nothing if this layer is not using a circular buffer.

Parameters:
nLayer Layer to update. Use -1 to update every valid layer.
Deprecated:
do not use anymore


Variable Documentation

final int WRAP_CLAMP = 0 [static, inherited]

wrappng parameter, specify that the tileset is to be repeated only once

final int WRAP_REPEAT = 1 [static, inherited]

wrappng parameter, specify that the tileset is to be repeated indefinitely


Generated on Tue Sep 23 23:05:31 2008 for GLLib by  doxygen 1.5.2