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 / Help on best way to do this....

Author
Message
Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 24th Apr 2003 10:20
Hi

I would like to hear your opinion about this.

What I want to do:

I have some 3D action takeing place in the background. On top of this I want to have a sort of panel/console where the actual statistics of the game are displayed as text.

What I tried to do:

a) I used a sprite as the console. Unfortunately then I can't use Print/Text anymore, because said text will be drawn behind sprite. Is there any way to change this?

b) I tried to use get/paste image, however, then the black color in the console is displayed as black instead of transparent as in a sprite. And I also get a nasty flickering in the pasted image at each sync. However, text is displayed properly.

Any ideas on how to do this correctly?

Thanks for your help
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Apr 2003 10:28
Use (b), and put an extra ',1' at the end of your PASTE IMAGE command. It will then be pasted with transparency.

To reduce/remove the flickering, you could try slowing your refresh rate down a bit - try to match your monitor refresh rate as closely as possible.
Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 24th Apr 2003 10:31
Thanks a lot. I'll try that right away!

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 24th Apr 2003 10:39
Flickering won't go away. BTW. only the pasted image flickers... not the rest.
Added code this time

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 24th Apr 2003 10:54
removed extra sync at the end of the code. now it works...

TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 24th Apr 2003 13:30 Edited at: 24th Apr 2003 15:05
I spotted an error... In the beginning of your code you use:
Sync Off
Then later in your code you use Sync...???
Sync is off as standard so that doesn't need to be there. But then the 3D performance will be low....

In the VERY first line of you code put:
SYNC ON
SYNC RATE <Integer>
This will enable manual syncronisation and set the max framerate to <Integer>. You should adjust this to the speed of you code, if you understand.

Then ONCE in the END of every loop put:
SYNC or FASTSYNC
This will refresh the screen and make the code run (in most cases) very fast. I think this will correct your problems

Gilfalas
23
Years of Service
User Offline
Joined: 26th Jan 2003
Location: Luxembourg
Posted: 24th Apr 2003 15:17
You sir are a genius ...hehe... and I am a stupid little "*+"#

I don't know why, but I completely missed this error. I don't know why I wrote Sync Off in the first place anyway. I usually use Sync On with manual Sync. I am getting too old for this ....

TheCyborg
23
Years of Service
User Offline
Joined: 6th Oct 2002
Location: Denmark
Posted: 24th Apr 2003 15:24
heh... no problem...

Login to post a reply

Server time is: 2026-07-11 09:30:19
Your offset time is: 2026-07-11 09:30:19