45 auto colorsArray = StringTools::tokenize(colors,
",");
46 for (
const auto& color: colorsArray) {
47 auto colorComponents = StringTools::tokenize(color,
"=");
48 if (colorComponents.size() != 2) {
49 Console::println(
"GUIGradientNode::createGradient():color invalid: " + color);
52 if (StringTools::endsWith(colorComponents[0],
"%") ==
false) {
53 Console::println(
"GUIGradientNode::createGradient():color start invalid: " + colorComponents[0]);
56 colorComponents[0] = StringTools::trim(colorComponents[0]);
57 colorComponents[0] = StringTools::substring(colorComponents[0], 0, colorComponents[0].size() - 1);
58 colorComponents[1] = StringTools::trim(colorComponents[1]);
59 auto start = Float::parse(colorComponents[0]) / 100.0f;
60 auto guiColor =
GUIColor(colorComponents[1]);
76 const string& backgroundImage,
78 const GUIColor& backgroundImageEffectColorMul,
79 const GUIColor& backgroundImageEffectColorAdd,
84 const string& tooltip,
91 GUINode(screenNode, parentNode, id, flow, alignments, requestedConstraints, backgroundColor, backgroundImage, backgroundImageScale9Grid, backgroundImageEffectColorMul, backgroundImageEffectColorAdd, border, padding, showOn, hideOn, tooltip)
152 auto renderAreaLeft = ((left) / (screenWidth / 2.0f)) - renderOffsetXCurrent - 1.0f;
153 auto renderAreaTop = ((screenHeight - top) / (screenHeight / 2.0f)) + renderOffsetYCurrent - 1.0f;
154 auto renderAreaRight = ((left + width) / (screenWidth / 2.0f)) - renderOffsetXCurrent - 1.0f;
155 auto renderAreaBottom = ((screenHeight - top - height) / (screenHeight / 2.0f)) + renderOffsetYCurrent - 1.0f;
179 ((left) / (screenWidth / 2.0f)) - 1.0f,
180 ((screenHeight - top) / (screenHeight / 2.0f)) - 1.0f,
181 1.0f, 1.0f, 1.0f, 1.0f,
184 ((left + width) / (screenWidth / 2.0f)) - 1.0f,
185 ((screenHeight - top) / (screenHeight / 2.0f)) - 1.0f,
186 1.0f, 1.0f, 1.0f, 1.0f,
189 ((left + width) / (screenWidth / 2.0f)) - 1.0f,
190 ((screenHeight - top - height) / (screenHeight / 2.0f)) - 1.0f,
191 1.0f, 1.0f, 1.0f, 1.0f,
194 ((left) / (screenWidth / 2.0f)) - 1.0f,
195 ((screenHeight - top - height) / (screenHeight / 2.0f)) - 1.0f,
196 1.0f, 1.0f, 1.0f, 1.0f,
256 Engine::getInstance()->getTextureManager()->removeTexture(
maskTexture->
getId());
const string & getId() const
static GUINode_Clipping createClipping(const string &allClipping, const string &left, const string &top, const string &right, const string &bottom)
Create clipping.
const string getNodeType() override
GUIGradientNode(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 string &tooltip, const GUIColor &effectColorMul, const GUIColor &effectColorAdd, const GUINode_Clipping &clipping, const string &mask, float maskMaxValue, const Gradient &gradient)
Constructor.
void setEffectColorMul(const GUIColor &effectColorMul)
Set effect color mul.
void dispose() override
Dispose node.
int getContentWidth() override
const GUIColor & getEffectColorMul()
int getContentHeight() override
GUINode_Clipping clipping
void setMask(const string &mask)
Set mask source.
const GUIColor & getEffectColorAdd()
void render(GUIRenderer *guiRenderer) override
Render.
bool isContentNode() override
void setEffectColorAdd(const GUIColor &effectColorAdd)
Set effect color add.
GUINode_Clipping & getClipping()
void setTextureMatrix(const Matrix3x3 &textureMatrix)
Set texture matrix.
GUI element node conditions.
GUI node requested constraints requested constraints type enum.
static STATIC_DLL_IMPEXT GUINode_RequestedConstraints_RequestedConstraintsType * AUTO
virtual void render(GUIRenderer *guiRenderer)
Render.
static int getRequestedPixelValue(const string &value, int defaultValue)
Get requested pixel value.
GUINode_ComputedConstraints computedConstraints
GUIScreenNode * screenNode
GUINode_RequestedConstraints requestedConstraints
bool shouldRender()
Returns if to render.
virtual void dispose()
Dispose node.
GUI parent node base class thats supporting child nodes.
GUI screen node that represents a screen that can be rendered via GUI system.
Texture * getImage(const string &fileName)
Get image.
void setSubRenderAreaBottom(float renderAreaBottom)
Set sub render area bottom.
void setGradient(int count, array< GUIColor, 10 > &colors, array< float, 10 > &colorStarts, float rotationAngle)
Set gradient properties.
void setMaskMaxValue(float maskMaxValue)
Set mask max value.
void setTexureMatrix(const Matrix3x3 &textureMatrix)
Set texture matrix.
void unsetGradient()
Disable gradient.
void bindTexture(int32_t textureId)
Bind texture.
void setSubRenderAreaRight(float renderAreaRight)
Set sub render area right.
void setSubRenderAreaLeft(float renderAreaLeft)
Set sub render area left.
void setEffectColorAdd(const GUIColor &color)
Set effect color add.
void setSubRenderAreaTop(float renderAreaTop)
Set sub render area top.
void setEffectColorMul(const GUIColor &color)
Set effect color mul.
void bindMask(int32_t textureId)
Bind mask texture.
void addQuad(float x1, float y1, float colorR1, float colorG1, float colorB1, float colorA1, float tu1, float tv1, float x2, float y2, float colorR2, float colorG2, float colorB2, float colorA2, float tu2, float tv2, float x3, float y3, float colorR3, float colorG3, float colorB3, float colorA3, float tu3, float tv3, float x4, float y4, float colorR4, float colorG4, float colorB4, float colorA4, float tu4, float tv4, bool solidColor=false, bool rotated=false)
Add quad Note: quad vertices order 1 2 +-—+ | | | | +-—+ 4 3.
Matrix3x3 class representing matrix3x3 mathematical structure and operations for 2d space.
Matrix3x3 & identity()
Creates identity matrix.
Matrix3x3 & set(float r0c0, float r0c1, float r0c2, float r1c0, float r1c1, float r1c2, float r2c0, float r2c1, float r2c2)
Sets this matrix by its components.
array< GUIColor, 10 > colors
array< float, 10 > colorStarts
GUI node clipping entity.
GUI node computed constraints.
GUI node requested constraints entity.
GUINode_RequestedConstraints_RequestedConstraintsType * widthType
GUINode_RequestedConstraints_RequestedConstraintsType * heightType
GUI node scale 9 grid entity.