Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Black (or white ...)

Author
Message
Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 4th Oct 2011 16:56
Hello,

How can we hide the black color of a sprite ?

Thank !

I do what i do !!!
Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 4th Oct 2011 17:35
Make your sprite with a graphics program that can give an image an alpha channel, or transparency.

Doz
16
Years of Service
User Offline
Joined: 16th Apr 2008
Location:
Posted: 4th Oct 2011 20:48
In the long run using alpha channels is probably better, but you can also use a flag when loading the image to set black as transparency. I forget the exact method but its listed in the help for load image.

Captain Ouais
20
Years of Service
User Offline
Joined: 12th Dec 2003
Location: France
Posted: 4th Oct 2011 22:53
Ok, thank you !!



I do what i do !!!
Impetus73
13
Years of Service
User Offline
Joined: 28th Aug 2011
Location: Volda, Norway
Posted: 5th Oct 2011 23:01 Edited at: 5th Oct 2011 23:01
loadimage("troll.png",1)

The ,1 makes the black color transparent. Red=0:Green=0:Blue=0

To have som blackness in the sprite, use Red=1:Green=1:Blue=1 color pixels in the image.

Or use transparent sprites, abit harder if you ask me..


oh, you seem to have a dead pixel on your screen, look -> .

----------------
AGK user - novice
Did Amiga / AMOS programming in the 90's, just started programming again with AGK.
Steve Ancell
18
Years of Service
User Offline
Joined: 16th Feb 2006
Location: Brighton, East Sussex, UK
Posted: 6th Oct 2011 01:28
Just download Paint.NET then use the magic-wand tool to cut out the bits that you want to make transparent.

Login to post a reply

Server time is: 2024-11-22 03:07:40
Your offset time is: 2024-11-22 03:07:40