|
Axmol 3.0.0-89d6d9a
|
Pointer event. More...
#include <PointerEvent.h>
Inherits Event.
Public Member Functions | |
| PointerEvent () | |
| Constructor. | |
| Vec2 | getPoint () const |
| Returns the current touch location in screen coordinates. | |
| Vec2 | getPrevPoint () const |
| Returns the previous touch location in screen coordinates. | |
| Vec2 | getStartPoint () const |
| Returns the start touch location in screen coordinates. | |
| Vec2 | getWorldPoint () const |
| Returns the current pointer position in world space. | |
| Vec2 | getPrevWorldPoint () const |
| Returns the previous pointer position in world space. | |
| Vec2 | getStartWorldPoint () const |
| Returns the start pointer position in world space. | |
| const Vec2 & | getScrollDelta () const |
| Get mouse scroll data of axis. | |
| intptr_t | getPointerId () const |
| Get pointer id. | |
| PointerType | getPointerType () const |
| Get the pointer device type for this event. | |
| int | getButton () const |
| Get the index of the button that triggered this event. | |
| uint32_t | getPressedButtons () const |
| Get the bitmask of currently pressed buttons. | |
| bool | isButtonPressed (int buttonIndex) const |
| Check whether specified button index pressed. | |
| bool | isPrimaryPressed () const |
| Checks if the primary input is currently pressed. | |
| bool | isCaptured () const |
| Checks whether this event was routed through pointer capture. | |
| float | getPressure () const |
| Returns the normalized pressure applied to the touch surface. | |
| InputPhase | getPhase () const |
| Get the phase of this pointer event. | |
| bool | isPrimary () const |
| Indicates whether this pointer is the primary pointer. | |
| void | setPointerInfo (InputPhase phase, Vec2 point, const PointerInputState &inputState) |
| Set the touch information. | |
| void | setScrollData (Vec2 delta) |
| Set mouse scroll data. | |
| Public Member Functions inherited from Event | |
| Event (Type type) | |
| Constructor. | |
| virtual | ~Event () |
| Destructor. | |
| Type | getType () const |
| Gets the event type. | |
| void | stopPropagation () |
| Stops propagation for current event. | |
| bool | isStopped () const |
| Checks whether the event has been stopped. | |
| Node * | getCurrentTarget () |
| Gets current target of the event. | |
| Public Member Functions inherited from Object | |
| void | retain () |
| Retains the ownership. | |
| void | release () |
| Releases the ownership immediately. | |
| Object * | autorelease () |
| Releases the ownership sometime soon automatically. | |
| unsigned int | getReferenceCount () const |
| Returns the Object's current reference count. | |
| uint64_t | getObjectID () const noexcept |
| Returns the process-local diagnostic identifier assigned at construction. | |
| virtual | ~Object () |
| Destructor. | |
Additional Inherited Members | |
| Public Types inherited from Event | |
| enum class | Type |
| Type Event type. | |
Pointer event.
| Vec2 getPoint | ( | ) | const |
Returns the current touch location in screen coordinates.
| Vec2 getPrevPoint | ( | ) | const |
Returns the previous touch location in screen coordinates.
| Vec2 getStartPoint | ( | ) | const |
Returns the start touch location in screen coordinates.
| Vec2 getWorldPoint | ( | ) | const |
Returns the current pointer position in world space.
Uses the per-camera ray (set by EventDispatcher) to compute the correct world point for the camera that performed the hit-test.
|
inline |
Get mouse scroll data of axis.
|
inline |
Get pointer id.
@lua getId
|
inline |
Get the pointer device type for this event.
Returns the type of pointer that produced the event (for example, Mouse, Touch, or Pen).
|
inline |
Get the index of the button that triggered this event.
The value is a button index (0..n-1) when a physical button triggered the event. Use -1 to indicate "no button" (for example, touch events or pure move events).
|
inline |
Get the bitmask of currently pressed buttons.
Each bit corresponds to a button index: bit i represents whether button index i is currently pressed (1 = pressed, 0 = released). For example, bit 0 = left button, bit 1 = right button, bit 2 = middle button.
| bool isPrimaryPressed | ( | ) | const |
Checks if the primary input is currently pressed.
This method returns true when the primary input source is actively pressed and not in the PointerUp phase.
Use this method to detect the main interaction across devices (mouse left drag, first finger touch drag, or pen tip press).
|
inline |
Returns the normalized pressure applied to the touch surface.
This value represents the force intensity of the touch, universally supported across multi-touch screens, digital styluses (e.g., Apple Pencil), and pressure-sensitive devices.
|
inline |
Get the phase of this pointer event.
Returns the input phase that describes the current state of the pointer interaction, such as when a mouse button, touch, or pen contact is pressed, released, moved, or canceled.
|
inline |
Indicates whether this pointer is the primary pointer.
Returns true if the pointer is considered primary. The primary pointer is the one that controls the mouse cursor. For touch input, the first finger that touches the screen is marked as primary. For mouse input, the pointer is always primary.
| void setPointerInfo | ( | InputPhase | phase, |
| Vec2 | point, | ||
| const PointerInputState & | inputState ) |
Set the touch information.
It always used to monitor touch event.
| id | A given id |
| point | A given point in screen coordinate. |
| pressure | maximum possible force for 3d touch. |
|
inline |
Set mouse scroll data.
| scrollX | The scroll data of x axis. |
| scrollY | The scroll data of y axis. |