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 / [SOLVED] sprites with alpha transparency

Author
Message
kebang
10
Years of Service
User Offline
Joined: 24th Feb 2014
Location:
Posted: 23rd Jul 2021 07:53
How do I create alpha transparency for my sprite.?
I've tried using a white background and then a black background but the backgrounds always remain visible

The author of this post has marked a post as an answer.

Go to answer

PartTimeCoder
AGK Tool Maker
9
Years of Service
User Offline
Joined: 9th Mar 2015
Location: London UK
Posted: 23rd Jul 2021 12:05
Your sprite should have an alpha layer or a black background, if its black in LoadImage pass '1' as second parameter (Black Is alpha)
kebang
10
Years of Service
User Offline
Joined: 24th Feb 2014
Location:
Posted: 24th Jul 2021 02:35
loadimage (20,"hovercraft.png")loads the image
, how do I change this to include LoadImage pass '1' as second parameter?
loadimage (20,1,"hovercraft.png") just returns an error
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 24th Jul 2021 02:52 Edited at: 24th Jul 2021 03:03
This post has been marked by the post author as the answer.
see LoadImage() re: set black as transparent.

but, since you're using .png, doesn't it already have alpha in it?
if so, just load it. the transparency doesn't matter at this point (loading it) but when you use it as a sprite, for example.

also fixed the typo in the title (was "spites")
[My Itch.io Home] [Community Apps on Itch.io]
[AGK Resource Directory] [TGC @ GitHub]
[CODE lang=agk] YOUR CODE HERE [/CODE]
[VIDEO=youtube] VIDEO ID [/VIDEO]
[AGK Showcase][Google Forum Search]
kebang
10
Years of Service
User Offline
Joined: 24th Feb 2014
Location:
Posted: 24th Jul 2021 05:39
Thank you V. Nomad loadimage (20,"hovercraft.png",1) works fine!

Login to post a reply

Server time is: 2024-11-23 08:09:16
Your offset time is: 2024-11-23 08:09:16