Hatch Game Engine Documentation v1.4.0
The documentation for the Hatch Game Engine
Loading...
Searching...
No Matches
TileInfo Class Reference

Functions for retrieving information about tiles. More...

Public Member Functions

void SetSpriteInfo (integer tileID, integer spriteIndex, integer animationIndex, integer frameIndex)
 Sets the sprite, animation, and frame to use for specified tile.
boolean IsEmptySpace (integer tileID, integer collisionPlane)
 Checks to see if a tile at the ID is empty.
integer GetEmptyTile ()
 Gets the scene's empty tile ID.
integer GetCollision (integer tileID, integer collisionField, SensorDirection directionType, integer position, boolean flipX, boolean flipY)
 Gets the collision value at the pixel position of the desired tile, -1 if no collision.
integer GetAngle (integer tileID, integer collisionField, SensorDirection directionType, boolean flipX, boolean flipY)
 Gets the angle value of the desired tile.
integer GetBehaviorFlag (integer tileID, integer collisionPlane)
 Gets the behavior value of the desired tile.
boolean IsCeiling (integer tileID, integer collisionPlane)
 Checks if the desired tile is a ceiling tile.

Detailed Description

Functions for retrieving information about tiles.

Member Function Documentation

◆ GetAngle()

integer TileInfo.GetAngle ( integer tileID,
integer collisionField,
SensorDirection directionType,
boolean flipX,
boolean flipY )

Gets the angle value of the desired tile.

Parameters
tileIDID of the tile to get the value of.
collisionFieldThe collision plane of the tile to get the angle from.
directionTypeOrdinal direction to check in.
flipXWhether to check the angle with the tile horizontally flipped.
flipYWhether to check the angle with the tile vertically flipped.
Returns
Angle value between 0x00 to 0xFF at the specified direction.

◆ GetBehaviorFlag()

integer TileInfo.GetBehaviorFlag ( integer tileID,
integer collisionPlane )

Gets the behavior value of the desired tile.

Parameters
tileIDID of the tile to get the value of.
collisionPlaneThe collision plane of the tile to get the behavior from.
Returns
Behavior flag of the tile.

◆ GetCollision()

integer TileInfo.GetCollision ( integer tileID,
integer collisionField,
SensorDirection directionType,
integer position,
boolean flipX,
boolean flipY )

Gets the collision value at the pixel position of the desired tile, -1 if no collision.

Parameters
tileIDID of the tile to get the value of.
collisionFieldThe collision plane of the tile to get the collision from.
directionTypeOrdinal direction to check in.
positionPosition on the tile to check, X position if the directionType is Up/Down, Y position if the directionType is Left/Right.
flipXWhether to check the collision with the tile horizontally flipped.
flipYWhether to check the collision with the tile vertically flipped.
Returns
Collision position on the tile, X position if the directionType is Left/Right, Y position if the directionType is Up/Down, -1 if there was no collision.

◆ GetEmptyTile()

integer TileInfo.GetEmptyTile ( )

Gets the scene's empty tile ID.

Returns
Returns the ID of the scene's empty tile space.

◆ IsCeiling()

boolean TileInfo.IsCeiling ( integer tileID,
integer collisionPlane )

Checks if the desired tile is a ceiling tile.

Parameters
tileIDID of the tile to check.
collisionPlaneThe collision plane of the tile to check.
Returns
Returns whether the tile is a ceiling tile.

◆ IsEmptySpace()

boolean TileInfo.IsEmptySpace ( integer tileID,
integer collisionPlane )

Checks to see if a tile at the ID is empty.

Parameters
tileIDID of tile to check.
collisionPlaneThe collision plane of the tile to check for.
Returns
Returns whether the tile is empty space.

◆ SetSpriteInfo()

void TileInfo.SetSpriteInfo ( integer tileID,
integer spriteIndex,
integer animationIndex,
integer frameIndex )

Sets the sprite, animation, and frame to use for specified tile.

Parameters
tileIDID of tile to check.
spriteIndexSprite index. (-1 for default tile sprite)
animationIndexAnimation index.
frameIndexFrame index. (-1 for default tile frame)