DynRPG v0.32 Unofficial
Plugin SDK
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
RPG::Map Class Reference

Used for accessing and manipulating the current map environment. More...

#include <Map.h>

Public Member Functions

int getCameraX ()
 Returns the current X position of the camera in pixels (this value means the position of the upper-left screen pixel of the screen on the map)
 
int getCameraY ()
 Returns the current Y position of the camera in pixels (this value means the position of the upper-left screen pixel of the screen on the map)
 
void setCamera (int x, int y)
 Sets a new camera position.
 
void moveCamera (int offsetX, int offsetY, int speed)
 Moves the camera (pixel-exact)
 
int getWidth ()
 Returns the width of the current map.
 
int getHeight ()
 Returns the height of the current map.
 
void updateEvents ()
 Updates the start conditions of events after a change.
 
int getLowerLayerTileId (int x, int y)
 Gets the tile ID for the lower layer tile at the specified coordinate.
 
int getUpperLayerTileId (int x, int y)
 Gets the tile ID for the upper layer tile at the specified coordinate.
 
int getTerrainId (int tileId)
 Gets the terrain ID for the tile ID specified.
 
int getEventAt (int x, int y)
 Gets the event ID at the position specified, or.
 

Public Attributes

int cameraSubX
 X position of the camera in units of 1/16th of a pixel
 
int cameraSubY
 Y position of the camera in units of 1/16th of a pixel
 
int encounterRateNew
 If the encounter rate is changed by event command, it's stored here.
 
int chipsetIdNew
 If the chipset id is changed by event command, it's stored here.
 
Chipsetchipset
 Pointer to the map's chipset (not yet implemented)
 
NamedCatalogPtr< Event * > events
 Array of events (use event ID as index)
 
unsigned char lowerTileIdNew [144]
 Lower tile ID? if changed via tile substitution event command (zero-based. index = old tile id, value = new tile id)
 
unsigned char upperTileIdNew [144]
 Upper tile ID? if changed via tile substitution event command (zero-based. index = old tile id, value = new tile id)
 
DStringPtr panoramaFilenameNew
 The filename of the panorama's image (if set by event command)
 
bool horScrollNew
 Is horizontal scrolling enabled? (if set by event command)
 
bool verScrollNew
 Is vertical scrolling enabled? (if set by event command)
 
bool horAutoscrollNew
 Is horizontal auto-scrolling enabled? (if set by event command)
 
int horScrollSpeedNew
 If horizontal scrolling enabled, this is the defined speed (if set by event command)
 
bool verAutoscrollNew
 Is vertical auto-scrolling enabled? (if set by event command)
 
int verScrollSpeedNew
 If horizontal scrolling enabled, this is the defined speed (if set by event command)
 

Static Public Attributes

static MapProperties *& properties
 Returns the map properties information for the map that is currently loaded.
 

Detailed Description

Used for accessing and manipulating the current map environment.

See also
RPG::map

Member Function Documentation

◆ getEventAt()

int RPG::Map::getEventAt ( int x,
int y )

Gets the event ID at the position specified, or.

Parameters
xThe Y coordinate of the event
yThe Y coordinate of the event
Returns
The event ID, or 0 if no event was found

◆ getLowerLayerTileId()

int RPG::Map::getLowerLayerTileId ( int x,
int y )

Gets the tile ID for the lower layer tile at the specified coordinate.

Parameters
xThe Y coordinate of the tile
yThe Y coordinate of the tile
See also
RPG::Tileset::lowerTilePassability

◆ getTerrainId()

int RPG::Map::getTerrainId ( int tileId)

Gets the terrain ID for the tile ID specified.

Parameters
tileIdThe tile's id
See also
RPG::Tileset::lowerTileTerrainId

◆ getUpperLayerTileId()

int RPG::Map::getUpperLayerTileId ( int x,
int y )

Gets the tile ID for the upper layer tile at the specified coordinate.

Parameters
xThe Y coordinate of the tile
yThe Y coordinate of the tile
See also
RPG::Tileset::upperTilePassability

◆ moveCamera()

void RPG::Map::moveCamera ( int offsetX,
int offsetY,
int speed )

Moves the camera (pixel-exact)

This function can move the camera the specified amount of pixels in the specified speed.

Parameters
offsetXAmount of pixels to move horizontally (may also be negative)
offsetYAmount of pixels to move vertically (may also be negative)
speedExact speed, in units of 3.75 pixels per second (1/16 tile per frame)
See also
RPG::Character::customExactSpeed

◆ setCamera()

void RPG::Map::setCamera ( int x,
int y )

Sets a new camera position.

Parameters
xNew X position (pixels)
yNew Y position (pixels)
Note
This method also updates the camera "memory", so that the "Return to origin" function works

◆ updateEvents()

void RPG::Map::updateEvents ( )

Updates the start conditions of events after a change.

This function can be used to re-check the start conditions of all events. This is necessary if you modify a switch from DynRPG which is start condition of an event, for example.

Member Data Documentation

◆ properties

MapProperties*& RPG::Map::properties
static

Returns the map properties information for the map that is currently loaded.

Returns
Pointer to the current map's properties
See also
RPG::MapProperties
RPG::MapTreeProperties

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