Maria GDK 5.0.0.738
Documentation of native code in develop branch
Loading...
Searching...
No Matches
Maria::EntityBadge Class Reference
Inheritance diagram for Maria::EntityBadge:
STK::RenderItem2D

Public Types

enum class  HAlignment { Left , Center , Right }
 
enum class  VAlignment { Top , Center , Bottom }
 

Public Member Functions

 EntityBadge (std::shared_ptr< STK::FontManager > font_manager)
 
void setBackgroundColor (STK::Color4f color)
 
STK::Color4f getBackgroundColor () const
 
void setOutlineColor (STK::Color4f color)
 
STK::Color4f getOutlineColor () const
 
void setPadding (double up, double right, double down, double left)
 
void getPadding (double &up, double &right, double &down, double &left) const
 
void setCornerRadius (float corner_radius)
 
float getCornerRadius () const
 
void setHAlignment (HAlignment h_alignment)
 
HAlignment getHAlignment () const
 
void setVAlignment (VAlignment v_alignment)
 
VAlignment getVAlignment () const
 
STK::Vector2f getSize ()
 
STK::Vector2f getOuterSize ()
 
float getOutlineThickness () const
 
void setText (std::string text, int section_index, int item_index)
 
std::string getText (int section_index, int item_index)
 
void setFontFamily (std::string font_family, int section_index, int item_index)
 
void setFontFamily (std::string font_family)
 
std::string getFontFamily (int section_index, int item_index) const
 
void setFontStyle (STK::FontStyle font_style, int section_index, int item_index)
 
void setFontStyle (STK::FontStyle font_style)
 
STK::FontStyle getFontStyle (int section_index, int item_index) const
 
void setTextColor (STK::Color4f color, int section_index, int item_index)
 
void setTextColor (STK::Color4f color)
 
STK::Color4f getTextColor (int section_index, int item_index) const
 
void setFontSize (int font_size)
 
int getFontSize () const
 
void setTextSpacing (float text_spacing)
 
float getTextSpacing () const
 
void setGrammarStyling (Maria::Grammar::Styling grammar_styling)
 
void setGrammarStyling (Maria::Grammar::Styling grammar_styling, Maria::Grammar::Contrast grammar_contrast)
 
Maria::Grammar::Styling getGrammarStyling () const
 
Maria::Grammar::Contrast getContrastMode () const
 
void setDrawOutline (bool draw_outline)
 
bool getDrawOutline () const
 
void addIcon (std::shared_ptr< STK::IconRenderItem > icon, int section_index)
 
void removeIcon (int section_index, int item_index)
 
void setIconColor (STK::Color4f color, int section_index, int item_index)
 
void setIconColor (STK::Color4f color)
 
STK::Color4f getIconColor (int section_index, int item_index) const
 
void setSeparatorColor (STK::Color4f color)
 
STK::Color4f getSeparatorColor () const
 
float getIconHeight ()
 
void setDrawSeparator (bool draw)
 
bool getDrawSeparator () const
 
void setKeepUpright (bool keep_upright)
 Flip the text and icons when rotated more than 90 and less than 270 degrees.
 
bool getKeepUpright () const
 Flip the text and icons when rotated more than 90 and less than 270 degrees.
 
- Public Member Functions inherited from STK::RenderItem2D
virtual void render (GraphicsRender2D &renderer, const STK::Matrix4x4f &pj, const STK::Matrix4x4f &vm, const STK::Viewport &vp)=0
 
virtual void cleanupBuffers ()=0
 
virtual int getBatchId () const =0
 
void setDepth (float depth)
 
float getDepth () const
 
void setStencilValue (unsigned char stencil_value)
 Set value for stencil operations.
 
unsigned char getStencilValue () const
 Get value for stencil operations.
 
void setStencilMode (StencilMode mode)
 Stencil buffer operations.
 
StencilMode getStencilMode () const
 Stencil buffer operations.
 
const STK::Matrix4x4fgetTransform ()
 
void setPosition (float x, float y)
 Set 2D position of the item. This method will invalidate the transform and cause it to be recalculated on the next frame.
 
void setPosition (const STK::Vector2f &pos)
 Same as above.
 
void setPositionX (float x)
 Set X position separately.
 
void setPositionY (float y)
 Set Y position separately.
 
const STK::Vector2fgetPosition () const
 
float getPositionX () const
 
float getPositionY () const
 
void setScale (const STK::Vector2f &scale)
 
void setScale (float scale)
 Set scale factor for the text item. This method will invalidate the transform and cause it to be recalculated on the next frame.
 
STK::Vector2f getScale () const
 Returns current scale factor for the item.
 
void setAngle (float angle)
 Set rotation angle for the item. Positive rotation direction is counter-clockwise. This method will invalidate the transform and cause it to be recalculated on the next frame.
 
float getAngle () const
 
void setTransform (const STK::Matrix4x4f &transform)
 Set transform directly. This method will set the transformation matrix for this item directly. This will override any values for setPosition(), setScale(), setDepth() and setAngle(). Also, any subsequent calls to these methods will again override this method. In short, either use setTransform() or setPosition/Scale/Angle/Depth.
 
void setPreTransform (const STK::Matrix4x4f &transform)
 
void setPostTransform (const STK::Matrix4x4f &transform)
 
std::optional< STK::Matrix4x4fgetPreTransform () const
 
std::optional< STK::Matrix4x4fgetPostTransform () const
 
void setOpacity (float opacity)
 
float getOpacity () const
 
virtual STK::Box2< float > getViewBoundingBox (const STK::Matrix4x4f &mvp, const STK::Viewport &glVp, bool reverse_y=false)=0
 Get bounding box in viewport pixel coordinates.
 

Static Public Member Functions

static int getNumLabelSections ()
 
static int getNumIconSections ()
 
static int getNumTextItems ()
 
static int getNumIcons ()
 

Additional Inherited Members

- Protected Member Functions inherited from STK::RenderItem2D
virtual void updateTransform ()
 
void setViewScale (float x, float y)
 
- Protected Attributes inherited from STK::RenderItem2D
float depth_ = 0
 
STK::Matrix4x4f transform_
 
STK::Vector2f pos_
 
float angle_ = 0.0f
 
float opacity_ = 1.0f
 
STK::Vector2f scale_ { 1.0f, 1.0f }
 
bool transform_dirty_ = false
 
std::optional< STK::Matrix4x4fpre_transform_
 
std::optional< STK::Matrix4x4fpost_transform_
 
std::mutex xfm_mutex_
 
unsigned char stencil_value_ = 0
 
StencilMode stencil_mode_ = StencilMode::NONE
 
float view_scale_x_ = 1.0f
 
float view_scale_y_ = 1.0f
 

The documentation for this class was generated from the following files: