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.

Dark GDK / Drawing lines on a bmp sprite background

Author
Message
blood sample
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 26th Dec 2007 01:26
Hi,

I'm trying to find a way to draw a line for example on a sprite background.



When there is no background it works fine. I can draw a line on the empty screen. But when I add a background the line doesn't show through. I'm assuming it's because the bmp is displayed over the line.



Is there a way to draw on top of a sprite? Or maybe modify the bmp data itself? I don't really understand the dbLockPixels() and dbGetPixelsPointer function as the manual is a bit ambiguous in this regard. I imagine these have something to do with what I want.

Thanks in advance.
blood sample
16
Years of Service
User Offline
Joined: 21st Dec 2007
Location:
Posted: 26th Dec 2007 23:55
UPDATE:
I've sort of fixed the problem but now I have another one.

I was able to draw lines on the background when I did dbLoadBitmap instead of dbLoadImage. The bitmap was loaded and it was set as the bitmap to be edited.

This is all fine and well but now the problem is that I can't display sprites on top of this bitmap background. When I try to display a sprite it gets shown but everything else goes blue and the background bitmap I loaded is not shown anymore. What am I doing wrong here?

In this code, all I see is the ball sprite displayed with everything else around it blue (ie the steel.bmp is not displayed)



When I comment out the ball sprite code, then the steel.bmp is displayed properly.


All this code is before the game loop. I just don't understand why I can't display the sprite on top of the steel.bmp image instead it's as if I can either display one or the other.

Thanks

Login to post a reply

Server time is: 2024-10-08 15:57:47
Your offset time is: 2024-10-08 15:57:47