• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

GameMaker Help draw event transparency (erasing a color)

T

Thiago_Mn

Guest
Hello guys!

Welp, i've been stuck how to erase or detect any color on a sprite, like gray or black.
and i was trying to erase alot of sprites with differents colors in background, and i didn't found any solution to erase the background color of sprites (i'm trying to make the background transparency btw) i'm new on GameMaker Studio 2 (Started using 15 days ago), so i don't know much things yet, but here's what i'm trying to do:
https://media.discordapp.net/attach...035785784066048/ssao.png?width=957&height=324

i'm trying to remove the black color (and other any color too) with any code, but i don't know how, i've tried many ways and i still didn't get the solution...

I appreciate any help of yours! :)
(Btw, sorry for my bad English, i'm Brazillian)
 

pipebkOT

Member
@Thiago_Mn

open the sprite in the sprite editor, and use the "colour remove tool" in the toolbox and click on the black background,



colour remover tool


if you are importing sprite sheets you need to split them into frames



image >> import strip image or (CTRL+I)

you can't use whole sprites sheets without spliting them into frames first
 
Last edited:
T

Thiago_Mn

Guest
Thanks! it was working fine

but i just found another problem:
https://media.discordapp.net/attach...03240379453669423/bs.png?width=973&height=268
i tried to remove the black background of the effects and was still showing.
What i tried to say up there, is how to delete like, colors over black and grey to white,
that should be worked
https://media.discordapp.net/attach...1517708083202/unknown.png?width=93&height=200
like if any these colors be showed on the sprite, will be automatically deleted.
i was wondering if it works with any Draw Event or something, any ideas?

(Btw, sorry for my bad English and my bad example.)
 

pipebkOT

Member
@Thiago_Mn
then start all over again.

open the original sprite in photoshop, and remove the background using the magic background remover. and then import the sprite to game maker studio 2.

make sure to save it in photoshop as a .PNG file, it's the only format that supports transparent backgrounds.


if you import formats that are not PNG the transparent backgrounds will show as black.


.jpg and other formats doesn't support transparent backgrounds
 
Last edited:
A

Annoyed Grunt

Guest
NEVER use .jpg\.jpeg to save your assets! Unlike .png, which is a lossless compression format, .jpeg is a lossy compression format. Put simply, this means .png will try to rearrange its data so it occupies less space, while .jpg will throw away part of the data that it deems unnecessary, depending on the compression level. In addition to not supporting transparency, the compression will also make your sprites blurry and artifacted. To use a metaphor, using .png is like carefully arranging your luggage into your car so it all fits while using .jpg is like throwing one of the suitcases away because you don't really need the spare clothing inside of it.
 
Top