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 / Backdrop ?

Author
Message
MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 26th Sep 2005 00:36
I place some sprites on the screen and, of course, now the background is blue. So I set the backdrop to on and a backdrop color as white.

I now want a line to be drawn on it as I move the mouse on the screen (both over the backdrop and over the sprites). The code I use for that is the following :



Instead of seeing a line being drawn following my mouse like when I had no sprites on the screen, I see a black box following my pointer (the box) when I'm on the background and nothing when I'm on a sprite.

What's the technique to draw over a backdrop and over a sprite ??

Thanx for your help !

There are only 10 kinds of programmers - those who understand binary, and those who don't.
Me!
19
Years of Service
User Offline
Joined: 26th Jul 2005
Location:
Posted: 26th Sep 2005 11:03
turn the automatic background refresh off for all the sprites and paste, draw and print everything on every loop of the main section, it`s a pain but it works, in all other languages I have used sprites travel over the background bitmap without altering it, allowing you to draw on it one frame and then ignore any more drawing for all the other frames without the background disapearing, in DB sprites more or less want the screen to themselves, forcing you to either make the whole screen from sprites or redraw everything on every sync.



we know where area 51 is, but where are areas 1 to 50?, and what do they do there?.
MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 26th Sep 2005 11:56 Edited at: 26th Sep 2005 12:38
So, if I want to make a paint game and that the mouse is used as the drawing tool and I use a box object to be the brush...

...I have to redraw everything that was drawn previously at each sync in the loop ?? How can I do that ? It seems quite impossible to keep track of what was drawn ?!?

If I do the whole screen background with one big sprite, is there maybe a possibility to paint on it ?

Btw, I use DBPro if that helps.

There are only 10 kinds of programmers - those who understand binary, and those who don't.
MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 26th Sep 2005 14:42
I rephrased my question in a more understandable way here : http://forum.thegamecreators.com/?m=forum_view&t=61534&b=1

Sorry for my bad english and rather confused ideas

There are only 10 kinds of programmers - those who understand binary, and those who don't.
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 26th Sep 2005 15:22
I've never tried writing a paint program in DB, so my comments are not from experience...

Basically, I would capture the screen 'drawing area' with Get Image as soon as the mouse button is pressed for drawing - in case it's required for a shape which can be adjusted. If just in drawing mode it can just be used for undo.

I would only have the mouse pointer 'identifier' as a sprite - everything else would be a pasted image. Set the sprite to automatically replace it's background as it moves.

The 'Stamp' effect should also be a pasted image - rather than a sprite.

When you position the image, put it in a loop where you paste the image you captured earlier, then the image at the mouse position, followed by a Sync:



By turning Sync On and setting Sync Rate 0, the use of the Sync will mean you don't see the screen redraws until after the stamp image is drawn and you can move it around, fixing it in place with the mouse button.

TDK_Man

MrBlack
20
Years of Service
User Offline
Joined: 17th Jun 2004
Location: Switzerland
Posted: 26th Sep 2005 17:02
Thanx very much ! That seems working !

There are only 10 kinds of programmers - those who understand binary, and those who don't.

Login to post a reply

Server time is: 2024-09-24 05:28:04
Your offset time is: 2024-09-24 05:28:04