question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Actor should not have its own opacity property

See original GitHub issue

Context

Actor should not have its own opacity property. Currently, it’s used to facilitate the Fade Action, and to override the opacity of the Actor’s color property (if it has one). This has the potential to cause confusion, over which property is actually used (see #837).

Proposal

Actor.opacity should be deprecated in favor of using the opacity of Actor.color.a or Actor.currentDrawing.opacity (if the IDrawable has an opacity property, such as if it is a Sprite)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
djcsdycommented, Apr 7, 2021

Just wasted a bunch of time on this. It could not possibly be more confusing. Everything about Actor.opacity is inconsistent and broken.

  • Constructing an Actor with a color causes the opacity of the Actor to be set the the alpha value of the color, but subsequently updating the alpha value of the color has no effect.
  • Setting the color of an existing Actor (with opacity > 0) to Color.Transparent causes the Actor to turn black and retain its previous opacity.
  • Drawables attached to an actor use the opacity set on the Actor but ignore the color.
  • Actor sets this.color.a = this.opacity in its update function (WHY?!) so classes that extend Actor and define their own draw function inherit the weird relationship between color and opacity. For example, Label. They could override update but then they lose the existing implementation of a bunch of other useful stuff.
  • Actor sets visibility = false in update when opacity === 0, so if you ever set the opacity of an Actor to zero then it disappears and doesn’t come back when you set the opacity back to a value > 0.
  • It’s just awful and I don’t much care for it at all.
0reactions
github-actions[bot]commented, Jun 7, 2021

This issue hasn’t had any recent activity lately and is being marked as stale automatically.

Read more comments on GitHub >

github_iconTop Results From Across the Web

mutter/clutter-actor.c at master · endlessm/mutter - GitHub
The example above will animate the #ClutterActor:opacity property. * of an actor between fully opaque and fully transparent, and back, over.
Read more >
ClutterActor: Clutter Reference Manual
The example above will animate the “opacity” property of an actor between fully opaque and fully transparent, and back, over a span of...
Read more >
Clutter.Actor - Classes
Actors can know from their allocation box whether they have moved with respect ... Action is owned by the actor and it should...
Read more >
opacity - CSS: Cascading Style Sheets - MDN Web Docs
opacity applies to the element as a whole, including its contents, even though the value is not inherited by child elements. Thus, the...
Read more >
opacity acting weird (css) - Stack Overflow
1 Answer 1 ... Opacity values are not inherited. Rather, they stack. So if you make .container have opacity 0.92, and don't change...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found