Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...

Recommended Posts

Hello!

 

 

I know the difference between opactiy and autoAlpha:

 

But what is the difference between opacity and alpha?

 

Yes I realise that opacity is a css property:

 

But if you use alpha on a dom object what is the difference to using opacity?

 

I am sure this is a really dumb question, I must have missed something.

 

 

 

Thankful for reply, Snoop out,

.S

  • Like 1
Link to comment
Share on other sites

No question is a dumb question.

 

I do not know the answer. Would love to hear it.

 

;)

  • Like 2
Link to comment
Share on other sites

Not a dumb question - alpha is simply an alias for opacity. No difference whatsoever. It was added originally to help consistency with the Flash API (Flash always used "alpha"). There were a lot of GSAP users coming from the Flash world at the time :) 

Link to comment
Share on other sites

Me, for example!

Link to comment
Share on other sites

Not a dumb question - alpha is simply an alias for opacity. No difference whatsoever. It was added originally to help consistency with the Flash API (Flash always used "alpha"). There were a lot of GSAP users coming from the Flash world at the time :)

 

Me included among those folks as I have a well thumbed copy of 'HTML5 for Flash developers' . Great to know, one less gray hair today  B)

 

Thanks

 

.S

Link to comment
Share on other sites

If you use Animate CC to write GSAP code for its html5 canvas output be sure to use alpha as EaselJS objects do not have an opacity property. 

Link to comment
Share on other sites

As I know autoAlpha is the best, because it is turning off the DOM element with "visibility:hidden" when i'ts opacity is 0. Am I right?

Link to comment
Share on other sites

I'm not sure I'd say "best" in every case, but yes, autoAlpha has the added benefit of toggling visibility when it makes sense. There's a very slight performance hit during the tween due to the fact that it has to control that additional property but it's pretty negligible. From a rendering standpoint, it is definitely cheaper for the browser if visibility is set to hidden. 

Link to comment
Share on other sites

Also worth noting that some game platforms (Phaser.js for example) have alpha properties on their sprites, and not opacity.

Link to comment
Share on other sites

Anyone remember the window mode tricks we had to employ when things like drop down menus appeared behind SWFs?

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

I was about to post the same question as Snoop.  The RGBA acronym and CSS3 property of the same name

defines the acronym as Red, Green, Blue, and Alpha.  Where alpha channel is also called the opacity channel.

 

I kept seeing the term autoAlpha in the GreenSock ActionScript API Docs and I am glad I found this discussion.

Link to comment
Share on other sites

Hello KerryRuddock

 

autoAlpha is part of the GSAP CSSPlugin for GSAP JS:

 

http://greensock.com/docs/#/HTML5/GSAP/Plugins/CSSPlugin/

  • autoAlpha
    Identical to opacity except that when the value hits 0 the visibility property will be set to "hidden" in order to improve browser rendering performance and prevent clicks/interactivity on the target. When the value is anything other than 0, visibility will be set to "inherit". It is not set to "visible" in order to honor inheritance (imagine the parent element is hidden - setting the child to visible explicitly would cause it to appear when that's probably not what was intended). And for convenience, if the element's visibility is initially set to "hidden" and opacity is 1, it will assume opacity should also start at 0. This makes it simple to start things out on your page as invisible (set your css visibility:hidden) and then fade them in whenever you want.
Example of usage:
//fade out and set visibility:hidden and opacity to 0
TweenLite.to(element, 2, {autoAlpha:0});

//in 2 seconds, fade back in with visibility:visible and opacity to 1
TweenLite.to(element, 2, {autoAlpha:1, delay:2});

:)

  • Like 3
Link to comment
Share on other sites

Hmm, I have noticed some performance differences between the two Alpha seems to tween bitmaps more smoothly. Maybe it is my imagination :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×