Input Fields

Blitz3D Forums/Blitz3D Beginners Area/Input Fields

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

I believe i need some more help if anyone can spare it.

I finished the code that Semar gave me above. Now my problem is getting the input box to appear when whatwaspicked=notebook. I dont know why it wont display any input box. Some help would be really appreciated.
Here is the code.

Graphics3D 640,480,16,2
SetBuffer BackBuffer()
type_bracket=1
type_arrow=2

light=CreateLight()
camera=CreateCamera()
PositionEntity camera,0,0,-1.5


Global Status 
Global Input_Text$ ;store the text input of the user 
Global Input_Finished = False ;flag to indicate when the user is done with the input 
Const S_NORMAL = 1 
Const S_INPUT = 2 
Status = S_NORMAL 

Function input_box()
Local av=GetKey() ;gets the ascii value of a pressed key
If av>0 Then ;a key has been pressed
;first check if the user has pressed enter
If av=13 Then
input_finished=True
Return ;exit the function
EndIf
;we have to convert the ascii value, which is an integer, to the corresponding string character using command Chr, and update the input text

input_text=input_text + Chr(av)

EndIf
End Function

;the notebook
notebook=CreateCube()
ScaleEntity notebook,.15,.15,.000001
EntityOrder notebook,-1
PositionEntity notebook,-1.3,.8,0
tex4=LoadTexture("notebook.jpg")
EntityTexture notebook,tex4
EntityPickMode notebook,2

Cls
;code logic here
If whatwaspicked=notepad Then ;make input box available
status=s_input ;set the status variable
input_tex$=" " ;reset the tex variable
input_finished=False ;reset the value of the integer flag
EndIf

Select statue
Case S_NORMAL
	;display everything but the input box
	;check the keyboard as usual
Case S_INPUT
	;displays everything + input box
	;Check the keyboard for input box
	Input_Box() ;check to read user input
	;displays an input box rectangle
	Rect 100,100,150,80
	;display the text inside it.
	Text 110,110,input_text$
	

End Select