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 / Problems with SetImageTransparentColor

Author
Message
Crazy Programmer
AGK Developer
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 25th Feb 2015 22:25
When I load an Image for example.
LoadImage (1,"player.jpg")

and set the Transparent Color to black.

LoadImage (1, "Player.jpg" )
SetImageTransparentColor ( 1,0,0,0 )

It is not setting the color to transparent. I have been looking at the RGB colors in Paint and know the color is set to the right RGB.

Am I missing something?
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 22:40
Looks right from the docs but I don't use it as I just do the transparent part when drawing and save as .PNG file as I find it easier and you don't have to add extra code as it loads in correct.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 25th Feb 2015 22:47
Is it anything to do with this also:

SetSpriteTransparency( iSpriteIndex, mode )


iSpriteIndex - The ID of the sprite to modify.

mode - The transparency mode for this sprite, 0=off, 1=alpha transparency, 2=additive blending

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles
Crazy Programmer
AGK Developer
19
Years of Service
User Offline
Joined: 6th Sep 2004
Location: Lost in AGK
Posted: 26th Feb 2015 00:34
Thanks Paul! SetSpriteTransparency (Player, 1) did the trick.

I still cant get SetImageTransparentColor (id,r,g,b) to work.

Does paints RGB colors not match AGKS? I think its a user error(Points at myself).
I can just spend the time redoing all my backgrounds of my sprites to black.
SpecTre
Developer
21
Years of Service
User Offline
Joined: 24th Feb 2003
Location: UK
Posted: 26th Feb 2015 00:42
I think AppGameKit auto uses RGB black as transparent.

Paint should be standard for rgb values but you could always try Gimp, its free and you never know. Worth a try you can also use Gimp to set transparent and save as .PNG so you don't have the messing, that's what I do. Easier lol.

Programming - AMOS on the AMIGA! / DBPro / Python / A bit of C C++ / now also AGK2! - Graphics - Deluxe Paint on the Amiga / Paintshop Pro / Photoshop / Lightroom / Grafx2
Previously worked for Prisma Software producing childrens educational software on the Amiga - Titles - Pepe's Garden - Paint Pot / Kids Academy range - Paint Pot II / Shopping Basket / Which Where What? / Blobs / Alvin's Puzzles

Login to post a reply

Server time is: 2024-04-25 13:41:56
Your offset time is: 2024-04-25 13:41:56