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 / print"" no working!

Author
Message
jed_isbar
19
Years of Service
User Offline
Joined: 26th Sep 2005
Location: Secret base on the moon or Australia.
Posted: 27th Sep 2005 03:06
just starting out with models and wanted to put a print(angle) set in my loop but it slides of the screen!

code:
sync on
sync rate 60

load image "spot.bmp",1

make object cube 1,5
texture object 1,1

do
aY# = object angle Y(1)
aX# = object angle X(1)
aZ# = object angle Z(1)

aY# = Wrapvlue(aY#-5)
aX# = Wrapvlue(aX#-5)
aZ# = Wrapvlue(aZ#-5)

Yrotate object 1,aY#
Xrotate object 1,aX#
Zrotate object 1,aZ#

sync
loop

end code

please help

17 and in pro dev!
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 27th Sep 2005 05:44
If you use "text x,y,string$" instead of "print" you can get the text to print in the same location everytime. "Text" is a command that combines both "set cursor" and "print" in one.



Also "Wrapvlue" should be "Wrapvalue".
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 27th Sep 2005 10:02
alternativly you could do it like this:



and if you want the float printed in integer value, just use the INT() command

dab
20
Years of Service
User Offline
Joined: 22nd Sep 2004
Location: Your Temp Folder!
Posted: 27th Sep 2005 17:35
grogs, code will work. As for Lukas, I think that the print will just write on top of each other until you have a white (or what ever text color you have) box. Its a good habbit to use the text commands anyway.

------------------------
Visit my website of games
http://www.dabip.co.nr!
Lukas W
21
Years of Service
User Offline
Joined: 5th Sep 2003
Location: Sweden
Posted: 27th Sep 2005 18:36
Quote: "I think that the print will just write on top of each other until you have a white (or what ever text color you have) box."

but you thought wrong, you see by using the set cursor command you decide where on the screen the text should be printed.

as for the Text command, it is faster to write but you have to do that str$() thingy.. you wont need that with the Print command.

TDK
Retired Moderator
22
Years of Service
User Offline
Joined: 19th Nov 2002
Location: UK
Posted: 27th Sep 2005 19:40
Actually Lukas, you don't need the second two Set Cursor commands using that method - all you need is the first one. (Print includes the LF/CR to drop down to the start of the next line).

set cursor 0,0
print "AX# = ",aX#
print "AY# = ",aY#
print "AZ# = ",aZ#

But, as mentioned already, it's better to use the Text command as you have the ability to use font faces and sizes which you don't with Print.

TDK_Man

Login to post a reply

Server time is: 2025-05-22 13:06:58
Your offset time is: 2025-05-22 13:06:58