Main Page   Alphabetical List   Compound List   File List   Compound Members   File Members   Examples  

IsoMouseMap Class Reference

Class IsoMouseMap: Allows to easily convert the view space coordinates into the coordinates of the tile clicked. More...

#include <IsoMouseMap.h>

Collaboration diagram for IsoMouseMap:

Collaboration graph
[legend]
List of all members.

Public Methods

 IsoMouseMap ()
 ~IsoMouseMap ()
void load (char *filename)
 Allows to load a mousemap template image for use with isometric and hexagonal maps. More...

void create (int width, int height)
 Use with rectangular maps. More...

void destroy ()
 Clean up. More...

POINT mapMouse (POINT coords)
 Returns the coordinates of the tile that was clicked if the coordinates of the mouse are passed in. More...

int getWidth ()
 Returns the width of the tile. More...

int getHeight ()
 Returns the height of the tile. More...

POINTgetReferencePoint ()
 Returns the reference point. More...

void setReferencePoint (POINT *newReferencePoint)
 Sets the reference point to the value passed in. More...

void calculateReferencePoint (IsoTilePlotter *tilePlotter, RECT *extent)
 Calculates the correct reference point value given the tile plotter used for the game, and the extent rectangle for a specific tile. More...

IsoScrollergetScroller ()
 Returns the scroller used for the mouse map. More...

void setScroller (IsoScroller *scroller)
 Sets the scroller. More...

IsoTileWalkergetTileWalker ()
 Returns the tile walker used for the mouse map. More...

void setTileWalker (IsoTileWalker *tileWalker)
 Sets the tile walker. More...


Detailed Description

Class IsoMouseMap: Allows to easily convert the view space coordinates into the coordinates of the tile clicked.

Author:
Vovansim (aka Scorpion)
Version:
1.0
Date:
May 26, 2003
Examples:

TileEngineExample.cpp.

Definition at line 39 of file IsoMouseMap.h.


Constructor & Destructor Documentation

IsoMouseMap::IsoMouseMap  
 

Definition at line 17 of file IsoMouseMap.cpp.

References create, setScroller, setTileWalker, POINT::x, and POINT::y.

IsoMouseMap::~IsoMouseMap  
 

Definition at line 35 of file IsoMouseMap.cpp.

References destroy.


Member Function Documentation

void IsoMouseMap::calculateReferencePoint IsoTilePlotter   tilePlotter,
RECT   extent
 

Calculates the correct reference point value given the tile plotter used for the game, and the extent rectangle for a specific tile.

Definition at line 226 of file IsoMouseMap.cpp.

References RECT::left, IsoTilePlotter::plotTile, tilePlotter, RECT::top, POINT::x, and POINT::y.

Referenced by initializeEngine.

void IsoMouseMap::create int    width,
int    height
 

Use with rectangular maps.

Takes the width and the height of the tile as a parameter.

Definition at line 85 of file IsoMouseMap.cpp.

References destroy, MM_CENTER, and MOUSEMAP_DIRECTION.

Referenced by IsoMouseMap, and load.

void IsoMouseMap::destroy  
 

Clean up.

Definition at line 102 of file IsoMouseMap.cpp.

Referenced by create, and ~IsoMouseMap.

int IsoMouseMap::getHeight  
 

Returns the height of the tile.

Definition at line 214 of file IsoMouseMap.cpp.

Referenced by initializeEngine, and mapMouse.

POINT * IsoMouseMap::getReferencePoint  
 

Returns the reference point.

Definition at line 217 of file IsoMouseMap.cpp.

IsoScroller * IsoMouseMap::getScroller  
 

Returns the scroller used for the mouse map.

Definition at line 241 of file IsoMouseMap.cpp.

IsoTileWalker * IsoMouseMap::getTileWalker  
 

Returns the tile walker used for the mouse map.

Definition at line 246 of file IsoMouseMap.cpp.

int IsoMouseMap::getWidth  
 

Returns the width of the tile.

Definition at line 211 of file IsoMouseMap.cpp.

Referenced by initializeEngine, and mapMouse.

void IsoMouseMap::load char *    filename
 

Allows to load a mousemap template image for use with isometric and hexagonal maps.

Definition at line 47 of file IsoMouseMap.cpp.

References create, ImageCanvas::getHeight, getPixel, ImageCanvas::getWidth, ImageCanvas::loadImage, MM_NE, MM_NW, MM_SE, and MM_SW.

Referenced by initializeEngine.

POINT IsoMouseMap::mapMouse POINT    coords
 

Returns the coordinates of the tile that was clicked if the coordinates of the mouse are passed in.

Definition at line 116 of file IsoMouseMap.cpp.

References getHeight, getWidth, IDIR_EAST, IDIR_NORTH, IDIR_NORTHEAST, IDIR_NORTHWEST, IDIR_SOUTH, IDIR_SOUTHEAST, IDIR_SOUTHWEST, IDIR_WEST, MM_NE, MM_NW, MM_SE, MM_SW, IsoScroller::ScreenToWorld, IsoTileWalker::walkTile, POINT::x, and POINT::y.

Referenced by renderMap.

void IsoMouseMap::setReferencePoint POINT   newReferencePoint
 

Sets the reference point to the value passed in.

Definition at line 220 of file IsoMouseMap.cpp.

References POINT::x, and POINT::y.

void IsoMouseMap::setScroller IsoScroller   scroller
 

Sets the scroller.

Definition at line 243 of file IsoMouseMap.cpp.

References scroller.

Referenced by initializeEngine, and IsoMouseMap.

void IsoMouseMap::setTileWalker IsoTileWalker   tileWalker
 

Sets the tile walker.

Definition at line 248 of file IsoMouseMap.cpp.

References tileWalker.

Referenced by initializeEngine, and IsoMouseMap.


The documentation for this class was generated from the following files:
Generated on Mon May 26 22:13:21 2003 for SDL Isometric Engine by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002