JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
ScrollArea.hpp
1// Copyright 2026 Jan Niklas Hasse <jhasse@bixense.com>
2// For conditions of distribution and use, see copyright notice in LICENSE.txt
3#pragma once
4
5namespace jngl {
6
7class Mat3;
8
9class ScrollArea {
10public:
11 explicit ScrollArea(float height);
12
16
19
20private:
21 float height;
22 float scrollY = 0;
23 float targetScrollY = 0;
24 bool active = false;
25 double startMouseX = 0;
26 double startMouseY = 0;
27 double previousMouseY = 0;
28 bool notSureIfHorizontalOrVeriticalScroll = false;
29 float speed = 0;
30};
31
32} // namespace jngl
3x3 matrix
Definition Mat3.hpp:18
void updateModelview(Mat3 &modelview) const
Call this method during draw of your Scene. It updates the passed Modelview matrix.
void stepAndTransformInput()
Call this method during step of your Scene.
JNGL's main namespace.
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.