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 / help with dbBox()

Author
Message
Lucky777
14
Years of Service
User Offline
Joined: 28th Nov 2009
Location:
Posted: 28th Jun 2010 23:03
Hey there forum!

I had a question for you people about the command "dbBox()"

I was trying to make a pong game without making any Sprites and only using this command, but each time you call this function, a new box is created and the old ones stay, so in the end, there's no more paddle, only a big white line.

So, do I have to use dbCLS() each time I want to move the paddle or do I have to do something else.

Thx for your help!

P.S. I don't have the code anymore, but it wouldn't change anything!
Hassan
15
Years of Service
User Offline
Joined: 4th May 2009
Location: <script> alert(1); </script>
Posted: 28th Jun 2010 23:29 Edited at: 28th Jun 2010 23:30
i think having a dbCLS in the loop after dbSync would help

anyhow, if you dont want to use dbCLS, you can use dbMakeObjectCube ( ... ) (that's it's name? whatever) then dbHideObject ( ) to hide it, then SetBackdropColor ( ) to set the color of the background, then, continue working normally without any need for dbCLS command, because having a 3d object in the scene (even though it wont be visible) will make GDK clear the screen every time before rendering, instead of explicit clearing on dbCLS so something like this should work


_Pauli_
AGK Developer
14
Years of Service
User Offline
Joined: 13th Aug 2009
Location: Germany
Posted: 29th Jun 2010 00:44
Well, or you could just use this command:

dbBackdropOn();

This turns the backdrop on, that is automatically refreshed each loop. But keep in mind that the default backdrop color is blue, so you may want to use dbColorBackdrop() as Hassan already said.

Now the plot thickens, the fps decreases, and the awesomeness goes through the roof.
Lucky777
14
Years of Service
User Offline
Joined: 28th Nov 2009
Location:
Posted: 29th Jun 2010 06:24
Well thx Hassan and _Pauli_

but, If I use an image as background, I don't need dbColorbackdrop ?
and I guess I put dbBackDropOn() outside the loop?

Login to post a reply

Server time is: 2024-07-04 11:23:35
Your offset time is: 2024-07-04 11:23:35