HBhvConditionMouse

Functions

HBhvConditionMouse

void

Register

void

UnRegister

bool

IsClicked

Detailed Description

class HBhvConditionMouse : public HBhvCondition, public HMouseListener

The HBhvConditionMouse class is the base class for all mouse related conditions.

Subclassed by HBhvConditionONLCLICK, HBhvConditionONMOUSEENTER, HBhvConditionONMOUSELEAVE

Public Functions

HBhvConditionMouse(char const *target, char const *hevent, bool invert, HBhvSensor *sensor)

Constructs an HBhvConditionMouse object.

Parameters:
  • target – The descriptor of the target object. You can use HBhvTargetObject::CreateTargetString() to generate this string.

  • hevent – The event type.

  • invert – Pass true to invert the condition. In other words, this condition will return true if the condition evaluates to false and false if the condition evaluates to true.

  • sensor – A pointer to the HBhvSensor object that this condition belongs to.

virtual void Register()

Registers the condition with event manager for mouse events.

virtual void UnRegister()

Unregisters the condition so that it no longer gets mouse events.

bool IsClicked(HC_KEY target, float x, float y)

Determines if the given target object was selected.

Parameters:
  • target – The key of the target object.

  • x – The mouse x coordinate in window space.

  • y – The mouse y coordinate in window space.

Returns:

True if the given target was selected by the mouse or false if otherwise.