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

Method loadTextureNormal

core/ui/UIButton.cpp:267–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

265}
266
267void Button::loadTextureNormal(std::string_view normal, TextureResType texType)
268{
269 _normalFileName = normal;
270 _normalTexType = texType;
271 bool textureLoaded = true;
272 if (normal.empty())
273 {
274 _buttonNormalRenderer->resetRender();
275 textureLoaded = false;
276 }
277 else
278 {
279 switch (texType)
280 {
281 case TextureResType::LOCAL:
282 _buttonNormalRenderer->initWithFile(normal);
283 break;
284 case TextureResType::PLIST:
285 _buttonNormalRenderer->initWithSpriteFrameName(normal);
286 break;
287 default:
288 break;
289 }
290 }
291 // FIXME: https://github.com/cocos2d/cocos2d-x/issues/12249
292 if (!_ignoreSize && _customSize.equals(Vec2::ZERO))
293 {
294 _customSize = _buttonNormalRenderer->getContentSize();
295 }
296 this->setupNormalTexture(textureLoaded);
297}
298
299void Button::setupNormalTexture(bool textureLoaded)
300{

Callers 7

touchEventMethod · 0.45
initMethod · 0.45
setPropsFromBinaryMethod · 0.45

Calls 8

setupNormalTextureMethod · 0.95
emptyMethod · 0.45
resetRenderMethod · 0.45
initWithFileMethod · 0.45
equalsMethod · 0.45
getContentSizeMethod · 0.45
initWithSpriteFrameMethod · 0.45

Tested by 2

touchEventMethod · 0.36
initMethod · 0.36