News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

reactivate input

Started by Green7, July 05, 2008, 03:45:42 AM

Previous topic - Next topic

Green7

Ok, as for what i read about the "input" function, it is not a often used thing. but im in need of it and got a small problem. whenever i hit enter, it leaves the input and ends it. thets ok, as it is writen in the documentation. but i would be happy if it would not do so, or if i can reactivate it. there is a function called "InputActive()" which should handle this, but i do not how to make it work.

i tried to use it like this:
InputActive()=1
but it does not seem to be the correct usage, it returns an error... ???

maybe i did not really understand the means of this function, or maybe there is another way to reactivate an input...
Can someone give me a hint?

Thx in advance! :)

kevin


I don't really follow your question, can you post a snippet of what you're trying to do ?

Green7

#include "Input"

LoadFont "Arial",1,15,0

New_Map_Name= NewInput(310,205,"")

Ink RGB(229,219,209)

DO
BoxC 300,200,500,225,1,RGB(130,119,108)
Input(New_Map_Name)
SYNC:LOOP


if you start the code, then type some stuff, and then press enter, you cant write on, cause it deactivates the input, as it should.
but how can i get back to make it work again? i mean, it does not really disturb me, but maybe the players who do not know that the input is supposed to do that... ;) i got now a solution in mind, but i like to hear if the function "InputActive" has any use besides returning if the input is active or not. should i not be able to reactivate the Input by a line like this?
InputActive()=1

thx in advance!

kevin



#include "Input"

SetFPS 60

LoadFont "Arial",1,15,0

New_Map_Name= NewInput(310,205,"")

Repeat
Ink RGB(229,219,209)

Repeat
BoxC 300,200,500,225,1,RGB(130,119,108)
Input(New_Map_Name)
SYNC
until GetInputActive(New_Map_Name)=false

        // Get the text the person typed
Name$=GetInputText(New_Map_name)

print Name$
Print "Correct y/n"
Sync

Flushkeys

Repeat
Key$=lower$(Inkey$())
Until Key$="y" or Key$="n"

        // If input was not correct,  Activate the Input handle again, and repeat.
if key$="n"  then InputActive(New_Map_name,true)

Until Key$="y"



Green7

Thx a lot! another bug crunched in my map editor... :)