Files
IAEngine/Engine/Src/Inc/IAEngine/UI.hpp
Isuru Samarathunga b10aacaee7 Text Rendering
2025-10-20 23:39:54 +05:30

65 lines
2.5 KiB
C++

// IAEngine: 2D Game Engine by IA
// Copyright (C) 2025 IASoft (PVT) LTD (oss@iasoft.dev)
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
#pragma once
#include <IAEngine/Base.hpp>
namespace ia::iae
{
class UI
{
public:
STATIC CONSTEXPR UINT8 MAX_VARIABLE_COUNT = 10;
public:
STATIC VOID AddFontFromFile(IN CONST String &path);
STATIC VOID SetMarkup(IN CONST String &markup, IN CONST String &styles);
STATIC VOID AddClickEvent(IN PCCHAR elementId, IN std::function<VOID()> callback);
STATIC VOID AddPointerUpEvent(IN PCCHAR elementId, IN std::function<VOID()> callback);
STATIC VOID AddPointerDownEvent(IN PCCHAR elementId, IN std::function<VOID()> callback);
STATIC VOID AddPointerExitEvent(IN PCCHAR elementId, IN std::function<VOID()> callback);
STATIC VOID AddPointerEnterEvent(IN PCCHAR elementId, IN std::function<VOID()> callback);
STATIC VOID SetNumericVariable(IN UINT8 index, IN INT64 value);
STATIC VOID SetStringVariable(IN UINT8 index, IN CONST String &value);
STATIC INT64 GetNumericVariable(IN UINT8 index);
STATIC String GetStringVariable(IN UINT8 index);
STATIC INT32 GetElementWidth(IN CONST String &elementId);
STATIC VOID SetElementWidth(IN CONST String &elementId, IN INT32 value);
STATIC INT32 GetElementHeight(IN CONST String &elementId);
STATIC VOID SetElementHeight(IN CONST String &elementId, IN INT32 value);
public:
STATIC VOID Initialize();
STATIC VOID Terminate();
STATIC VOID Update();
STATIC VOID Draw();
STATIC VOID OnSDLEvent(IN PVOID event);
STATIC VOID OnScreenResize(IN INT32 newWidth, IN INT32 newHeight);
private:
STATIC INT64 s_numericVariables[MAX_VARIABLE_COUNT];
STATIC std::string s_stringVariables[MAX_VARIABLE_COUNT];
};
} // namespace ia::iae