SpiecsEngine
 
Loading...
Searching...
No Matches

◆ OnEvent()

void Spices::CameraController::OnEvent ( Event & e)
overridevirtual

The interface inherited from NativeScriptComponent, which is called on the global event function pointer called.

Reimplemented from Spices::NativeScriptComponent.

Definition at line 64 of file CameraController.cpp.

65 {
66 EventDispatcher dispatcher(e);
67
68 dispatcher.Dispatch<KeyPressedEvent>(BIND_EVENT_FN(CameraController::OnKeyPressed));
69 dispatcher.Dispatch<MouseScrolledEvent>(BIND_EVENT_FN(CameraController::OnMouseScroll));
70 dispatcher.Dispatch<SlateResizeEvent>(BIND_EVENT_FN(CameraController::OnSlateResized));
71 }
#define BIND_EVENT_FN(x)
Bind Event.
Definition Event.h:88
bool OnKeyPressed(KeyPressedEvent &e)
Event OnKeyPressed. We do nothing here.
bool OnMouseScroll(MouseScrolledEvent &e)
Event OnMouseScroll. Scale the camera.
bool OnSlateResized(SlateResizeEvent &e)
Event OnWindowResized. Reset Camera aspect ratio.

References Spices::EventDispatcher::EventDispatcher(), OnKeyPressed(), OnMouseScroll(), and OnSlateResized().