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

Method loadTexture

core/ui/UILoadingBar.cpp:130–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128}
129
130void LoadingBar::loadTexture(std::string_view texture, TextureResType texType)
131{
132 if (texture.empty())
133 {
134 return;
135 }
136 _textureFile = texture;
137 _renderBarTexType = texType;
138 switch (_renderBarTexType)
139 {
140 case TextureResType::LOCAL:
141 _barRenderer->setTexture(texture);
142 break;
143 case TextureResType::PLIST:
144 _barRenderer->setSpriteFrame(texture);
145 break;
146 default:
147 break;
148 }
149
150 // FIXME: https://github.com/cocos2d/cocos2d-x/issues/12249
151 if (!_ignoreSize && _customSize.equals(Vec2::ZERO))
152 {
153 _customSize = _barRenderer->getContentSize();
154 }
155 this->setupTexture();
156}
157
158void LoadingBar::loadTexture(SpriteFrame* spriteframe)
159{

Callers 1

createMethod · 0.45

Calls 7

setupTextureMethod · 0.95
emptyMethod · 0.45
setTextureMethod · 0.45
setSpriteFrameMethod · 0.45
equalsMethod · 0.45
getContentSizeMethod · 0.45
initWithSpriteFrameMethod · 0.45

Tested by

no test coverage detected