sprite alpha?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
Mr. Strange
Party member
Posts: 101
Joined: Mon Aug 11, 2008 5:19 am

sprite alpha?

Post by Mr. Strange »

Since the concept of an alpha channel is supported in the "color" functionality, I suspect that I can designate a color to act as an alpha mask for my sprites. Or maybe there is a color already designated as an alpha mask? In either case, I'm at a point where I'm applying complex sprites, and I need my alpha. Could someone point me to the syntax I need?

--Mr. Strange
User avatar
rude
Administrator
Posts: 1052
Joined: Mon Feb 04, 2008 3:58 pm
Location: Oslo, Norway

Re: sprite alpha?

Post by rude »

You can't choose a color as an alpha mask, no. (This question is almost FAQ-worthy by now). You can use the built in alpha channel in image files like .png or .tga. What looks transparent in your image editor will become transparent in LÖVE.

On a related note, you can also modulate the general color of an image with the current color. This is useful if you want change the the total alpha of the sprite, for instance to fade an image in/out. See love.graphics.setColorMode.
Mr. Strange
Party member
Posts: 101
Joined: Mon Aug 11, 2008 5:19 am

Re: sprite alpha?

Post by Mr. Strange »

Alright, I grabbed the beta for pixelformer, and saved my images as rgba. Works fine!

--Mr. Strange
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest