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

Method loadTexturePressed

core/ui/UIButton.cpp:326–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

324}
325
326void Button::loadTexturePressed(std::string_view selected, TextureResType texType)
327{
328 _clickedFileName = selected;
329 _pressedTexType = texType;
330 bool textureLoaded = true;
331 if (selected.empty())
332 {
333 _buttonClickedRenderer->resetRender();
334 textureLoaded = false;
335 }
336 else
337 {
338 switch (texType)
339 {
340 case TextureResType::LOCAL:
341 _buttonClickedRenderer->initWithFile(selected);
342 break;
343 case TextureResType::PLIST:
344 _buttonClickedRenderer->initWithSpriteFrameName(selected);
345 break;
346 default:
347 break;
348 }
349 }
350 this->setupPressedTexture(textureLoaded);
351}
352
353void Button::setupPressedTexture(bool textureLoaded)
354{

Calls 6

setupPressedTextureMethod · 0.95
emptyMethod · 0.45
resetRenderMethod · 0.45
initWithFileMethod · 0.45
initWithSpriteFrameMethod · 0.45

Tested by 1

touchEventMethod · 0.36