Sprite.tint does not allow alpha

The documentation here is inaccurate: https://studio.code.org/docs/gamelab/tint/


What should be happening is that when sprite.tint is set to something like rgb(255, 255, 255, 0.5) or "rgba(255, 255, 255, 0.5)", the sprite should appear like a ghost. However this does not happen and the result is a normal, opaque cow.
image
Furthermore, it appears that in order for the tint to work, the color must be in string format. Meaning that doing rgb(0, 0, 0) will not work. I’m requesting that sprite.tint be fixed, allowing both rgb() and alpha to work.

Along with the tint problem, I would also like to suggest some features that will benefit game lab.

  • sprite.animation or sprite._animation which holds the “animation” passed when sprite.setAnimation was called
  • A way to get the length of a song and change its position & playback speed.
    • Will also include Pausing & Preloading
  • functions like sprite.onMouseOver should work regardless of frame rate
1 Like

Agreed. It’s been awhile since your post and this has still not been fixed. The inability to control the opacity of a sprite is a pretty significant shortcoming. Hoping they get this fixed soon!

Hi @dhartman ,

For bug reports and feature requests, email support@code.org for a more direct route.

This forum is intended for community discussions, so reporting it here means you’re relying on a moderator to forward the request to support@code.org - I’ve gone ahead and done that.

Hi Everyone!

Oh boy - what a wild ride it’s been trying to track down this bug, then fix it. We’ve been working on this for a while trying to get our ghost cow to be transparent again.

But! I’m happy to report that we now have a way for students to turn their sprites transparent! Game Lab now has a new block called alpha which you can use to set sprites transparent. You can read more about its documentation here: https://studio.code.org/docs/gamelab/alpha/

We’ve also updated the tint documentation to remove references to transparency, and we updated the example to use the alpha block for the ghost cow.

Happy Coding,
Dan
Curriculum Writer

2 Likes

I know this is necroposting but setting alpha() to a decimall value lags when you draw it