This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2008-12-15 21:28:32

iwansuryo
Scratcher
Registered: 2008-05-16
Posts: 29

Is There A Way To Set The Transparency of Sprite?

Hello everybody,

I have programming background in Flash and Animation Studio. When I try to use Scratch, it was very great program in the simplicity matter. Many building blocks can be build to cover many subtle area in multimedia programming. But I am very sad when trying to implement masking function like many multimedia program have. The main lack of Scratch is the disability to set the transparency of Sprites! It makes the layering function very limited, or I can say almost useless. When we can set the transparency, we will get masking function in very easy way. Masking function is vital in multimedia programming.

I know that we can use a pen or make a layering Sprites function in limited way, such as in some tricks to make Health Bar or Sand Timer, but it is not general approach that can be done for masking function. I also know that not all image format support transparency layer, such as JPEG and BMP. But we can set image in PNG format which is very useful to do this. You can learn it in easiest way from Moho, which now has transformed into Anime Studio. Moho is amatir program, so I can hope that it can be implement easily within Scratch.

Thank you very much for your appreciation, especially from Scratch Developer Team.

Iwan Suryolaksono

Offline

 

#2 2008-12-15 21:44:18

jamie
Scratcher
Registered: 2007-03-28
Posts: 100+

Re: Is There A Way To Set The Transparency of Sprite?

Yes, go to the "Looks" tab and use the "Set GHOST effect to #" block.


Check out my flash game site at http://subgaming.net/

Offline

 

#3 2008-12-15 21:54:46

iwansuryo
Scratcher
Registered: 2008-05-16
Posts: 29

Re: Is There A Way To Set The Transparency of Sprite?

You still don't know what I mean. If we use Ghost Function, all of the image would become transparent even though not all of "square paper" of this Sprite full of drawing. With transparency layer, we can make "non square" for each Sprite. We can also make a hole in one sprite, so the other sprite which is lying in the bottom of that sprite could be shown.

I hope you understand. Forgive me for my limited ability in English writing.

Iwan Suryolaksono

Offline

 

#4 2008-12-15 22:56:06

Digimath
Scratcher
Registered: 2007-07-07
Posts: 100+

Re: Is There A Way To Set The Transparency of Sprite?

Could you do what you want by using the Scratch Paint editor to modify your sprites by drawing with (or filling in with) the transparency color?


I've updated my text adventure game.
Colossal Cave 150http://scratch.mit.edu/static/projects/Digimath/3003787_sm.png

Offline

 

#5 2008-12-16 15:39:44

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: Is There A Way To Set The Transparency of Sprite?

iwansuryo wrote:

You still don't know what I mean. If we use Ghost Function, all of the image would become transparent even though not all of "square paper" of this Sprite full of drawing. With transparency layer, we can make "non square" for each Sprite. We can also make a hole in one sprite, so the other sprite which is lying in the bottom of that sprite could be shown.

I hope you understand. Forgive me for my limited ability in English writing.

Iwan Suryolaksono

Sorry for not understanding, but what do you mean by "square paper" and "non-square"? Are you talking about the different pixels in the sprite (the tiny dots that make of a picture)


http://i.imgur.com/WBkM2QQ.png

Offline

 

#6 2008-12-16 16:07:06

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Is There A Way To Set The Transparency of Sprite?

I agree. Scratch is a bit strangein that way. You have no transparent colors, but you do have fully transparent.

When you draw a rectangle and draw a line through it with the eraser you can see through the line.

This is not enough to do real masking, but it is already possible. With some tricks you can achieve a lot with the very limited features scratch has...


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#7 2008-12-16 21:30:10

Digimath
Scratcher
Registered: 2007-07-07
Posts: 100+

Re: Is There A Way To Set The Transparency of Sprite?

This might just be a matter of semantics but I consider that the paint pallet in the Scratch paint editor includes the color "transparency".  You can select this "color", just like the other colors, and then draw with it, use it in the fill tool, and use it with the shape tools.

I understand that this is not quite as nice as having the ability to select any given color and make it become transparent but at least we have something to work with.


I've updated my text adventure game.
Colossal Cave 150http://scratch.mit.edu/static/projects/Digimath/3003787_sm.png

Offline

 

#8 2008-12-17 02:32:00

iwansuryo
Scratcher
Registered: 2008-05-16
Posts: 29

Re: Is There A Way To Set The Transparency of Sprite?

Oh, I am sorry. This is absolutely my fault. I ask this question when I try to export costume to a file and it always produce BMP file which has no transparency layer. But I have seen that costumes which have been produced internally automatically have transperency layer! And I can import PNG file from outside too, just like Moho or Anime Studio! So I can use masking technique completely in Scratch.

I have underestimate this program because the resolution of picture in presentation mode are very low. Whatever good image which I make with Photoshop always degrade into very rough quality image. So, I close this discussion with myself. Thank you everybody.

Iwan Suryolaksono

Offline

 

#9 2008-12-18 03:10:32

AFawcett
Scratcher
Registered: 2008-08-29
Posts: 27

Re: Is There A Way To Set The Transparency of Sprite?

iwansuryo wrote:

Hello everybody,

I have programming background in Flash and Animation Studio. When I try to use Scratch, it was very great program in the simplicity matter. Many building blocks can be build to cover many subtle area in multimedia programming. But I am very sad when trying to implement masking function like many multimedia program have. The main lack of Scratch is the disability to set the transparency of Sprites! It makes the layering function very limited, or I can say almost useless. When we can set the transparency, we will get masking function in very easy way. Masking function is vital in multimedia programming.

I know that we can use a pen or make a layering Sprites function in limited way, such as in some tricks to make Health Bar or Sand Timer, but it is not general approach that can be done for masking function. I also know that not all image format support transparency layer, such as JPEG and BMP. But we can set image in PNG format which is very useful to do this. You can learn it in easiest way from Moho, which now has transformed into Anime Studio. Moho is amatir program, so I can hope that it can be implement easily within Scratch.

Thank you very much for your appreciation, especially from Scratch Developer Team.

Iwan Suryolaksono

but you can use ghost effect it basically IS transparencey! (of course with a different name)  smile   smile   wink  hope that helped!


I am AFawcett. Please comment and love-it on all my projects
smile   smile   wink   wink   wink

Offline

 

#10 2008-12-18 03:15:50

AFawcett
Scratcher
Registered: 2008-08-29
Posts: 27

Re: Is There A Way To Set The Transparency of Sprite?

iwansuryo wrote:

You still don't know what I mean. If we use Ghost Function, all of the image would become transparent even though not all of "square paper" of this Sprite full of drawing. With transparency layer, we can make "non square" for each Sprite. We can also make a hole in one sprite, so the other sprite which is lying in the bottom of that sprite could be shown.

I hope you understand. Forgive me for my limited ability in English writing.

Iwan Suryolaksono

When you use the ghost effect you don't have to make it full transparent. you could set it to 25 and you can still see through it but the color is still there but lighter so you can see through it!  smile  smile  wink  hope this helps!


I am AFawcett. Please comment and love-it on all my projects
smile   smile   wink   wink   wink

Offline

 

#11 2008-12-21 18:47:36

Orange20
Scratcher
Registered: 2008-05-24
Posts: 87

Re: Is There A Way To Set The Transparency of Sprite?

The "ghost" effect block can be used to set transparency, although you will have to expirement to get the exact amount you want. Good luck!  big_smile


The sentence below is a lie.
The sentence above is the truth.

Offline

 

#12 2008-12-28 17:28:57

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Is There A Way To Set The Transparency of Sprite?

iwansuryo wrote:

You still don't know what I mean. If we use Ghost Function, all of the image would become transparent even though not all of "square paper" of this Sprite full of drawing. With transparency layer, we can make "non square" for each Sprite. We can also make a hole in one sprite, so the other sprite which is lying in the bottom of that sprite could be shown.

I hope you understand. Forgive me for my limited ability in English writing.

Iwan Suryolaksono

Hello, Iwan Suryolaksono.
I think that what you may be trying to say is that scratch doesn't include an alpha channel beyond "0" or "1". (entirely transparent or entirely opaque), meaning that you can't make, say, a part of a costume 50% visible while the rest is 100%.
The only way around this is to use two sprites. one for the 100%, one for the 50%. it can be a disadvantage, but it is still quite trivial.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

#13 2008-12-30 11:40:55

fuz50
Scratcher
Registered: 2008-09-19
Posts: 100+

Re: Is There A Way To Set The Transparency of Sprite?

You're right! I've been trying to do that! The ghost effect nearly makes it though, {blocks}<set[ ghost ]effect to( whatever)>{/blocks} It doesn't exactly work with mine. *scratching head*


http://img10.imageshack.us/img10/7404/cooltext529102298.jpg
http://siggen.toontown-click.de/sig1.pnghttp://siggen.toontown-click.de/sig2.png

Offline

 

#14 2008-12-30 12:09:40

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Is There A Way To Set The Transparency of Sprite?

You do have transparent paint in the Paint Editor...with that you can make holes in your sprites.  It is the color that looks like a checkerboard.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#15 2008-12-31 15:47:23

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Is There A Way To Set The Transparency of Sprite?

i agree, in flash's color selection you can select any colour and then edit its alpha (transparency) it would be nice if scratch could do the same, would save alot of effort.

Offline

 

#16 2009-05-21 18:38:18

Dudeson
Scratcher
Registered: 2009-05-07
Posts: 25

Re: Is There A Way To Set The Transparency of Sprite?

uhm? cant you just make a transparent png in photoshop for example? and then import it???

Offline

 

#17 2009-05-21 20:43:34

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: Is There A Way To Set The Transparency of Sprite?

Dudeson wrote:

uhm? cant you just make a transparent png in photoshop for example? and then import it???

Unfortunately, Scratch can't handle semitransparencies. It'll just convert it to some strange colour  smile

Offline

 

#18 2009-05-23 16:14:48

Dudeson
Scratcher
Registered: 2009-05-07
Posts: 25

Re: Is There A Way To Set The Transparency of Sprite?

coolstuff wrote:

Dudeson wrote:

uhm? cant you just make a transparent png in photoshop for example? and then import it???

Unfortunately, Scratch can't handle semitransparencies. It'll just convert it to some strange colour  smile

*...

Offline

 

#19 2009-06-09 09:58:49

xaby
Scratcher
Registered: 2008-02-13
Posts: 49

Re: Is There A Way To Set The Transparency of Sprite?

wich color I have to select if I want "earase" a dot?

I mean,

<pen down><set pen color to( TRANSPARENCY )>
I want clear something, but not all like the <clear> command does it
or a TRANSPARENCY <stamp>

is there a color " -1 " (minus one) or is there no / any way to clear only a little bit of a picture.
I mean while the program is running, not in the included Paint

eraser down and eraser up, or set color to eraser-color

Last edited by xaby (2009-06-09 09:59:53)

Offline

 

#20 2009-06-09 18:01:13

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Is There A Way To Set The Transparency of Sprite?

xaby wrote:

wich color I have to select if I want "earase" a dot?

I mean,

<pen down><set pen color to( TRANSPARENCY )>[/blocks]
I want clear something, but not all like the <clear>[/blocks] command does it
or a TRANSPARENCY <stamp>[/blocks]

is there a color " -1 " (minus one) or is there no / any way to clear only a little bit of a picture.
I mean while the program is running, not in the included Paint

eraser down and eraser up, or set color to eraser-color

It's a good idea (great actually), but so far there is no way to do that. You can make it look like an eraser by setting the pen color to the same as the background, but you need your background to be a single color only for it to work.

And for the future, could you post a new topic instead of bringing one back? Thanks.  smile


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

Board footer