mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-08-09 02:07:04 +08:00
feat(ui): add word wrap for chat messages with font width measurement
This commit is contained in:
@@ -56,6 +56,7 @@ public:
|
||||
TextMesh vertices(const std::string& text);
|
||||
const Texture* text_texture();
|
||||
static const std::string& font_path();
|
||||
static float text_width(const std::string& text);
|
||||
|
||||
private:
|
||||
FT_Library m_ft;
|
||||
|
||||
@@ -51,5 +51,6 @@ private:
|
||||
void on_render(Renderer& renderer) override;
|
||||
bool handle_text_input_event(const TextInputEvent& e) override;
|
||||
bool handle_key_event(const KeyEvent& e) override;
|
||||
std::vector<std::string> wrap_message(const std::string& text) const;
|
||||
};
|
||||
} // namespace Cubed
|
||||
Reference in New Issue
Block a user