Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_UI
LumaButton.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <
ivorium_graphics/ivorium_graphics.hpp
>
4
#include "
LumaSystem.hpp
"
5
6
namespace
iv
7
{
8
17
class
LumaButton
:
public
PickableSlot
,
public
LumaListener
,
public
TranslucentElem
18
{
19
public
:
20
ClientMarker
cm
;
21
using
PickableSlot::instance
;
22
23
static
const
constexpr
int
DefaultShadowHeightPx
= 2;
24
25
LumaButton
(
Instance
* inst,
LumaStyleId
style
=
LumaStyleId
() );
26
27
LumaButton
*
sufraceNeutralColor
( std::optional< float4 > );
28
LumaButton
*
overlayNeutralColor
( std::optional< float4 > );
29
LumaButton
*
resizeStage
(
FlatShader::ResizeStage
);
30
LumaButton
*
surface
(
ResourcePath
);
31
LumaButton
*
overlay
(
ResourcePath
);
32
LumaButton
*
hot
(
ResourcePath
);
33
34
LumaButton
*
preblend
(
float4
val );
35
LumaButton
*
translucent
(
bool
val );
36
37
// initialization parameters
40
DirtyAttr< std::optional< float4 >
>
attr_sufraceNeutralColor
;
41
44
DirtyAttr< std::optional< float4 >
>
attr_overlayNeutralColor
;
45
49
DirtyAttr< FlatShader::ResizeStage >
attr_resizeStage
;
50
55
DirtyAttr< ResourcePath >
attr_surface
;
56
61
DirtyAttr< ResourcePath >
attr_overlay
;
62
67
DirtyAttr< ResourcePath >
attr_hot
;
68
69
protected
:
70
// Elem
71
virtual
void
first_pass_impl
(
ElementRenderer
* )
override
;
72
73
// LumaButton
78
virtual
void
ColorsChanged
(
float4
surface
,
float4
on_surface ){}
79
80
void
CallColorsChanged
();
81
Slot
surface_slot
;
82
83
protected
:
84
virtual
void
LumaStyleChanged
(
LumaStyle
const
& )
override
;
85
86
private
:
87
AnimHeap
anim;
88
89
Lambda_Connector
* lambda;
90
Activator
activator_ref;
91
bool
hot_last;
92
93
//Image * img_shadow;
94
Image
* img_surface;
95
Image
* img_overlay;
96
97
Image
* img_activation;
98
Image
* img_hot;
99
};
100
101
}