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 DBPro Corner / Any Nice Tutorials on Sprites?

Author
Message
Cairnzy
14
Years of Service
User Offline
Joined: 5th Apr 2010
Location:
Posted: 13th Apr 2010 22:05
Hey all, wondering if there was any nice Tutorials on Sprites that cover, how to get transparency color to work, and basics of using sprites basicially.

Thankyou
SJMC

max ballwinkle
17
Years of Service
User Offline
Joined: 27th Nov 2006
Location: in a pineapple under the sea
Posted: 13th Apr 2010 22:24
Yeah, if anyone has any it would be good.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 14th Apr 2010 00:34
"set image colorkey" command is doing just that you are asking.The question is if your sprite transparent color is the same, because computer will search for exactly same color you want to be ignored.

For some advanced effects like semi-transparend edge of something in the sprite you`ll need some image editor to exclude background, blur and save the image as png or tga(i`m not sure for tga, everytime i`m using png)

This effect and actually png sprites with excluded or masked background can be used just "as is" with no aditional commands.Just paste them on screen.

I`ll atach image for you to see what i mean.

Where there is a will, there is a way.
I often edit my posts, that`s who i am

Attachments

Login to view attachments
Cairnzy
14
Years of Service
User Offline
Joined: 5th Apr 2010
Location:
Posted: 14th Apr 2010 00:38
I know how to set image colorkey but it doesnt work Its set to purple 255,0,255 the image is a png but when i make a function to make the sprite and stick it in the loop, it doesnt take away the purple.

Rich Dersheimer
AGK Developer
15
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 15th Apr 2010 19:00 Edited at: 15th Apr 2010 19:56
Post your code, and include the image as an upload, so we can see what you are trying.

Here is some code that demonstrates a sprite that has one color set to transparent.



Note that .png files already include transparency, so if you use one of those, you won't need to do the SET IMAGE COLORKEY. This is preferable, since SET IMAGE COLORKEY affects ALL subsequent images.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 16th Apr 2010 11:37
You say you use png, grab an image editor select the background as it`s all purple now and remove it.It should look like the image above.

Where there is a will, there is a way.
I often edit my posts, that`s who i am

Attachments

Login to view attachments

Login to post a reply

Server time is: 2024-09-28 16:32:13
Your offset time is: 2024-09-28 16:32:13