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.

Author
Message
Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 25th Jun 2003 20:26
When I do stuff in 3D and I try to use the print command i see nothing. Why?
Trowbee
21
Years of Service
User Offline
Joined: 12th Apr 2003
Location: United Kingdom
Posted: 25th Jun 2003 21:43
works for me :-s
Give a code snippet
Kentaree
21
Years of Service
User Offline
Joined: 5th Oct 2002
Location: Clonmel, Ireland
Posted: 25th Jun 2003 22:20
When using 3D and sync, all 3D objects are drawn over the 2D objects. A solution would be to rewrite the text each loop, for examples, if you want the Screen FPS to show at the top hand corner, you'd put something like this:

text 0,0,"Screen FPS: "+ str$(Screen FPS())

in your loop, which would print this everytime the loop repeats. Also, try to use the "draw to front" command which draws 2D over 3D.

Cheers,
Kentaree

Whatever I did I didn't do it!
Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 26th Jun 2003 01:31
Thanks! x-d

Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 27th Jun 2003 05:16
But it still doesn't work!!!


John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 27th Jun 2003 06:07
Try using get image using text width and text height and make that image of the text a sprite. That works

RPGamer

Current Project: Eternal Destiny
Questions? Comments? Suggestions? Go to the Eternal Destiny Forum!
Angeleyes
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location:
Posted: 27th Jun 2003 07:47 Edited at: 27th Jun 2003 07:48
Try this Drifter and tell me if it works.

REM START
hide mouse
cls 0
sync on
make matrix 1, 2000, 2000, 45, 45
color backdrop 0
set text to bold
set text opaque
ink rgb(255,50,50),0
make object sphere 1, 300
position object 1,500,0,500
make object cone 2, 200
position object 2,500,0,500
point camera object position x(1), object position y(1), object position z(1)
ghost object on 1
color object 2,200
repeat
cx=160:cy=190
text cx,cy, "Hello, my name is Drifter. I’m new around here. Who are you."
cx=160:cy=300
text cx,cy, "Oh...Im the great and all powerfull Mary."
Rem Hey come on....I HAD to say that ^_~
sync
xrotate object 2,rot
inc rot
if rot>360 then rot=1
SCALE OBJECT 1,rot,rot,rot
until mouseclick()=1
repeat:until mouseclick()=0
REM END

Just copy and paste it into DarkBasic.
You should see the text over the two moving objects...Do you?

Ta ta for now
Mary

Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 27th Jun 2003 19:40
It works on it's own but when I put the text stuff w/o the object stuff it doesn't work. I put in;
cls 0
color backdrop 0
set text to bold
set text opaque
ink rgb(255,50,50),0
and in the main loop,
cx=160:cy=190
text cx,cy, "Hello, my name is Drifter. I’m new around here. Who are you."

Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 27th Jun 2003 19:41
Dear Moderator, I don't get it, sorry...

Angeleyes
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location:
Posted: 27th Jun 2003 22:02
Drifter you HAVE to use the SYNC command or you will not see anything! LOL. ^_^

The main bit is this....

cx=160:cy=190
text cx,cy, "Hello, my name is Drifter. I’m new around here. Who are you."
cx=160:cy=300
text cx,cy, "Oh...Im the great and all powerfull Mary."
sync

You can put it in a Do-Loop a For-next loop or any other loop you want to, just as long as there is the SYNC command in it.

Go and try it again.

Ta ta for now
Mary

ToXic
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: Australia
Posted: 28th Jun 2003 00:59 Edited at: 28th Jun 2003 01:07
simple example.

sync on
sync rate 0

make object sphere 1, 100
position object 1, 0, 0, 200


do
text 10,10,"FPS : "+str$(screen fps())
inc ang
rotate object 1,0,wrapvalue(Ang),0
sync
loop


ToXic.
Nilrem
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 28th Jun 2003 02:18
Just to clarify what the sync command actually does. The Sync command basically tells the screen to update/refresh itself and show any updates/changes to what is been displayed everytime the command is used.

Quote: "SYNC
This command is used to improve the performance of demanding programs that require a consistent frame
rate. This is especially true of games. By default, sync is set to off which allows the system to
automatically handle screen refreshing. When SYNC ON is used, your program is responsible for handling
screen refreshing. You can refresh the screen using the SYNC command. When you want the system to
automatically handle screen refreshing again, you can use the SYNC OFF command. By placing the SYNC
command at the end of your main program loop, all drawing and refresh tasks can occur in a single call.
This dramatically increases the speed and smoothness of graphical operations, allowing your programs to
run at their best.

SYNTAX
SYNC
SYNC
"


I hear and I forget. I see and I remember. I do and I understand.
Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 28th Jun 2003 18:41
I'm sorry everybody but I put the sync in and it still doesn't work! I'll enclose my main loop 'cause maybe there is a problem there. Thanks so far though!!!

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 28th Jun 2003 20:50
Drifter here is a sample thats remarked on how to setup a simple game shell and where the sync and text are placed.



Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 28th Jun 2003 21:32
ok I put the text last in my loop, I put a sync after it but it still doesn't work!! I'll include my whole program hoping that someone could give me an Idea of what is wrong:<

Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 28th Jun 2003 21:35
Thanks so far though

Bloodshot
21
Years of Service
User Offline
Joined: 7th Apr 2003
Location: United Kingdom
Posted: 28th Jun 2003 23:50 Edited at: 29th Jun 2003 21:01
Take a look at this Text to Sprite example I created for soyuz in the
DarkBASIC Pro Discussion :: Creating text as a sprite on the fly thread.




Load it up and run it once.
Then Rem out line 36 where it says "Set Sprite 1,1,1"
Run it again to see the difference:

You should investigate some of the other Sprite and Object commands available to you, (noteably Set Sprite, Set Object and Backdrop Off commands) to help with your program, as it seems you may need to make the sprites/objects backgrounds transparent in order to see text on the screen properly.

Good Luck!
Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 29th Jun 2003 00:46
I'm sort of slow, could you please explain it to me...
Drifter
21
Years of Service
User Offline
Joined: 24th Jun 2003
Location:
Posted: 29th Jun 2003 07:39
Thanks!!! It all works! Thanks to everybody who tried to help me!!!
x-d x-d x-d x-d x-d x-d x-d

Login to post a reply

Server time is: 2024-09-20 13:18:35
Your offset time is: 2024-09-20 13:18:35