Nymph Game Engine
Chaiscript based Game Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mouse_cursor_event.h
Go to the documentation of this file.
1 #ifndef MOUSE_CURSOR_EVENT_H
2 #define MOUSE_CURSOR_EVENT_H
3 #include <glm/glm.hpp>
4 #include "events/event.h"
5 #include "events/event_type.h"
6 //= SCRIPTABLE
7 //= SCRIPTABLE BASES Event
8 
9 namespace Input {
14  private:
15  glm::dvec2 position;
16  public:
17  //= BEGIN SCRIPTABLE
18 
24  MouseCursorEvent(const glm::dvec2& pos) : Event(Events::EventType::MOUSE_CURSOR), position(pos) {}
32  static std::shared_ptr<MouseCursorEvent> create(const glm::dvec2& pos) { return std::make_shared<MouseCursorEvent>(pos); }
38  glm::dvec2 getPosition() const noexcept { return position; }
39  //= END SCRIPTABLE
40  };
41 }
42 #endif
Class for event.
Definition: event.h:10
MouseCursorEvent(const glm::dvec2 &pos)
MouseCursorEvent constructor.
Definition: mouse_cursor_event.h:24
Class for mouse cursor event.
Definition: mouse_cursor_event.h:13
Definition: event_type.h:13
EventType
Event type enum that is used when passing events.
Definition: event_type.h:12
static std::shared_ptr< MouseCursorEvent > create(const glm::dvec2 &pos)
Factory function.
Definition: mouse_cursor_event.h:32
glm::dvec2 getPosition() const noexcept
Gets the position.
Definition: mouse_cursor_event.h:38
Event(const EventType &type)
Event constructor.
Definition: event.h:21