ShitEngine
基于 C++20 与 SDL3 的轻量级 2D 游戏引擎
Toggle main menu visibility
载入中...
搜索中...
未找到
UITextArea.h
浏览该文件的文档.
1
#pragma once
2
#include "
../Core/Core.h
"
3
#include "
UITextInput.h
"
4
#include <string>
5
6
namespace
Shit
{
15
class
SHIT_API
SHIT_REFLECT
(BlackList)
UITextArea
:
public
UITextInput
{
16
SHIT_REFLECT_BODY
(
UITextArea
)
17
public
:
18
UITextArea
();
19
~UITextArea
()
override
=
default
;
20
21
protected
:
22
void
onRender
(
const
SDL_FRect& screenRect)
override
;
23
bool
onKeyDown
(
KeyCode
key,
bool
shift,
bool
ctrl)
override
;
24
void
insertNewline
()
override
;
25
26
private
:
27
SHIT_META
(Disable)
28
float
m_scrollY = 0.0f;
29
};
30
}
Core.h
SHIT_API
#define SHIT_API
定义
Core.h:14
SHIT_REFLECT_BODY
#define SHIT_REFLECT_BODY(Type)
定义
Macros.h:62
SHIT_REFLECT
#define SHIT_REFLECT(Mode)
定义
Macros.h:59
SHIT_META
#define SHIT_META(...)
定义
Macros.h:68
UITextInput.h
Shit::UITextArea::onKeyDown
bool onKeyDown(KeyCode key, bool shift, bool ctrl) override
子类可覆写:处理键盘控制键(方向键、退格、删除、Home/End、回车)
Shit::UITextArea::UITextArea
UITextArea()
Shit::UITextArea::onRender
void onRender(const SDL_FRect &screenRect) override
子类实现:在给定屏幕矩形内绘制自身(通过 Renderer 静态 API 绘制)
Shit::UITextArea::~UITextArea
~UITextArea() override=default
Shit::UITextArea::insertNewline
void insertNewline() override
子类可覆写:当前选区是否被替换为换行(UITextBox 拒绝)
Shit::UITextInput::UITextInput
UITextInput()=default
Shit
定义
AudioPlayer.h:10
Shit::KeyCode
KeyCode
定义
KeyCode.h:8
include
ShitEngine
UI
UITextArea.h
制作者
1.17.0