Table of Contents | ||||||||
|
||||||||
CellPosXY | ||||||||
Purpose Calculates the coordinates of a certain cell in a given template of cells |
||||||||
Protoype CVector CImageMngr::CellPosXY (int i_row, int i_col, string str_img_id, int i_cell_id) |
||||||||
Parameters
|
||||||||
Description This function is used to find the actuall coordinate location of a cell in a template, information which is needed in order to blit a specific template cell onto a surface. You must pass in the number of rows and columns as well as the ID of the image template object. The ID is needed to find the image height and width to calculate the cell location, which is passed in for i_cell_id.
|
||||||||
Use CImageMngr image; // get the location of the 4th cell in a 4x4 template CVector x_y = image.CellPosXY(4, 4, "my_image", 3); // extract the individual x and y locations int x = x_y.vx; int y = x_y.vy; |
||||||||
|
||||||||
|