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 / cant type/print on screen

Author
Message
minkus
22
Years of Service
User Offline
Joined: 18th Jan 2003
Location: My House
Posted: 19th Jan 2003 20:01
i am making a maze game, but there is no way to print text on the screen.
HELP!!!!!!!!!!!

Furiousuk
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 19th Jan 2003 21:16
Its probably best to use the 'Text' command to place text on to the screen. Make sure you are drawing to front, also try changing the text to opaque if you're having difficulty seeing it.

Oh, and remember that by calling the 'Text' command only once, it will be drawn to the screen and then immediately wiped with the next sync command in the main loop.

Play around with placing the Text command in the main loop and making sure you are drawing in a good font, a decent colour and a suitable font size. Try placing your 'text' call into an 'if' loop to get an idea of how it works:

If [Player Location]=[Exit] then Text 0,0,"Well Done"
Santi
22
Years of Service
User Offline
Joined: 9th Dec 2002
Location: Spain
Posted: 19th Jan 2003 23:22
and How can I turn on the "Drawing to front"?. I have the same problem:
1.)Some times the text doesn't appear
2.)Some times it is Flickering all the time (changin in to the System Font and the one that I have select

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 20th Jan 2003 04:25
draw to front and draw to back are the commands that permit 2d to be drawn either behind the 3d or infront of it if this is what u mean...

Santi
22
Years of Service
User Offline
Joined: 9th Dec 2002
Location: Spain
Posted: 22nd Jan 2003 17:48
Ok, thanks

freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 22nd Jan 2003 18:25
text is default drawn to front, so I think that's not the problem...

and anyway, the program uses only 3d...

Is it solved already?

I just tried to test the program but it doesn't seem to work, probalbly because I use DB and not DBpro

Furiousuk
22
Years of Service
User Offline
Joined: 10th Jan 2003
Location: United Kingdom
Posted: 22nd Jan 2003 22:54
I had a similar problem to the one you are experiencing where text flickered on the screen (changed size). The problem seemed to occur when i tried to update the screen every loop and change the size of text i was 'text'ing to the screen. When i changed the text sizes to the same size the flicker disappeared.

Your flickering problem may be connected with changing the font, or font size with every screen update (sync), although i'm not entirely sure why this happened to me either, i solved the problem mainly through trial and error.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 23rd Jan 2003 05:26
set cursor 100,100
ink RGB(0,0,0),RGB(0,0,0)
print "XDD"


u could replace this component with:

rem white text
ink RGB(255,255,255),1
text 100,100,"XDD"

there is an issue with 2 sizes of text changing but yes u can get around it if u can distance each command away from each other enough for the command cycles not to create the double text or force it with a wait (num) command can work but isnt advised for performance.

John H
Retired Moderator
22
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 23rd Jan 2003 13:43
Or you could do it the long and hard way like I always do it and make the text a sprite (hint hint: use get image and textwidth, and textheight)

RPGamer

Current - RPG: Eternal Destiny : Help Wanted!
http://www.halbrosproductions.netfirms.com
Dont ask those questions! Read the help files lazy!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 23rd Jan 2003 20:16
Ive made a cool text function that works with 3D and 2D

xxxpetratxxx
B. R. W
Santi
22
Years of Service
User Offline
Joined: 9th Dec 2002
Location: Spain
Posted: 23rd Jan 2003 22:44
Look at my code:

do
sync

if rotatarj < 360 then inc rotatarj else rotatarj = 0
rotate object 1,0,rotatarj,0

ink rgb(0,0,0),rgb(0,0,0)
set text font checklist string$(font)
set text size 18
text 607,254,checklist string$(font)

set text font "system"
set text size 10
text 647,577,"Map: "+file$+".map"
text 600,577,str$(ft)
text 10,577,aviso$
font$ = str$(font)
font$ = str$(checklist quantity())
text 612,295,"Selected font: "+fuente$
text 684,485,nomcateg$(categact,1)
......................
......................

I want to show the font that is selected by the user in that moment, but the text is flickering all the time. It must be what Furiousuk said: I am updating the screen every loop and changing the size and the font of text... but I need to rewrite the text every loop. Because if I don't do that the text wont's be show... What can I do?

minkus
22
Years of Service
User Offline
Joined: 18th Jan 2003
Location: My House
Posted: 28th Jan 2003 03:20
Hey, I just noticed when i was playing with the mouselook stuff, and the text doesn't appear when i have a texture on something-




Now this




The World has no meaning - but gaming does!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st Feb 2003 02:35
When you load a bitmap, text will be set to display on that bitmap only (all the 2D commands really) so u need to use 'SET CURRENT BITMAP 0' before you print stuff on the screen

xxxpetratxxx
B. R. W
minkus
22
Years of Service
User Offline
Joined: 18th Jan 2003
Location: My House
Posted: 1st Feb 2003 18:21
You rule-now it works!

The World has no meaning - but gaming does!
Benjamin
22
Years of Service
User Offline
Joined: 24th Nov 2002
Location: France
Posted: 1st Feb 2003 18:32
thanks

xxxpetratxxx
B. R. W

Login to post a reply

Server time is: 2025-08-08 11:44:12
Your offset time is: 2025-08-08 11:44:12