PianoScoreJP Posted May 14, 2015 Share Posted May 14, 2015 What is difference of alpha and worldAlpha in DisplayObject?How should I use these properties ? This code workscotainer.alpha=0.1; This code does not workscontainer.worldAlpha=0.1; Quote Link to comment Share on other sites More sharing options...
xerver Posted May 14, 2015 Share Posted May 14, 2015 You should set "alpha", the "worldAlpha" is a read-only attribute that tells you the calculated alpha of this object based on its own alpha value and that of its parents which it will inherit when being rendered. Quote Link to comment Share on other sites More sharing options...
PianoScoreJP Posted May 14, 2015 Author Share Posted May 14, 2015 Thank you. ....container.alpha=0.9 ...loding or generate texture ..... var sprite = new Sprite(texture);sprite.alpha=0.9;container.addChild(sprite); renderer.render(container);..... In this case , sprite.worldAlpha shows 0.81(0.9 x 0.9) after renering.Is my understanding right? Quote Link to comment Share on other sites More sharing options...
xerver Posted May 15, 2015 Share Posted May 15, 2015 Yes, that is correct. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.