#include <myst_card.h>
Public Member Functions | |
MystCard (MohawkEngine_Myst *vm, uint16 id) | |
uint16 | getId () const |
void | enter () |
void | leave () |
template<class T > | |
T * | getResource (uint index) |
void | setResourceEnabled (uint16 resourceIndex, bool enable) |
void | updateActiveResource (const Common::Point &mouse) |
MystArea * | forceUpdateClickedResource (const Common::Point &mouse) |
void | resetClickedResource () |
int16 | getActiveResourceCursor () |
void | updateResourcesForInput (const Common::Point &mouse, bool mouseClicked, bool mouseMoved) |
bool | isDraggingResource () const |
uint16 | getBackgroundImageId () |
void | drawBackground () |
void | drawResourceImages () |
void | drawResourceRects () |
void | redrawArea (uint16 var, bool updateScreen=true) |
Public Attributes | |
Common::Array< MystArea * > | _resources |
A game view
The names Card and Stack are legacy from the HyperCard engine used in the original mac version.
Cards contain resources (hotspots), images, sounds, and cursor hints.
uint16 Mohawk::MystCard::getId | ( | ) | const |
Get the id of the card
void Mohawk::MystCard::enter | ( | ) |
Initialization routine used to draw a card for the first time
void Mohawk::MystCard::leave | ( | ) |
Run the card's leave scripts
T * Mohawk::MystCard::getResource | ( | uint | index | ) |
Get a card resource (hotspot) by its index in the resource list
void Mohawk::MystCard::setResourceEnabled | ( | uint16 | resourceIndex, |
bool | enable | ||
) |
Enable or disable a card resource
void Mohawk::MystCard::updateActiveResource | ( | const Common::Point & | mouse | ) |
Update the card's active resource according to the mouse position
MystArea* Mohawk::MystCard::forceUpdateClickedResource | ( | const Common::Point & | mouse | ) |
Set the card's currently clicked resource to the currently active resource
void Mohawk::MystCard::resetClickedResource | ( | ) |
Clear the card's currently clicked resource
Used to indicate the mouse up event handler should not be called. (Possibly because it was already called by the gameplay logic
int16 Mohawk::MystCard::getActiveResourceCursor | ( | ) |
Get the mouse cursor that should be used when hovering the currently active resource
-1 means that no specific cursor is defined for the active resource, or that there is no currently active resource. In that case the default main cursor should be used by the caller.
void Mohawk::MystCard::updateResourcesForInput | ( | const Common::Point & | mouse, |
bool | mouseClicked, | ||
bool | mouseMoved | ||
) |
Call the resource event handlers to account for the new specified input
For example call the mouse down event handler for the currently active resource if the mouse is clicked and there was no clicked resource previously.
bool Mohawk::MystCard::isDraggingResource | ( | ) | const |
Is there a currently clicked resource
uint16 Mohawk::MystCard::getBackgroundImageId | ( | ) |
Retrieve the id of the background image to use when drawing the card
void Mohawk::MystCard::drawBackground | ( | ) |
Draw the card's background image to the backbuffer
void Mohawk::MystCard::drawResourceImages | ( | ) |
Draw the card's image resources to the backbuffer
void Mohawk::MystCard::drawResourceRects | ( | ) |
Draw debug rectangles around the card's resources
void Mohawk::MystCard::redrawArea | ( | uint16 | var, |
bool | updateScreen = true |
||
) |
Redraw the card's resources that are affected by the specified variable
Common::Array<MystArea *> Mohawk::MystCard::_resources |
The list of resources in the card