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 / printing on screen with matrix

Author
Message
badprogrammer
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location:
Posted: 8th Aug 2003 14:20
I am trying to make a first-person shooter. I have the gun, it can fire, I can move and there is a matrix and a mouselook function.

I want to be able to print to the screen to show how much ammo you have. If I print in the loop it prints lots of times very quickly to the bottom of the screen. If I do the 'cls' command so that the text appears in the same place the whole screen goes black.

I have also tried it so that the ammo only prints when you fire the gun but that doesn't work well either.

What do I do?
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Aug 2003 14:36
perhaps your looking for the text command.

text x,y,msg$

or

text 100,100,"message"

badprogrammer
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location:
Posted: 8th Aug 2003 15:34
Thanks. It didn't work that way, but I hadn't thought of using a co-ordinate position. I used
and then

[img] [/img]

Mentor
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: United Kingdom
Posted: 8th Aug 2003 16:07
??? mystified, the mind boggles

Mentor.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 8th Aug 2003 16:18
hehe doo doo doo doo enter twighlight zone music

TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 9th Aug 2003 03:29
If you have to use Print, (which you shouldn't), use Set Cursor Position before you print so that it always prints at the same place.

However it doesn't look like that is your only problem...

TDK
CarlTaylor
21
Years of Service
User Offline
Joined: 13th Jan 2003
Location: United States
Posted: 9th Aug 2003 04:42 Edited at: 9th Aug 2003 04:46
the reason it makes the screen go black is because CLS is a 2-D command, and by default all 2-D commands are executed after the 3-d commands. (that means any 3-d stuff gets wiped by CLS before it is sent to the moniter) Draw to Back and Draw to Front toggle the drawing order.

unfortuneatly, if you have DB draw 2-D to the back, the matrix and your objects and everything 3-d covers up the 2-D. ive been looking for a solution to this and ill let you know if i find anything. what that dude up above my post said, though, sounds like it would work.

-carl


(p.s. i could be wrong about any of this though, i dont pretend to be a DBP expert or anything...)

P4 2gig, 256mb RAM, 64mb DDR NVIDIA GeForce4 Ti 4200 w/ TV Out
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 9th Aug 2003 06:33
Try printing to the screen and then using GET IMAGE and making the image a sprite.

RPGamer

Current Project: Eternal Destiny
Porting all files to my new computer
badprogrammer
21
Years of Service
User Offline
Joined: 7th Aug 2003
Location:
Posted: 10th Aug 2003 15:26
I used draw to front and the text appeared but for hardly any time at all. Then it disappeared because the matrix and the backdrop appear in front of it.
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 10th Aug 2003 15:47
add this to your main loop at the end near the sync command

text 10,10,"Hello World"

IF your using DBP then prior to your main loop just make sure you have used a command to make the ink any colour you want for the text.

ink rgb(255,255,255),1

this is white but you can modify the colour to anything you want.

Jonny_S
21
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 10th Aug 2003 16:06
if you wish to use 'print' you could always stick set cursor before the print command

set cursor 10,10
print "Hello"



Jonny

P.S I wouldnt do that if I where you though the text command is a better alternative.

The man with no sig
TDK
Retired Moderator
21
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 11th Aug 2003 09:39
SMS

Don't you ever read the previous posts?

TDK

Login to post a reply

Server time is: 2024-09-20 19:41:59
Your offset time is: 2024-09-20 19:41:59