完成UI管理器与UI元素
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
#pragma once
|
||||
#include "sprite.h"
|
||||
#include "../utils/math.h"
|
||||
#include <string>
|
||||
#include <optional> // For std::optional
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
struct SDL_Renderer;
|
||||
struct SDL_FRect;
|
||||
struct SDL_FColor;
|
||||
|
||||
namespace engine::resource {
|
||||
class ResourceManager;
|
||||
@@ -67,6 +68,13 @@ public:
|
||||
*/
|
||||
void drawUISprite(const Sprite& sprite, const glm::vec2& position, const std::optional<glm::vec2>& size = std::nullopt);
|
||||
|
||||
/**
|
||||
* @brief 绘制填充矩形
|
||||
*
|
||||
* @param rect 矩形区域
|
||||
* @param color 填充颜色
|
||||
*/
|
||||
void drawUIFilledRect(const engine::utils::Rect& rect, const engine::utils::FColor& color);
|
||||
|
||||
void present(); ///< @brief 更新屏幕,包装 SDL_RenderPresent 函数
|
||||
void clearScreen(); ///< @brief 清屏,包装 SDL_RenderClear 函数
|
||||
|
||||
Reference in New Issue
Block a user