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