Viewport Class Reference
#include <viewport.h>
List of all members.
Detailed Description
The viewport on the map.
Displays the current map and handles mouse input and the popup menu.
TODO: This class is planned to be extended to allow floating widgets on top of it such as NPC messages, which are positioned using map pixel coordinates.
Definition at line 51 of file viewport.h.
Constructor & Destructor Documentation
Member Function Documentation
void Viewport::setMap |
( |
Map * |
map |
) |
|
Sets the map displayed by the viewport.
Definition at line 85 of file viewport.cpp.
void Viewport::draw |
( |
gcn::Graphics * |
graphics |
) |
|
void Viewport::toggleDebugPath |
( |
|
) |
[inline] |
Toggles whether the path debug graphics are shown.
Definition at line 83 of file viewport.h.
void Viewport::mousePressed |
( |
gcn::MouseEvent & |
event |
) |
|
void Viewport::mouseDragged |
( |
gcn::MouseEvent & |
event |
) |
|
void Viewport::mouseReleased |
( |
gcn::MouseEvent & |
event |
) |
|
Handles mouse button release on map.
Definition at line 439 of file viewport.cpp.
void Viewport::mouseMoved |
( |
gcn::MouseEvent & |
event |
) |
|
void Viewport::showPopup |
( |
int |
x, |
|
|
int |
y, |
|
|
Item * |
item | |
|
) |
| | |
Shows a popup for an item.
TODO Find some way to get rid of Item here
Definition at line 444 of file viewport.cpp.
void Viewport::closePopupMenu |
( |
|
) |
|
Closes the popup menu.
Needed for when the player dies or switching maps.
Definition at line 449 of file viewport.cpp.
void Viewport::optionChanged |
( |
const std::string & |
name |
) |
[virtual] |
int Viewport::getCameraX |
( |
|
) |
const [inline] |
Returns camera x offset in pixels.
Definition at line 125 of file viewport.h.
int Viewport::getCameraY |
( |
|
) |
const [inline] |
Returns camera y offset in pixels.
Definition at line 130 of file viewport.h.
int Viewport::getMouseX |
( |
|
) |
const [inline] |
Returns mouse x in pixels.
Definition at line 135 of file viewport.h.
int Viewport::getMouseY |
( |
|
) |
const [inline] |
Returns mouse y in pixels.
Definition at line 140 of file viewport.h.
void Viewport::scrollBy |
( |
float |
x, |
|
|
float |
y | |
|
) |
| | [inline] |
Changes viewpoint by relative pixel coordinates.
Definition at line 145 of file viewport.h.
void Viewport::drawDebugPath |
( |
Graphics * |
graphics |
) |
[private] |
Finds a path from the player to the mouse, and draws it.
This is for debug purposes.
Definition at line 258 of file viewport.cpp.
void Viewport::drawPath |
( |
Graphics * |
graphics, |
|
|
const Path & |
path | |
|
) |
| | [private] |
Member Data Documentation
Current mouse position in pixels.
Definition at line 165 of file viewport.h.
Current mouse position in pixels.
Definition at line 166 of file viewport.h.
Current viewpoint in pixels.
Definition at line 167 of file viewport.h.
Current viewpoint in pixels.
Definition at line 168 of file viewport.h.
Current viewpoint in tiles.
Definition at line 169 of file viewport.h.
Current viewpoint in tiles.
Definition at line 170 of file viewport.h.
Show a path from player to pointer.
Definition at line 171 of file viewport.h.
Current selected being.
Definition at line 182 of file viewport.h.
The documentation for this class was generated from the following files: