OpenSiv3D
OpenSiv3D copied to clipboard
複数行の入力ができるテキストボックス
reported by: https://siv3d.slack.com/archives/C03MZP8SH/p1652414866150069
Siv3D Slack: #textArea 仮実装: https://gist.github.com/kerochan/d5034b86a485f328fecef69d57add75c
レビュー 1 回目: https://gist.github.com/Reputeless/6d969e825be71c0205048fbfe60ed179
サンプル
# include <Siv3D.hpp> // OpenSiv3D v0.6.9
void Main()
{
Scene::SetBackground(ColorF{ 0.8, 0.9, 1.0 });
const String text = TextReader{ U"example/LICENSE.txt" }.readAll();
TextAreaEditState textAreaEditState{ text };
bool enabled = true;
while (System::Update())
{
if (SimpleGUI::Button(U"クリア", Vec2{ 40, 40 }, 100, TextInput::GetEditingText().isEmpty()))
{
textAreaEditState.clear();
}
SimpleGUI::CheckBox(enabled, U"enabled", Vec2{ 160, 40 });
SimpleGUI::TextArea(textAreaEditState, Vec2{ 40, 90 }, SizeF{ 600, 300 }, SimpleGUI::PreferredTextAreaMaxChars, enabled);
}
}