Table of Contents

 
GetXYPos
 

Purpose

Returns the x,y coord of a map tile's location

 

Protoype

CVector GetXYPos (int i_row, int i_col, int i_offset = true)
 

Parameters

row the row of the tile
col the column of the tile
offset whether to account for scrolling (TRUE) or not (FALSE)
 

Description

This function is very useful when you want to place things at certain tiles on the map. It takes the row and column of the map tile and spits out the x and y location of the tile in a CVector object. The x and y location is automatically offset for the current map location. In addition, you can also have the function automatically compensate for scrolling if the map is larger than the screen. Enabling scroll offset when the map is smaller than the screen will have no adverse affect.

 

Use

CTileMngr tile_mngr;
CVector v_location = tile_mngr.GetXYPos(5, 7);
int i_xpos = v_location.vx;
int i_ypos = v_location.vy;
 

Prev: GetTotalFrames
Next: IsLocked