TDME2 1.9.121
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Attributes | Friends | List of all members
GUITextureBaseNode Class Referenceabstract

GUI texture base node. More...

#include <tdme/gui/nodes/GUITextureBaseNode.h>

Inheritance diagram for GUITextureBaseNode:
Inheritance graph
Collaboration diagram for GUITextureBaseNode:
Collaboration graph

Classes

struct  RequestedDimensionConstraints
 

Public Member Functions

int getContentWidth () override
 
int getContentHeight () override
 
void dispose () override
 Dispose node. More...
 
void render (GUIRenderer *guiRenderer) override
 Render. More...
 
void setTextureMatrix (const Matrix2D3x3 &textureMatrix)
 Set texture matrix. More...
 
const GUIColorgetEffectColorMul ()
 
void setEffectColorMul (const GUIColor &effectColorMul)
 Set effect color mul. More...
 
const GUIColorgetEffectColorAdd ()
 
void setEffectColorAdd (const GUIColor &effectColorAdd)
 Set effect color add. More...
 
GUINode_ClippinggetClipping ()
 
const string & getMask ()
 
void setMask (const string &mask)
 Set mask source. More...
 
float getMaskMaxValue ()
 
void setMaskMaxValue (float maskMaxValue)
 Set maximum value of mask to display image. More...
 
- Public Member Functions inherited from GUINode
GUIScreenNodegetScreenNode ()
 
GUIParentNodegetParentNode ()
 
const string & getId ()
 
const string getHierarchicalId ()
 
virtual const string getNodeType ()=0
 
virtual int getContentWidth ()=0
 
virtual int getContentHeight ()=0
 
virtual int getAutoWidth ()
 
virtual int getAutoHeight ()
 
GUINode_BordergetBorder ()
 
GUINode_PaddinggetPadding ()
 
GUINode_RequestedConstraintsgetRequestsConstraints ()
 
GUINode_ComputedConstraintsgetComputedConstraints ()
 
GUIColorgetBackgroundColor ()
 
virtual void dispose ()
 Dispose node. More...
 
bool isConditionsMet ()
 Determine if conditions are set. More...
 
virtual void setConditionsMet ()
 Set conditions met for this node and its subnodes. More...
 
virtual void layoutOnDemand ()
 Layout on demand. More...
 
bool hasEffects ()
 
virtual void applyEffects (GUIRenderer *guiRenderer)
 Apply effects. More...
 
virtual void undoEffects (GUIRenderer *guiRenderer)
 Undo effects. More...
 
virtual void render (GUIRenderer *guiRenderer)
 Render. More...
 
float computeParentChildrenRenderOffsetXTotal ()
 
float computeParentChildrenRenderOffsetYTotal ()
 
bool isEventBelongingToNode (GUIMouseEvent *event, Vector2 &position)
 Is event belonging to node. More...
 
bool isEventBelongingToNode (GUIMouseEvent *event)
 Is event belonging to node. More...
 
void getEventOffNodeRelativePosition (GUIMouseEvent *event, Vector2 &position)
 Get event off node relative position TODO: use Vector2 instead of array<float, 2> More...
 
void getEventNodePosition (GUIMouseEvent *event, Vector2 &position)
 Get event position clamped to node constraints TODO: use Vector2 instead of array<float, 2> More...
 
GUIParentNodegetParentControllerNode ()
 
virtual void determineMouseEventNodes (GUIMouseEvent *event, bool floatingNode, unordered_set< string > &eventNodeIds, unordered_set< string > &eventFloatingNodeIds)
 Determine mouse event nodes. More...
 
GUINodeControllergetController ()
 
void setController (GUINodeController *controller)
 Set up node controller. More...
 
void scrollToNodeY (GUIParentNode *toNode=nullptr)
 Scroll to node Y. More...
 
void scrollToNodeX (GUIParentNode *toNode=nullptr)
 Scroll to node X. More...
 
void setBackgroundImage (const string &backgroundImage)
 Set background image. More...
 
int getGUIEffectOffsetX ()
 
void setGUIEffectOffsetX (int guiEffectOffsetX)
 Set GUI effect offset X. More...
 
int getGUIEffectOffsetY ()
 
void setGUIEffectOffsetY (int guiEffectOffsetY)
 Set GUI effect offset Y. More...
 
GUIEffectStategetEffectState ()
 
GUIEffectgetEffect (const string &id)
 Get effect. More...
 
void addEffect (const string &id, GUIEffect *effect)
 Add effect, effect already registered with the is will be removed. More...
 
void removeEffect (const string &id)
 Remove effect. More...
 

Static Public Member Functions

static GUINode_Clipping createClipping (const string &allClipping, const string &left, const string &top, const string &right, const string &bottom)
 Create clipping. More...
 
static RequestedDimensionConstraints createRequestedDimensionConstraints (const string &width, const string &height)
 Create requested dimension constraints. More...
 
- Static Public Member Functions inherited from GUINode
static GUINode_Alignments createAlignments (const string &horizontal, const string &vertical)
 Create alignments. More...
 
static GUINode_RequestedConstraints createRequestedConstraints (const string &left, const string &top, const string &width, const string &height, int factor)
 Create requested constraints. More...
 
static GUIColor getRequestedColor (const string &color, const GUIColor &defaultColor)
 Get color. More...
 
static GUINode_FlowcreateFlow (const string &flow)
 Create flow. More...
 
static GUINode_Border createBorder (const string &allBorder, const string &left, const string &top, const string &right, const string &bottom, const string &allBorderColor, const string &leftColor, const string &topColor, const string &rightColor, const string &bottomColor)
 Create border. More...
 
static GUINode_Padding createPadding (const string &allPadding, const string &left, const string &top, const string &right, const string &bottom)
 Create padding. More...
 
static GUINode_Scale9Grid createScale9Grid (const string &all, const string &left, const string &top, const string &right, const string &bottom)
 Create scale 9 grid. More...
 
static GUINodeConditions createConditions (const string &conditions)
 Create conditions. More...
 
static void dumpNode (GUINode *node, int depth=0, int indent=0, int depthIdx=0)
 Dump node. More...
 
static void dumpParentNodes (GUINode *node, int indent=0)
 Dump parent nodes. More...
 

Protected Member Functions

 GUITextureBaseNode (GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn, const RequestedDimensionConstraints &requestedDimensionConstraints, bool mirrorX, bool mirrorY, const GUIColor &effectColorMul, const GUIColor &effectColorAdd, const GUINode_Scale9Grid &scale9Grid, const GUINode_Clipping &clipping, const string &mask, float maskMaxValue)
 Constructor. More...
 
const string getNodeType () override=0
 
bool isContentNode () override
 
- Protected Member Functions inherited from GUINode
 GUINode (GUIScreenNode *screenNode, GUIParentNode *parentNode, const string &id, GUINode_Flow *flow, const GUINode_Alignments &alignments, const GUINode_RequestedConstraints &requestedConstraints, const GUIColor &backgroundColor, const string &backgroundImage, const GUINode_Scale9Grid &backgroundImageScale9Grid, const GUIColor &backgroundImageEffectColorMul, const GUIColor &backgroundImageEffectColorAdd, const GUINode_Border &border, const GUINode_Padding &padding, const GUINodeConditions &showOn, const GUINodeConditions &hideOn)
 Public constructor. More...
 
virtual ~GUINode ()
 Destructor. More...
 
virtual bool isContentNode ()=0
 
virtual void setLeft (int left)
 Set computed left. More...
 
virtual void setTop (int top)
 Set computed top. More...
 
virtual void layout ()
 Layout. More...
 
virtual void computeContentAlignment ()
 Do content alignment. More...
 
int layoutConstraintPixel (GUINode_RequestedConstraints_RequestedConstraintsType *type, int autoValue, int parentValue, int value)
 Layout constraint. More...
 
bool checkConditions ()
 Check if conditions are met. More...
 
void onSetConditions (const vector< string > &conditions)
 On set condition. More...
 
bool haveActiveOutEffect ()
 Determine if we have a out effect active. More...
 
bool shouldRender ()
 Determine if to render. More...
 
void _scrollToNodeX (GUIParentNode *toNode=nullptr)
 Scroll to node X. More...
 
void _scrollToNodeY (GUIParentNode *toNode=nullptr)
 Scroll to node Y. More...
 

Protected Attributes

int32_t textureId { 0 }
 
int textureWidth { 0 }
 
int textureHeight { 0 }
 
- Protected Attributes inherited from GUINode
GUIScreenNodescreenNode { nullptr }
 
GUIParentNodeparentNode { nullptr }
 
string id
 
GUINode_Alignments alignments
 
GUINode_RequestedConstraints requestedConstraints
 
GUINode_ComputedConstraints computedConstraints
 
GUIColor backgroundColor
 
TexturebackgroundTexture { nullptr }
 
int backgroundTextureId
 
GUINode_Scale9Grid backgroundImageScale9Grid
 
GUIColor backgroundImageEffectColorMul
 
GUIColor backgroundImageEffectColorAdd
 
GUINode_Padding padding
 
GUINode_Border border
 
GUINodeConditions showOn
 
GUINodeConditions hideOn
 
GUINodeControllercontroller { nullptr }
 
unordered_map< string, GUIEffect * > effects
 
int guiEffectOffsetX
 
int guiEffectOffsetY
 
bool conditionsMet
 
bool layouted
 
bool haveOutEffect
 
vector< string > lastConditions
 
GUIEffectStateeffectState { nullptr }
 

Private Attributes

RequestedDimensionConstraints requestedDimensionConstraints
 
bool mirrorX { false }
 
bool mirrorY { false }
 
GUIColor effectColorMul
 
GUIColor effectColorAdd
 
GUINode_Clipping clipping
 
TexturemaskTexture { nullptr }
 
float maskMaxValue
 
int32_t maskTextureId { 0 }
 
Matrix2D3x3 textureMatrix
 
Matrix2D3x3 mirrorTextureMatrix
 
GUINode_Scale9Grid scale9Grid
 
string mask
 

Friends

class tdme::gui::GUIParser
 

Additional Inherited Members

- Static Protected Member Functions inherited from GUINode
static GUINode_RequestedConstraints_RequestedConstraintsTypegetRequestedConstraintsType (const string &constraint, GUINode_RequestedConstraints_RequestedConstraintsType *defaultConstraintsType)
 Get requested constraints type. More...
 
static int getRequestedConstraintsValue (const string &constraint, int defaultConstraintsValue)
 Get requested constraints value. More...
 
static int getRequestedPixelValue (const string &value, int defaultValue)
 Get requested pixel value. More...
 

Detailed Description

GUI texture base node.

Author
Andreas Drewke
Version
$Id$

Definition at line 41 of file GUITextureBaseNode.h.

Constructor & Destructor Documentation

◆ GUITextureBaseNode()

GUITextureBaseNode ( GUIScreenNode screenNode,
GUIParentNode parentNode,
const string &  id,
GUINode_Flow flow,
const GUINode_Alignments alignments,
const GUINode_RequestedConstraints requestedConstraints,
const GUIColor backgroundColor,
const string &  backgroundImage,
const GUINode_Scale9Grid backgroundImageScale9Grid,
const GUIColor backgroundImageEffectColorMul,
const GUIColor backgroundImageEffectColorAdd,
const GUINode_Border border,
const GUINode_Padding padding,
const GUINodeConditions showOn,
const GUINodeConditions hideOn,
const RequestedDimensionConstraints requestedDimensionConstraints,
bool  mirrorX,
bool  mirrorY,
const GUIColor effectColorMul,
const GUIColor effectColorAdd,
const GUINode_Scale9Grid scale9Grid,
const GUINode_Clipping clipping,
const string &  mask,
float  maskMaxValue 
)
protected

Constructor.

Parameters
screenNodescreen node
parentNodeparent node
idid
flowflow
alignmentsalignments
requestedConstraintsrequested constraints
backgroundColorbackground color
backgroundImagebackground image
backgroundImageScale9Gridbackground image scale 9 grid
backgroundImageEffectColorMulbackground image effect color mul
backgroundImageEffectColorAddbackground image effect color add
borderborder
paddingpadding
showOnshow on
hideOnhide on
requestedDimensionConstraintsrequested dimension constraints
mirrorXmirror X
mirrorYmirror Y
effectColorMuleffect color mul
effectColorAddeffect color add
scale9Gridscale 9 grid
clippingclipping
maskmask image
maskMaxValuemaximum value of mask to display image
Exceptions
tdme::gui::GUIParserException

Definition at line 42 of file GUITextureBaseNode.cpp.

Member Function Documentation

◆ createClipping()

GUINode_Clipping createClipping ( const string &  allClipping,
const string &  left,
const string &  top,
const string &  right,
const string &  bottom 
)
static

Create clipping.

Parameters
allClippingall sides
leftleft
toptop
rightright
bottombottom

Definition at line 516 of file GUITextureBaseNode.cpp.

◆ createRequestedDimensionConstraints()

GUITextureBaseNode::RequestedDimensionConstraints createRequestedDimensionConstraints ( const string &  width,
const string &  height 
)
static

Create requested dimension constraints.

Parameters
widthwidth
heightheight
Returns
requested constraints

Definition at line 544 of file GUITextureBaseNode.cpp.

◆ dispose()

void dispose ( )
overridevirtual

Dispose node.

Reimplemented from GUINode.

Reimplemented in GUITextureNode.

Definition at line 108 of file GUITextureBaseNode.cpp.

◆ getClipping()

GUINode_Clipping & getClipping ( )
Returns
clipping

Definition at line 512 of file GUITextureBaseNode.cpp.

◆ getContentHeight()

int getContentHeight ( )
overridevirtual
Returns
content height including border, margin

Implements GUINode.

Definition at line 99 of file GUITextureBaseNode.cpp.

◆ getContentWidth()

int getContentWidth ( )
overridevirtual
Returns
content width including border, margin

Implements GUINode.

Definition at line 90 of file GUITextureBaseNode.cpp.

◆ getEffectColorAdd()

const GUIColor & getEffectColorAdd ( )
Returns
effect color add

Definition at line 504 of file GUITextureBaseNode.cpp.

◆ getEffectColorMul()

const GUIColor & getEffectColorMul ( )
Returns
effect color mul

Definition at line 496 of file GUITextureBaseNode.cpp.

◆ getMask()

const string & getMask ( )
Returns
mask source

Definition at line 530 of file GUITextureBaseNode.cpp.

◆ getMaskMaxValue()

float getMaskMaxValue ( )
inline
Returns
maximum value of mask to display image

Definition at line 197 of file GUITextureBaseNode.h.

◆ getNodeType()

const string getNodeType ( )
overrideprotectedpure virtual
Returns
node type

Implements GUINode.

Implemented in GUIFrameBufferNode, GUIImageNode, and GUITextureNode.

◆ isContentNode()

bool isContentNode ( )
overrideprotectedvirtual
Returns
is content node

Implements GUINode.

Definition at line 85 of file GUITextureBaseNode.cpp.

◆ render()

void render ( GUIRenderer guiRenderer)
overridevirtual

Render.

Parameters
guiRenderergui renderer
floatingNodesfloating nodes

Reimplemented from GUINode.

Definition at line 114 of file GUITextureBaseNode.cpp.

◆ setEffectColorAdd()

void setEffectColorAdd ( const GUIColor effectColorAdd)

Set effect color add.

Parameters
effectColorAddeffect color add

Definition at line 508 of file GUITextureBaseNode.cpp.

◆ setEffectColorMul()

void setEffectColorMul ( const GUIColor effectColorMul)

Set effect color mul.

Parameters
effectColorMuleffect color mul

Definition at line 500 of file GUITextureBaseNode.cpp.

◆ setMask()

void setMask ( const string &  mask)

Set mask source.

Parameters
maskmask source

Definition at line 534 of file GUITextureBaseNode.cpp.

◆ setMaskMaxValue()

void setMaskMaxValue ( float  maskMaxValue)
inline

Set maximum value of mask to display image.

Parameters
maskMinValuevalue of mask to display image

Definition at line 205 of file GUITextureBaseNode.h.

◆ setTextureMatrix()

void setTextureMatrix ( const Matrix2D3x3 textureMatrix)

Set texture matrix.

Parameters
textureMatrixtexture matrix

Definition at line 492 of file GUITextureBaseNode.cpp.

Friends And Related Function Documentation

◆ tdme::gui::GUIParser

friend class tdme::gui::GUIParser
friend

Definition at line 44 of file GUITextureBaseNode.h.

Member Data Documentation

◆ clipping

GUINode_Clipping clipping
private

Definition at line 57 of file GUITextureBaseNode.h.

◆ effectColorAdd

GUIColor effectColorAdd
private

Definition at line 56 of file GUITextureBaseNode.h.

◆ effectColorMul

GUIColor effectColorMul
private

Definition at line 55 of file GUITextureBaseNode.h.

◆ mask

string mask
private

Definition at line 65 of file GUITextureBaseNode.h.

◆ maskMaxValue

float maskMaxValue
private

Definition at line 59 of file GUITextureBaseNode.h.

◆ maskTexture

Texture* maskTexture { nullptr }
private

Definition at line 58 of file GUITextureBaseNode.h.

◆ maskTextureId

int32_t maskTextureId { 0 }
private

Definition at line 60 of file GUITextureBaseNode.h.

◆ mirrorTextureMatrix

Matrix2D3x3 mirrorTextureMatrix
private

Definition at line 63 of file GUITextureBaseNode.h.

◆ mirrorX

bool mirrorX { false }
private

Definition at line 53 of file GUITextureBaseNode.h.

◆ mirrorY

bool mirrorY { false }
private

Definition at line 54 of file GUITextureBaseNode.h.

◆ requestedDimensionConstraints

RequestedDimensionConstraints requestedDimensionConstraints
private

Definition at line 52 of file GUITextureBaseNode.h.

◆ scale9Grid

GUINode_Scale9Grid scale9Grid
private

Definition at line 64 of file GUITextureBaseNode.h.

◆ textureHeight

int textureHeight { 0 }
protected

Definition at line 70 of file GUITextureBaseNode.h.

◆ textureId

int32_t textureId { 0 }
protected

Definition at line 68 of file GUITextureBaseNode.h.

◆ textureMatrix

Matrix2D3x3 textureMatrix
private

Definition at line 62 of file GUITextureBaseNode.h.

◆ textureWidth

int textureWidth { 0 }
protected

Definition at line 69 of file GUITextureBaseNode.h.


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