MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / Label

Method Label

Source/Node/Label.cpp:41–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41Label::Label(String fontName, uint32_t fontSize, bool sdf)
42 : _alphaRef(0)
43 , _spacing(0)
44 , _textWidth(Label::AutomaticWidth)
45 , _lineGap(0.0f)
46 , _fontScale(GetFontScale(fontSize, sdf))
47 , _alignment(TextAlign::Center)
48 , _outlineColor(0x0)
49 , _outlineWidth(0.0f)
50 , _smooth{sdf::sdf_gen2d::suggested_edge_x, sdf::sdf_gen2d::suggested_edge_y}
51 , _font(SharedFontCache.load(fontName, fontSize, sdf))
52 , _blendFunc(BlendFunc::Default)
53 , _effect(sdf ? SharedFontCache.getSDFEffect() : SharedFontCache.getDefaultEffect()) {
54 if (_font) {
55 _lineGap = _font->getInfo().lineGap * _fontScale;
56 _flags.setOff(Node::TraverseEnabled);
57 _flags.setOn(Label::TextBatched);
58 }
59}
60
61Label::Label(String fontStr)
62 : _alphaRef(0)

Callers 1

DoraX.tsFile · 0.45

Calls 7

GetFontScaleFunction · 0.85
getSDFEffectMethod · 0.80
setOffMethod · 0.80
setOnMethod · 0.80
loadMethod · 0.65
getDefaultEffectMethod · 0.45
getInfoMethod · 0.45

Tested by

no test coverage detected