Plutonium framework API  0.3
Simple UI framework for libnx and SDL2
elm_TextBlock.hpp
Go to the documentation of this file.
1 
2 /*
3 
4  Plutonium library
5 
6  @file TextBlock.hpp
7  @brief A TextBlock is a very useful Element which is used to draw text on the screen.
8  @author XorTroll
9 
10  @copyright Plutonium project - an easy-to-use UI framework for Nintendo Switch homebrew
11 
12 */
13 
14 #pragma once
15 #include <pu/pu_String.hpp>
17 
18 namespace pu::ui::elm
19 {
20  class TextBlock : public Element
21  {
22  public:
23  TextBlock(i32 X, i32 Y, String Text);
25  ~TextBlock();
26 
27  i32 GetX();
28  void SetX(i32 X);
29  i32 GetY();
30  void SetY(i32 Y);
31  i32 GetWidth();
32  i32 GetHeight();
33  i32 GetTextWidth();
35  String GetText();
36  void SetText(String Text);
37  void SetFont(String font_name);
38  Color GetColor();
39  void SetColor(Color Color);
40  void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y);
41  void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos);
42  private:
43  String text;
44  i32 x;
45  i32 y;
46  String fnt_name;
47  Color clr;
48  sdl2::Texture ntex;
49  };
50 }
Definition: elm_Button.hpp:19
Definition: pu_String.hpp:21
Definition: ui_Types.hpp:24
Definition: ui_Types.hpp:38
void OnRender(render::Renderer::Ref &Drawer, i32 X, i32 Y)
TextBlock(i32 X, i32 Y, String Text)
void OnInput(u64 Down, u64 Up, u64 Held, Touch Pos)
SDL_Texture * Texture
Definition: sdl2_Types.hpp:11
void SetFont(String font_name)
s32 i32
Definition: pu_Macros.hpp:17
#define PU_SMART_CTOR(type)
Definition: pu_Macros.hpp:8
void SetColor(Color Color)
void SetText(String Text)
Definition: elm_Element.hpp:34
Definition: elm_TextBlock.hpp:20