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

Method updateColor

core/2d/LabelAtlas.cpp:247–269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

245}
246
247void LabelAtlas::updateColor()
248{
249 if (_textureAtlas)
250 {
251 Color4B color4(_displayedColor.r, _displayedColor.g, _displayedColor.b, _displayedOpacity);
252 if (_isOpacityModifyRGB)
253 {
254 color4.r *= _displayedOpacity / 255.0f;
255 color4.g *= _displayedOpacity / 255.0f;
256 color4.b *= _displayedOpacity / 255.0f;
257 }
258 auto quads = _textureAtlas->getQuads();
259 ssize_t length = _string.length();
260 for (int index = 0; index < length; index++)
261 {
262 quads[index].bl.colors = color4;
263 quads[index].br.colors = color4;
264 quads[index].tl.colors = color4;
265 quads[index].tr.colors = color4;
266 _textureAtlas->updateQuad(quads[index], index);
267 }
268 }
269}
270
271// CCLabelAtlas - draw
272#if AX_LABELATLAS_DEBUG_DRAW

Callers

nothing calls this directly

Calls 3

getQuadsMethod · 0.80
updateQuadMethod · 0.80
lengthMethod · 0.45

Tested by

no test coverage detected