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.

DarkBASIC Professional Discussion / Placing Sprites with transparent background layer is changing backround color?!??

Author
Message
Zaxtor99
14
Years of Service
User Offline
Joined: 27th Jul 2011
Location: Boise, Idaho, USA
Posted: 9th Aug 2011 11:03 Edited at: 9th Aug 2011 11:07
Okay, this is bugging me. I have used a transparent background layer in creating some sprites. When I look at the sprites I load in my program with the load image commands.. I mean when I look at them in their media folder, they are colored with no background color at all, so that looks correct.

But I have a black screen, and when I place the sprites with the sprite command, the background changes from black to blue, even though the color of the last sprite image is red with the transparent background.

I have tried to make sure the load image command does indeed load the images correctly by placing a 1 after such as load image "paddle.png",2,1

It is definitely in either the load image command or the sprite commands though as when I take out my sprite commands, the screen stays black.

I am using GIMP to create my sprites, and adding a transparent layer before I draw them, then save them as a PNG file type with the transparent layer.. and like I say, when I just look at the image previews from Windows directly, all I see id the colored sprites, and I cannot see any background at all.. so it LOOKS correct.

Any suggestions?


- Zaxx
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 9th Aug 2011 12:43
I think we need to see some code.

The following work fine for me:



or alternatively:



Image attached.
Zaxtor99
14
Years of Service
User Offline
Joined: 27th Jul 2011
Location: Boise, Idaho, USA
Posted: 9th Aug 2011 14:21
Thanks green, I may very well post my code... but I was browsing this forum and it seems the blue screen issue isn't only affecting me when it comes to the SPRITE command. Here is another thread with the same issue so it seems from a rather experienced DB programmer from the looks of it...

http://forum.thegamecreators.com/?m=forum_view&t=187125&b=1

I am VERY new to DarkBasic and some of this stuff is definitely challenging just to resolve what seems like should be very easy tasks.

As in the link thread above, I am also getting a background screen turning blue over my drawn lines (over an already set black screen with the ink command) -- when I use the sprite command. I don't have any of the PASTE SPRITE commands or SET SPRITE commands used at this moment... I am away from my home computer, but might try that when I get home as suggested by others in the above linked thread. And yes I only am using the SYNC command ONCE. Like I say if I remove the sprite commands, the screen stays black as it should.

I appreciate the help.


- Zaxx
Zaxtor99
14
Years of Service
User Offline
Joined: 27th Jul 2011
Location: Boise, Idaho, USA
Posted: 9th Aug 2011 16:26
UPDATE:

Yes, it seems that I needed to use the SET SPRITE COMMAND. I find that very odd, because this is the third little program I've written now and the first time this issue has come up and required me to use the SET SPRITE command to keep my screen background color from changing to blue. What's funny is there actually is very little difference in the coding between the 3 programs I wrote, just seems odd that this time required new commands (SET SPRITE) to keep everything from getting messed up.

Oh well, another learning experience.


= Zaxx

Login to post a reply

Server time is: 2026-07-11 10:26:13
Your offset time is: 2026-07-11 10:26:13