|
InputS
Feb 27, 2022 5:24:00 GMT -6
Post by rosy on Feb 27, 2022 5:24:00 GMT -6
xmax = 640
ymax = 480
w=0
title$ = ""
center_x = windowpos_centered
center_y = windowpos_centered
WindowOpen(w,title$,center_x,center_y,xmax,ymax,WindowMode(1,0,0,0,0),1)
SetWindowAutoClose(w, 0)
CanvasOpen(0,xmax,ymax,0,0,xmax,ymax,0)
Canvas(0)
ClearCanvas
Update
InputS$ ( "kk" )
print ZoneInputS$ ( 100, 100, 200, 200 )
print waitkey 1. Nothing prints 2. The window does not close 3. Forgot to specify in the statement that WaitKey returns a key.
SparkyLinux 64, RC 3.17, I guess ...
|
|
|
InputS
Mar 6, 2022 1:28:06 GMT -6
Post by rosy on Mar 6, 2022 1:28:06 GMT -6
Did you read it?
|
|
|
InputS
Mar 6, 2022 1:59:16 GMT -6
Post by johnno56 on Mar 6, 2022 1:59:16 GMT -6
Rosy.
The reason nothing printed is because when the 'update' command is issued there was nothing to update. All of the 'printing' occurs 'after' the update. Also, the colour of the text may need to be specified if printing to the screen. The console defaults to white. The following changes seems to work. But I am unclear as to the purpose of ZoneInput...
xmax = 640 ymax = 480 w=0 title$ = "" center_x = windowpos_centered center_y = windowpos_centered WindowOpen(w,title$,center_x,center_y,xmax,ymax,WindowMode(1,0,0,0,0),1) SetWindowAutoClose(w, 0) CanvasOpen(0,xmax,ymax,0,0,xmax,ymax,0) Canvas(0) ClearCanvas setColor(rgb(255,255,255)) InputS$ ( "kk" ) print ZoneInputS$ ( 100, 100, 200, 200 ) print waitkey Update I know of InputS$() but have never seen ZoneInputS$() before. I figured InputS$() required a response... Pressed "Enter" a few times and the key# appeared on the console and the program ended. I hope I haven't caused an confusion...
J
|
|
|
InputS
Mar 6, 2022 2:30:43 GMT -6
Post by n00b on Mar 6, 2022 2:30:43 GMT -6
johnno56 A quick correction. PrintS(), InputS(), and ZoneInputS() don't require calling update. DrawText and the ReadInput functions will need update and these are the functions I would recommend using for output and input in a graphics window. rosy A few things: 1. Use SetColor() to set the color of your text in your window. By default its 0 which is completely invisible. 2. Print just outputs to the terminal. To output in the window you can use PrintS() but I always recommend using DrawText() because PrintS() updates the window every time you call it which can cause a lot of flicker when other stuff is happening. 3. The window was waiting on you to press enter twice and then another key after that to close.
|
|
|
InputS
Mar 6, 2022 4:08:08 GMT -6
Post by johnno56 on Mar 6, 2022 4:08:08 GMT -6
Ah. Thank you. I stand corrected. My apologies, Rosy.
|
|
|
InputS
Mar 6, 2022 7:06:27 GMT -6
Post by rosy on Mar 6, 2022 7:06:27 GMT -6
Okay, in Johnny's example I can type, but there are strange things happening and the screen is flickering with garbage, so maybe need some Update's.
|
|
|
InputS
Mar 20, 2022 15:42:32 GMT -6
Post by rosy on Mar 20, 2022 15:42:32 GMT -6
In Sparky, with InputS, garbage appears on the screen every 2nd key press. And in ReadInput_Text $ I only get a sign when I press 2 keys at a time.
|
|
|
InputS
Mar 21, 2022 15:07:00 GMT -6
Post by n00b on Mar 21, 2022 15:07:00 GMT -6
In Sparky, with InputS, garbage appears on the screen every 2nd key press. And in ReadInput_Text $ I only get a sign when I press 2 keys at a time. Can you share your code?
|
|
|
InputS
Mar 22, 2022 2:10:34 GMT -6
Post by rosy on Mar 22, 2022 2:10:34 GMT -6
Normallyy...
StartInput do print ReadInput_Text$ update loop StopInput
I don't remember what version of RC. Not the newest.
|
|
|
InputS
Mar 22, 2022 3:12:30 GMT -6
Post by johnno56 on Mar 22, 2022 3:12:30 GMT -6
I am not sure if this helps.... But, in my scheme Editor, I am using Readinput to enter filenames to either save or load...
This works for me...
While Not Key(K_RETURN) filename2$ = ReadInput_Text$() setColor(cyan): DrawText("> ", 280, 410) If filename2$ <> "" Then setColor(white): DrawText(filename2$, 300, 410) End If Update() Wend I hope this helps...
J ps: cyan = rgb(0, 255, 255) and white = rgb(255, 255, 255)... but you probably already figured that out, right? lol
|
|