printing to screen

BlitzPlus Forums/BlitzPlus Programming/printing to screen

loonix(Posted 2012) [#1]
Can i print variable values to any where on the screen ??
if so, How ??

prob a daft question... but I'm a bit new to this

Thanks


Addi(Posted 2012) [#2]
if you dont want to use text you can use bitmap fonts and create a function that draws the parts of the font on the screen


loonix(Posted 2012) [#3]
Well the prob is I can't get text to print anything to the screen.
If the graphics are set and i just run a simple program to print "hello" to ,say, 400,0 .... nothing happens, just a blank screen !!

Last edited 2012


okee(Posted 2012) [#4]
You're probably missing the flip command i.e.


Graphics 640,480,1
SetBuffer BackBuffer()

While Not KeyHit(1)
Cls ;clear the current drawing buffer

	Text 100,100,"Hello World"

Flip	;swap buffers 

Wend



loonix(Posted 2012) [#5]
yay. cool...

thats that sorted :)... thank you


Addi(Posted 2012) [#6]
Sry. havn't thougth about that :D


loonix(Posted 2012) [#7]
Mmmmm,

Okee's solution does work, but I was messing about with different ways to print

Like a little counter loop printing the value of the loop to the same point on the screen...


For loop = 1 to 10000

Text 100, 100, loop

Next

Obviously using the flip thingy.... It ends up with a few inverse colons with a zero on the end at 100,100 !!

i would of liked to have seen the counting of the loops value displayed at position 100,100 but that doesn't happen..

What im trying to aim for is , constantly monitoring several sensors that display various values at different times,

So really what would be ideal is a window, i can ,at will, print anywhere i'd like without having to clear the whole screen and reprint everything..... Or am i just asking too much

Last edited 2012


Dabhand(Posted 2012) [#8]
Graphics 640,480

Local time = MilliSecs()
Local counterOne = 0
Local counterTwo = 1000

Repeat
Cls

'Update values every second, though, you could update anything
'really.
If MilliSecs() > time + 1000
	counterOne = counterOne + 1
	counterTwo = counterTwo + 1
	time = MilliSecs()
EndIf

Text 10,10,"Counter One: " + counterOne
Text 100,100,"Counter Two: " + counterTwo 
Flip
Until KeyDown(1)


Like that?

Dabz

Last edited 2012


loonix(Posted 2012) [#9]
mmm...

comes up saying 'Expecting until or forever' Error

Ahhhh..... no semi colons in front of the comments lol

Thanks mate... cool :)

Last edited 2012


Dabhand(Posted 2012) [#10]
Lol, I added the comment after I posted, must of dropped into blitzmax for a second! ;)

Anyway, no probs!

Dabz