Get text on screen

Blitz3D Forums/Blitz3D Programming/Get text on screen

Rgamer(Posted 2007) [#1]
I have a problem with the text command. Whereever I put the text command on my code, the text usually ends up on either my cube or sphere. Does anyone know how to get my text like on the screen and not on any of my shapes. Below is a sample of my code. I have about one month left to get this done, so can you please hurry. Thanks.

;This creates the program's screen
Graphics3D 800,600
SetBuffer BackBuffer()



;These lines creates the types used for collisions
type_player=1
type_computer=2
type_walls=3

;creates the camera
camera=CreateCamera()



;creates a light
light=CreateLight()




;This creates the racetrack
wall1=LoadMesh("inside wall.x")
tex=LoadTexture("Wall texture.jpg"): SetBuffer TextureBuffer(tex)
ClsColor 256,6,56
Cls
EntityTexture wall1,tex
PositionEntity wall1, 1,0,0
ScaleEntity wall1, .07,.07,.07



;This creates the object the player would control
racer1=CreateSphere(10)
;This creates a texture for the player vehicle
racer1tex=CreateTexture(16,16): SetBuffer TextureBuffer(racer1tex)
;When the Cls command goes active, it will clear to the color defined below
ClsColor 200,5,67
;;This places the color described in the ClsColor command
Cls
;This places the texture on the player's racer
EntityTexture racer1,racer1tex
;This places where the racer is in the program
PositionEntity racer1, 0,0,0
;This places the racer in the type player
EntityType racer1,type_player


;This creates the object that the computer would control
racerc=CreateCube()
;This creates the texture for this object
racerctex=CreateTexture(16,16): SetBuffer TextureBuffer(racerctex)
;This places the color into the texture when the Cls command is initiated
ClsColor 35,79,100
;This places the color described in the ClsColor command
Cls
;This places the texture around the computer controlled object
EntityTexture racerc,racerctex
;This places where the racer is in the program
PositionEntity racerc, 3,0,0
;This places the racer in the type computer
EntityType racerc,type_computer


;This code makes the program run
While Not KeyDown(1)

;When the left key is held, the racer will turn left
If KeyDown(205)=True Then TurnEntity racer1, 0,-1,0
;When the left key is held, the camera will turn left
If KeyDown(205)=True Then TurnEntity camera, 0,-1,0
;When the right key is held, the racer will turn right
If KeyDown(203)=True Then TurnEntity racer1, 0,1,0
;When the right key is held, the camera will turn right
If KeyDown(203)=True Then TurnEntity camera, 0,1,0
;When the up key is held, the racer will move forward
If KeyDown(200)=True Then MoveEntity racer1, 0,0,.05
;When the up key is held, the camera will move forward
If KeyDown(200)=True Then MoveEntity camera, 0,0,.5
;When the spacebar is held, the racer will move backwards
If KeyDown(57)=True Then MoveEntity racer1, 0,0,-.03
;When the spacebar is held, the camera will move backwards
If KeyDown(57)=True Then MoveEntity camera, 0,0,-.03

;This command places the camera as racer1
PositionEntity camera,EntityX(racer1),0,EntityZ(racer1)
;This command places the camera back enough to see racer1 in action
MoveEntity camera, 0,0,-5



;This creates the collision between the player's racer with the computer's racer
Collisions type_player,type_computer,2,2
Collisions type_player,type_walls,2,2
;This command checks for collisions in the program's world.
UpdateWorld



RenderWorld
Text 0,0,"45",False,False
Flip


;This ends the while command
Wend

End


octothorpe(Posted 2007) [#2]
"[codebox]"


Mattizzle(Posted 2007) [#3]
Ah yeah you forgot to set the buffer back to the back buffer. insert:
SetBuffer BackBuffer()

before the main loop.

Also if those are your real camera and player controls... they're seriously messed up. But i will assume those were just for demo purposses for the forums ;-)


Rgamer(Posted 2007) [#4]
Thanks for the Help!


Mattizzle(Posted 2007) [#5]
Welcome. If you really do need help on camera and player controls, I can help with that too.