setOpacity is not working on the Node #1487
Replies: 11 comments
-
Your code is missing a call to
What demo project? If you meant |
Beta Was this translation helpful? Give feedback.
-
This will work for newly created node but it will not work for a full project. I checked on cocos-2dx (previous) and their Cascading is off and opacity is working there without adding any additional code. I can't use setCascadeOpacityEnabled on my project bcoz I updated my project and previously it was working Fine and now why I need to do setCascadeOpacityEnabled? Yes cpp-tests. I added my own node to check bcoz All the tests are using setOpacity on Sprite or other component but not using directly on the node. |
Beta Was this translation helpful? Give feedback.
-
Is there any way to not adding any additional line like For more Info: |
Beta Was this translation helpful? Give feedback.
-
Any modification to the cpp-tests project should always be mentioned, since stating that the test project didn't work without any context confuses things. Regardless of that, just because something works a certain way in Cocos2d-x doesn't mean that it was working correctly. You can check what has changed between Cocos2d-x v4 to Axmol to figure out why it, apparently, has different behavior. |
Beta Was this translation helpful? Give feedback.
-
I got the point, I am going through all the places to find out the solution or reason of "Why we need to enable the cascading to use opacity on node?" |
Beta Was this translation helpful? Give feedback.
-
I compared the both codes, code is similar, I'm confused when I use opacity on editor and then run my code with the updated .csb file, it also not shown opacity on the phone but when I call node->getDisplayedOpacity() it returns 0. |
Beta Was this translation helpful? Give feedback.
-
What editor are you referring to? If it's Cocos Studio, then that editor hasn't been supported for many years by the Cocos team, and the code related to it is, technically, deprecated. I'm actually surprised the code to support it is still included in Axmol, but you'll have to go through that code and check if something has changed, or if there is some bug in there that is affecting your project. |
Beta Was this translation helpful? Give feedback.
-
Yes It's Cocos Studio. So, As far as I understand, to use the opacity on node, we have to use |
Beta Was this translation helpful? Give feedback.
-
The opacity of a specific node is set by |
Beta Was this translation helpful? Give feedback.
-
Refer to the discussion thread, this post, for a work-around. Please close this issue, since it's not a bug in Axmol. |
Beta Was this translation helpful? Give feedback.
-
converted to discuss |
Beta Was this translation helpful? Give feedback.
-
Steps to Reproduce:
NOTE:
Opacity is working on the sprite. Issue is with the Node.
It is also not working on the Axmol demo project
Test Code:
Beta Was this translation helpful? Give feedback.
All reactions