Locate

Blitz3D Forums/Blitz3D Beginners Area/Locate

npajr(Posted 2004) [#1]
BliyzPlus does not support command "Locate". Therefore most examples, etc., in earlier version will not run. Error massage 'Function locate not found". Command used is usually "Locate 0,0" which puts the cursor in position 0,0. Question-what should be used in place of "Locate" and why put cursor in position 0,0 in first place? "Text" does not seem to work, or I can't make it work. Any ideas?

Paul


EOF(Posted 2004) [#2]
Locate has been removed from BlitzPlus.
I use this code to replicate the old Blit2D Locate/Print commands. You need to set up a graphics display before using the functions.

include this code at the beginning of your program:
; Locate/Print for Blitz+
Global locateX,locateY

Function Locate(x,y)
	locateX=(x-1)*StringWidth("W") : locateY=(y-1)*FontHeight()
End Function

Function Print(txt$)
	Text locateX,locateY,txt$
End Function



npajr(Posted 2004) [#3]
Thanks!!!

Will give it a try.

Paul A.


semar(Posted 2004) [#4]
Under Blitz+, the Print command works only for console applications.

Since the Locate command was used to set the starting x,y position for a Print statement, it has been removed from the Blitz+ command set.

In other words, if you want to print some text on the screen, using Blitz+, you may use the Text command instead.

As stated by Syntax Error, you must first set up a graphic mode:

Graphics 640,480,0,2 ;set graphics mode
text 100,100, "Hello World" ;print hello world at x=100, y=100
flip ;double buffering
waitkey ;wait for any key
end ; ends


Hope this helps,
Sergio.