Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
Muto::MouseScrolledEvent Class Reference

Event for registering mouse scroll wheel movement. More...

#include <MouseEvent.h>

Inheritance diagram for Muto::MouseScrolledEvent:
Muto::Event

Public Member Functions

float GetXOffset () const
 Get the x offset of the mouse scroll.
 
float GetYOffset () const
 Get the y offset of the mouse scroll.
 
 MouseScrolledEvent (float xOffset, float yOffset)
 Construct a MouseScrolledEvent with the specified x and y offsets.
 
std::string ToString () const override
 Convert the event to a string representation.
 
- Public Member Functions inherited from Muto::Event
virtual int GetCategoryFlags () const =0
 Get the category flags of the event.
 
virtual EventType GetEventType () const =0
 Get the type of the event.
 
virtual const char * GetName () const =0
 Get the name of the event.
 
bool IsInCategory (EventCategory category)
 Check if the event is in a specific category.
 
virtual ~Event ()=default
 

Private Attributes

float m_XOffset
 
float m_YOffset
 

Additional Inherited Members

- Public Attributes inherited from Muto::Event
bool Handled = false
 Indicates whether the event has been handled.
 

Detailed Description

Event for registering mouse scroll wheel movement.

Constructor & Destructor Documentation

◆ MouseScrolledEvent()

Muto::MouseScrolledEvent::MouseScrolledEvent ( float  xOffset,
float  yOffset 
)
inline

Construct a MouseScrolledEvent with the specified x and y offsets.

Parameters
xOffsetThe offset of the mouse scroll in the x direction.
yOffsetThe offset of the mouse scroll in the y direction.
57 }
float m_XOffset
Definition MouseEvent.h:75
float m_YOffset
Definition MouseEvent.h:75
constexpr Scope< T > CreateScope(Args &&... args)
Creates a Scope (unique_ptr) for the given type and constructor arguments.
Definition Defines_Macros.h:51

References m_XOffset, and m_YOffset.

Member Function Documentation

◆ GetXOffset()

float Muto::MouseScrolledEvent::GetXOffset ( ) const
inline

Get the x offset of the mouse scroll.

60{ return m_XOffset; }

References m_XOffset.

Referenced by ToString().

◆ GetYOffset()

float Muto::MouseScrolledEvent::GetYOffset ( ) const
inline

Get the y offset of the mouse scroll.

62{ return m_YOffset; }

References m_YOffset.

Referenced by Muto::EditorCamera::OnMouseScroll(), Muto::OrthographicCameraController::OnMouseScrolled(), and ToString().

◆ ToString()

std::string Muto::MouseScrolledEvent::ToString ( ) const
inlineoverridevirtual

Convert the event to a string representation.

Reimplemented from Muto::Event.

66 {
67 std::stringstream ss;
68 ss << "MouseScrolledEvent: " << GetXOffset() << ", " << GetYOffset();
69 return ss.str();
70 }
float GetYOffset() const
Get the y offset of the mouse scroll.
Definition MouseEvent.h:62
float GetXOffset() const
Get the x offset of the mouse scroll.
Definition MouseEvent.h:60

References GetXOffset(), and GetYOffset().

Member Data Documentation

◆ m_XOffset

float Muto::MouseScrolledEvent::m_XOffset
private

Referenced by GetXOffset(), and MouseScrolledEvent().

◆ m_YOffset

float Muto::MouseScrolledEvent::m_YOffset
private

Referenced by GetYOffset(), and MouseScrolledEvent().


The documentation for this class was generated from the following file: