Skip to content

Setting opacity on an ui::Button doesn't work anymore ? #17116

@danut007ro

Description

@danut007ro
  • cocos2d-x version: 3.14
  • devices test on: linux, android
  • developing environments
    • NDK version: r10e
    • Xcode version:
    • VS version:
    • browser type and version:

A new project on 3.13.1 is ok, but a new project on 3.14 doesn't set opacity. The code I used in HelloWorldScene.cpp on both projects is this :

SpriteFrameCache::getInstance()->addSpriteFramesWithFile("buttons.plist"); auto button = ui::Button::create(); button->loadTextureNormal("buttons/play-big", ui::Widget::TextureResType::PLIST); button->setPosition(Vec2(visibleSize.width/2 + origin.x, visibleSize.height/2 + origin.y)); button->setOpacity(100); addChild(button); 

Steps to Reproduce:

  1. Create a new project
  2. Add a spritesheet
  3. Create button and set opacity

Screenshot for 3.13.1:
mygame3131

Screenshot for 3.14:
mygame314

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions