JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
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
5
namespace
jngl
{
6
7
class
Mat3;
8
9
class
ScrollArea
{
10
public
:
11
explicit
ScrollArea
(
float
height);
12
15
void
stepAndTransformInput
();
16
18
void
updateModelview
(
Mat3
&
modelview
)
const
;
19
20
private
:
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
jngl::Mat3
3x3 matrix
Definition
Mat3.hpp:18
jngl::ScrollArea
Definition
ScrollArea.hpp:9
jngl::ScrollArea::updateModelview
void updateModelview(Mat3 &modelview) const
Call this method during draw of your Scene. It updates the passed Modelview matrix.
jngl::ScrollArea::stepAndTransformInput
void stepAndTransformInput()
Call this method during step of your Scene.
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10
jngl::modelview
jngl::Mat3 modelview()
Returns a copy of the global ModelView matrix.