JNGL
Easy to use cross-platform 2D game library
Loading...
Searching...
No Matches
jngl
Alpha.hpp
Go to the documentation of this file.
1
// Copyright 2024-2025 Jan Niklas Hasse <jhasse@bixense.com>
2
// For conditions of distribution and use, see copyright notice in LICENSE.txt
5
#pragma once
6
7
#include <
cstdint
>
8
9
namespace
jngl
{
12
class
Alpha
{
13
public
:
17
explicit
Alpha
(
float
alpha);
18
20
static
Alpha
u8
(uint8_t alpha);
21
23
[[nodiscard]] uint8_t
u8
()
const
;
24
26
float
getAlpha
()
const
;
28
void
setAlpha
(
float
);
29
30
private
:
31
float
alpha;
32
};
33
34
}
// namespace jngl
jngl::Alpha
Object representing only the Alpha Channel in an RGBA color, 0 meaning invisible, 1 fully visible.
Definition
Alpha.hpp:12
jngl::Alpha::u8
uint8_t u8() const
0...255
jngl::Alpha::getAlpha
float getAlpha() const
0.0f ... 1.0f
jngl::Alpha::u8
static Alpha u8(uint8_t alpha)
jngl::Alpha::Alpha
Alpha(float alpha)
jngl::Alpha::setAlpha
void setAlpha(float)
0.0f ... 1.0f
cstdint
jngl
JNGL's main namespace.
Definition
Achievement.hpp:10