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 Discussion / Draw on top of a object

Author
Message
Dimension
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Jan 2008 13:38
I'm trying to make a 3D editing program with a menu but when I try to paste an image on top of everything else it flickers. Does anybody know what is causing the problem?

example:
make object cube 1, 50
do
paste image 1, 0, 0
sync
loop

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 18th Jan 2008 19:01 Edited at: 18th Jan 2008 19:02
Sync is short for 'Syncronize' and what it does is update the 3D world and draw it to the screen.

3D and 2D screens are different entities and 3D has preference. So, if you put any text or 2D images onto a screen which already has 3D on it, at the very next Sync they will be overwritten by the 3D screen.

Try simply moving the 2D screen operations to directly after the Sync:



TDK_Man

TheComet
17
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 18th Jan 2008 19:13
If I run the code in the first post, it flickers. If I do this:



it doesn`t flicker...

Why?

TheComet

Oooooops!!! I accidentally formated drive c.
Dimension
21
Years of Service
User Offline
Joined: 23rd Nov 2003
Location:
Posted: 18th Jan 2008 22:21
I forgot to turn sync on, silly me.

Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 22nd Jan 2008 04:10 Edited at: 22nd Jan 2008 04:10
What TDK said was right
the reason your example doesn't flicker is because there's nothing else in the loop; your 2D command is right after your sync so you don't notice any flickering.
It's just a coincidence that you hadn't turned sync on

Login to post a reply

Server time is: 2025-06-02 10:00:35
Your offset time is: 2025-06-02 10:00:35