18#include <OgreHardwareVertexBuffer.h>
19#include <OgreRenderQueueListener.h>
21#include <Overlay/OgreUTFString.h>
76 colour(Ogre::ColourValue::White),
261 void SetPadding(
const float top,
const float right,
const float bottom,
const float left);
268 void SetText(
const Ogre::UTFString& text);
275 void SetText(
const char* text)
override;
402 void SetTextFromNode(TiXmlNode* node,
const Ogre::ColourValue& colour);
TextState
The textarea state.
Definition: UiTextArea.h:32
@ TS_SCROLL_TEXT
The text is scrolling.
Definition: UiTextArea.h:42
@ TS_OVERFLOW
The text is overflowing.
Definition: UiTextArea.h:62
@ TS_NEXT_PAGE
The text is changing pages.
Definition: UiTextArea.h:67
@ TS_PAUSE_OK
The text is paused waiting for input.
Definition: UiTextArea.h:47
@ TS_PAUSE_TIME
The text is paused waiting for time to pass.
Definition: UiTextArea.h:52
@ TS_SHOW_TEXT
The text is displayed.
Definition: UiTextArea.h:37
@ TS_DONE
The textarea is done with.
Definition: UiTextArea.h:57
The UI widgets font.
Definition: UiFont.h:64
A sprite.
Definition: UiSprite.h:26
An ingame textarea.
Definition: UiTextArea.h:163
void InputRepeated()
Handles a key being hold.
Definition: UiTextArea.cpp:195
unsigned int max_letters_
Max letter per textarea.
Definition: UiTextArea.h:445
TextAlign
Text alignment in the text area.
Definition: UiTextArea.h:228
@ CENTER
Horizontally centered text.
Definition: UiTextArea.h:243
@ RIGHT
Right aligned text.
Definition: UiTextArea.h:238
@ LEFT
Left aligned text.
Definition: UiTextArea.h:233
float text_print_speed_mod_
Definition: UiTextArea.h:485
float text_y_offset_target_
Definition: UiTextArea.h:510
TextState text_state_
The state of the text.
Definition: UiTextArea.h:490
std::vector< TextChar > text_
The text.
Definition: UiTextArea.h:470
float padding_right_
The right padding.
Definition: UiTextArea.h:540
void Initialise()
Sets default values for the UiTextArea.
Definition: UiTextArea.cpp:44
virtual void UpdateTransformation()
Updates the UiTextArea.
Definition: UiTextArea.cpp:187
void RemoveSpritesFromText(const unsigned int end)
Removes the prites from the text.
Definition: UiTextArea.cpp:278
float pause_time_
The time to pause the text.
Definition: UiTextArea.h:515
float padding_bottom_
The bottom padding.
Definition: UiTextArea.h:545
void InputPressed()
Handles a keypress.
Definition: UiTextArea.cpp:193
UiFont * font_
The font for the text.
Definition: UiTextArea.h:460
void SetTextAlign(const TextAlign align)
Sets the text alignment in the text area.
Definition: UiTextArea.cpp:197
virtual ~UiTextArea()
Destroys the UiTextArea.
Definition: UiTextArea.cpp:42
const UiFont * GetFont() const
Retrieves the font.
Definition: UiTextArea.cpp:325
float GetTextLimit() const
Gets the text limit.
Definition: UiTextArea.cpp:378
bool next_pressed_
Indicates if the 'next' button has been pressed.
Definition: UiTextArea.h:525
void CreateVertexBuffer()
Creates a vertex buffer for the textarea.
Definition: UiTextArea.cpp:931
void DestroyVertexBuffer()
Destroys a vertex buffer for the textarea.
Definition: UiTextArea.cpp:951
void SetPadding(const float top, const float right, const float bottom, const float left)
Sets the paddings in the text area.
Definition: UiTextArea.cpp:202
unsigned int GetTextSize() const
Gets the text size.
Definition: UiTextArea.cpp:380
int timer_time_
Definition: UiTextArea.h:560
void SetVariable(const Ogre::String &name, const Ogre::UTFString &value)
Sets a variable in the text.
Definition: UiTextArea.cpp:331
void SetText(const Ogre::UTFString &text)
Sets the text from a string.
Definition: UiTextArea.cpp:233
bool next_repeated_
Indicates if the 'next' button is being held down.
Definition: UiTextArea.h:530
Ogre::SceneManager * scene_manager_
The scene manager.
Definition: UiTextArea.h:435
float GetPauseTime() const
Retrieves the pause time of the text.
Definition: UiTextArea.cpp:382
std::vector< TextVariable > text_variable_
Variables in the text.
Definition: UiTextArea.h:495
float text_scroll_time_
Time to scroll the text.
Definition: UiTextArea.h:500
void SetTextFromNode(TiXmlNode *node, const Ogre::ColourValue &colour)
Prepares text from a XML node.
Definition: UiTextArea.cpp:756
Ogre::MaterialPtr material_
Material for the text area.
Definition: UiTextArea.h:430
Ogre::UTFString GetVariable(const Ogre::String &name) const
Gets the value of a variable in the text.
Definition: UiTextArea.cpp:370
void PrepareTextFromText(const Ogre::UTFString &text, const Ogre::ColourValue &colour)
Prepares text from a string.
Definition: UiTextArea.cpp:920
void UpdateGeometry()
Updates the UiTextArea geometry.
Definition: UiTextArea.cpp:384
virtual void Render()
Renders the UiTextArea on the screen.
Definition: UiTextArea.cpp:160
float padding_top_
The top padding.
Definition: UiTextArea.h:535
TextState GetTextState() const
Checks the text state.
Definition: UiTextArea.cpp:376
float text_limit_
The text limit.
Definition: UiTextArea.h:475
void TextClear()
Removes the text from the text area.
Definition: UiTextArea.cpp:269
float text_y_offset_
Definition: UiTextArea.h:505
virtual void Update()
Updates the UiTextArea.
Definition: UiTextArea.cpp:73
void SetFont(const Ogre::String &font)
Set the font for the text.
Definition: UiTextArea.cpp:292
void SetTextPrintSpeed(const float speed)
Sets the printing speed.
Definition: UiTextArea.cpp:327
float text_print_speed_
The text printing speed.
Definition: UiTextArea.h:480
Ogre::RenderSystem * render_system_
The render system.
Definition: UiTextArea.h:440
bool timer_
Definition: UiTextArea.h:555
Ogre::HardwareVertexBufferSharedPtr vertex_buffer_
The text area vertext buffer.
Definition: UiTextArea.h:455
void PrepareTextFromNode(TiXmlNode *node, const Ogre::ColourValue &colour)
Prepares text from a XML node.
Definition: UiTextArea.cpp:588
unsigned int next_page_start_
Definition: UiTextArea.h:520
TextAlign text_align_
The text alignment.
Definition: UiTextArea.h:465
float padding_left_
The left padding.
Definition: UiTextArea.h:550
Ogre::RenderOperation render_operation_
The render operation.
Definition: UiTextArea.h:450
float GetTextWidth() const
Retrieves the text width.
Definition: UiTextArea.cpp:573
void SetTextScrollTime(const float time)
Sets the scroll duration.
Definition: UiTextArea.cpp:329
Ogre::String String
Definition: TypeDefine.h:37
A character in a text.
Definition: UiTextArea.h:73
UiSprite * sprite
If the character is a symbol or an image, this is the sprite.
Definition: UiTextArea.h:132
bool skip
Indicates if the character is to be actually printed.
Definition: UiTextArea.h:102
float sprite_y
If the character is a symbol or an image, this is the Y position.
Definition: UiTextArea.h:137
float pause_time
For pause characters, the time.
Definition: UiTextArea.h:122
Ogre::String variable
If the character is a variable, the variable name.
Definition: UiTextArea.h:107
bool pause_ok
Indicates if the OK button has been pressed during a text pause.
Definition: UiTextArea.h:117
bool next_page
Indicates if the character is a new page character.
Definition: UiTextArea.h:127
int char_code
The character code.
Definition: UiTextArea.h:92
unsigned int variable_len
If the character is a variable, the variable length.
Definition: UiTextArea.h:112
Ogre::ColourValue colour
Color for the character.
Definition: UiTextArea.h:97
TextChar()
Definition: UiTextArea.h:74
A variable displayed in a text.
Definition: UiTextArea.h:143
Ogre::String name
The variable name.
Definition: UiTextArea.h:148
Ogre::UTFString value
The variable value, resolved as a string.
Definition: UiTextArea.h:153