mirror of
https://github.com/XorTroll/uLaunch
synced 2024-11-26 22:00:29 +00:00
42 lines
No EOL
1.2 KiB
C++
42 lines
No EOL
1.2 KiB
C++
|
|
// Grabbed from Goldleaf's source code
|
|
|
|
#pragma once
|
|
#include <q_Include.hpp>
|
|
#include <pu/Plutonium>
|
|
|
|
namespace ui
|
|
{
|
|
class ClickableImage : public pu::ui::elm::Element
|
|
{
|
|
public:
|
|
ClickableImage(s32 X, s32 Y, pu::String Image);
|
|
PU_SMART_CTOR(ClickableImage)
|
|
~ClickableImage();
|
|
|
|
s32 GetX();
|
|
void SetX(s32 X);
|
|
s32 GetY();
|
|
void SetY(s32 Y);
|
|
s32 GetWidth();
|
|
void SetWidth(s32 Width);
|
|
s32 GetHeight();
|
|
void SetHeight(s32 Height);
|
|
pu::String GetImage();
|
|
void SetImage(pu::String Image);
|
|
bool IsImageValid();
|
|
void SetOnClick(std::function<void()> Callback);
|
|
void OnRender(pu::ui::render::Renderer::Ref &Drawer, s32 X, s32 Y);
|
|
void OnInput(u64 Down, u64 Up, u64 Held, pu::ui::Touch Pos);
|
|
protected:
|
|
pu::String img;
|
|
pu::ui::render::NativeTexture ntex;
|
|
s32 x;
|
|
s32 y;
|
|
s32 w;
|
|
s32 h;
|
|
std::function<void()> cb;
|
|
std::chrono::steady_clock::time_point touchtp;
|
|
bool touched;
|
|
};
|
|
} |