MCPcopy Create free account
hub / github.com/axmolengine/axmol / updateColor

Method updateColor

core/2d/Label.cpp:156–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154 }
155
156 virtual void updateColor() override
157 {
158 if (_textureAtlas == nullptr)
159 {
160 return;
161 }
162
163 auto displayedOpacity = _displayedOpacity;
164 if (!_letterVisible)
165 {
166 displayedOpacity = 0.0f;
167 }
168 Color4B color4(_displayedColor.r, _displayedColor.g, _displayedColor.b, displayedOpacity);
169 // special opacity for premultiplied textures
170 if (_opacityModifyRGB)
171 {
172 color4.r *= displayedOpacity / 255.0f;
173 color4.g *= displayedOpacity / 255.0f;
174 color4.b *= displayedOpacity / 255.0f;
175 }
176 _quad.bl.colors = color4;
177 _quad.br.colors = color4;
178 _quad.tl.colors = color4;
179 _quad.tr.colors = color4;
180
181 _textureAtlas->updateQuad(_quad, _atlasIndex);
182 }
183
184 void setVisible(bool visible) override
185 {

Callers

nothing calls this directly

Calls 1

updateQuadMethod · 0.80

Tested by

no test coverage detected