Graphical Input ? (Equivalent of Blitz3D Input)

BlitzMax Forums/BlitzMax Beginners Area/Graphical Input ? (Equivalent of Blitz3D Input)

McFox(Posted 2005) [#1]
Heya friends :)
I'm currently porting some tool apps I made in Blitz3D sometimes ago.
I know that print, inptut, etc... are now only console functions.
In blitz3D they were graphical functions so
I'm looking for a Input which is an equivalent of the Blitz3D Input.
Can someone tel me how can I do that ?

Many, many thanks

McFox


tonyg(Posted 2005) [#2]
Does this help...
Input


McFox(Posted 2005) [#3]
Amazing... many thanks tonyg

You're helping me a lot


McFox(Posted 2005) [#4]
Hi !

I tried the two functions...
And I have a Problem...

See, an exemple in B3D :

Graphics 800,600,32,2

While Not KeyHit(1)
	Cls
	Color 255,0,0
	Rect 10,10,100,100
	Locate 200,200
	Color 255,255,255
	name$=Input$("What is your name?")
	Write "Hello there, " + name$ + "!" 
	Flip
	Wend
WaitKey


You can see there are a Red Rect and a Input

Now, the blitzmax equivalent :

Graphics 800,600,0

While Not KeyHit(KEY_ESCAPE)
	Cls
	SetColor 255,0,0
	DrawRect 10,10,90,90
	SetColor 255,255,255
	name$=InputText$("What is your name?",200,200)
	DrawText "Hello there, " + name$ + "!",220,220 
	Flip
	Wend
WaitKey


Almost the same thing happen, except there is NO red rect...
Simply because InputText perform a Repeat...Until with Cls and Flip...

I tried the DynamicInput but the key detection is very random whene there are many things in the loop...
Realy a borring problem :(

So... Can someone help me ?

Thanks a lot

McFox


Yan(Posted 2005) [#5]
You have to draw the cursor yourself.

Replace the Text() function within the TInput declaration with this...




McFox(Posted 2005) [#6]
Well Thanks...
But I'm not looking for the cursor :)

I want to be able to have an input on screen without clearing the back of the screen (as Blitz3D does, look at my exemple: the red Square stay while there is the input on B3D, it doesn't on BMax)


Yan(Posted 2005) [#7]
Haha...Sorry, I obvously didnt read your post properly. :o)

Either set a viewport for the text or draw a rectangle the same colour as the background over the text instead of the cls.


tonyg(Posted 2005) [#8]
There's a 'flip;cls' command in InputText function. Take out the cls and you'll see the red rect BUT the text field won't clear and will look odd if there is a mistake.
Not sure of the solution. Maybe Wave thought of something?


Yan(Posted 2005) [#9]



tonyg(Posted 2005) [#10]
Agggghhhh...I tried for ages to get the same result.Tried grabbing images of the text area, drawing rectangles etc etc.
Got as far as looking up the viewport command but never took it any further.
Anyway, good stuff.


McFox(Posted 2005) [#11]
W00t !

Thanks Squatting Neville. This is exactly what I was looking for.

McFox


McFox(Posted 2005) [#12]
OMG :( just try the same code in Fullscreen...(Graphics 800,600,32)

Is there any way to remove the flicker :( ?
so bad :(...

Thanks

McFox


Punksmurf(Posted 2005) [#13]
try some fiddling with the new sync settings, alltough it should normally revert to hardware sync I guess


tonyg(Posted 2005) [#14]
The rect only seems to be copied to one buffer in fullscreen. It's silly but if you drawrect, flip, drawrect it's OK.
Seems to be connected to this...
Flickering


McFox(Posted 2005) [#15]
Thanks tonyg,
that's realy strange... is it a bug ? I can't find if it's a bug or not...

McFox