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.

Newcomers AppGameKit Corner / SetImageTransparentColor problems

Author
Message
aldoro101
9
Years of Service
User Offline
Joined: 27th Apr 2014
Location:
Posted: 11th Feb 2016 05:58 Edited at: 11th Feb 2016 06:32
Okay, so I'm running into a problem.
I'm trying to make the pink around this sprite (a png file) transparent:
http://imgur.com/5FIo8n5
However, my code doesn't seem to work.
This is what happens when you run my code:
http://imgur.com/T6NFbX4

Here's my code:


I've removed the irrelevant bits for your viewing pleasure (or at least to the best of my ability, I'm kinda impatient).
I'm kinda stuck, so if anybody knows lemme know. Kinda wish there was a code example on this for reference.
This is a family-rated forum, your sig has been removed
blink0k
Moderator
10
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Feb 2016 06:25
i think pink is 255,0,255

Sign up for NaGaCreMo!
aldoro101
9
Years of Service
User Offline
Joined: 27th Apr 2014
Location:
Posted: 11th Feb 2016 06:32
Oops. I already tried that, but I tried the opposite results, too.
Lemme change that back. The problem still persists otherwise.
This is a family-rated forum, your sig has been removed
aldoro101
9
Years of Service
User Offline
Joined: 27th Apr 2014
Location:
Posted: 11th Feb 2016 08:07
Not to sound particularly desperate, but I'm bumping the thread.
I really need an answer here or I'm going to have to make severe sprite alterations.
This is a family-rated forum, your sig has been removed
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Feb 2016 08:47 Edited at: 11th Feb 2016 08:48
Are you sure the color is exactly 255,0,255?

Use the eyedropper tool in a graphics package to check it.

Personally, I always use transparent Png images. The results are much better.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
aldoro101
9
Years of Service
User Offline
Joined: 27th Apr 2014
Location:
Posted: 11th Feb 2016 18:49
The eye dropper does read 255, 0, 255. Why wouldn't it work? Am I supposed to set the sprite transparent or something?
This is a family-rated forum, your sig has been removed
blink0k
Moderator
10
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Feb 2016 19:21
You neet to add SetSpriteTransparency

Sign up for NaGaCreMo!
BatVink
Moderator
20
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 11th Feb 2016 19:43
I agree with BlinkOK, but if he is right it means the help files are misleading...

Quote: "By default sprites are created with alpha transparency"
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Quidquid latine dictum sit, altum sonatur
TutCity is being rebuilt
blink0k
Moderator
10
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 11th Feb 2016 21:56
the image didn't have magenta set as the transparent colour in the file. i loaded it into my image proggy and set magenta as the transparent colour and it worked fine without SetSpriteTransparency()

Sign up for NaGaCreMo!

Login to post a reply

Server time is: 2023-05-28 10:36:55
Your offset time is: 2023-05-28 10:36:55