Toast Engine
Toggle main menu visibility
Loading...
Searching...
No Matches
ui_element.hpp
Go to the documentation of this file.
1
8
9
#pragma once
10
#include <string>
11
#include <string_view>
12
#include <
toast/assets/core_types.hpp
>
13
#include <
toast/export.hpp
>
14
15
namespace
assets {
16
17
class
TOAST_API UIElement :
public
Asset {
18
public
:
19
explicit
UIElement(std::vector<uint8_t> data) : m_source(
reinterpret_cast<
const
char
*
>
(data.data()), data.size()) { }
20
21
[[nodiscard]]
22
auto
type()
const
-> std::string_view
override
{
23
return
"ui_element"
;
24
}
25
26
[[nodiscard]]
27
auto
source()
const
noexcept
-> std::string_view {
28
return
m_source;
29
}
30
31
void
setSource(std::vector<uint8_t> data) { m_source.assign(
reinterpret_cast<
const
char
*
>
(data.data()), data.size()); }
32
33
private
:
34
std::string m_source;
35
};
36
37
}
core_types.hpp
Base types for the asset system.
export.hpp
engine
src
toast
ui
assets
ui_element.hpp
Generated by
1.17.0