TOUCH


 [Features] The position and state of touch panel where it was touched are returned.

 [Format] TOUCH(n)

 [Explanation]
    The position and state of touch panel where it was touched are returned.
    n=0 The number of the present touches. on=1 or more.  off=0.
    n=1 Movement of flick X. (No.1)
    n=2 Movement of flick Y. (No.1)
    n=3 Touch No.1 ID.
    n=4 No.1 X coordinate.
    n=5 No.1 Y coordinate.
    Below, each 3 are increasing with the number of the multi-touch.
    n=6 Touch No.2 ID.
    n=7 No.2 X coordinate.
    n=8 No.2 Y coordinate.

    Normal single touch can be got with this.
    touchOn: touch(0)>0
    Coordinate: x=touch(4)  y=touch(5)
    [Movement of flick] support only for No.1.

    'n' correspondence table was changed from version275.
    The table by the old version are as follows.
    n: 0.X  1.Y  2.Number of touches  3.X-Movement  4.Y-Movement

    Multi-touch support.
    Since each touch is assigned ID number, by getting 'touch(3+tn*3)',
    please write the program which each touch is distinguished by those ID.
    The correspondence between touch-ID and 'n',
     when multiple on/off touching are repeated, it change at any time.
    For example of using multi-touch, please refer to the included sample program.

 [e.g.]  Sample program.
    'smp_touch2.bas'
    2 points multiple touch that distinguish by left and right separation.(ID unused)
    'smp_touch4.bas'
    4 points more multiple touch that distinguish by touch-ID.



  TAP


 [Features] It will be in a waiting state until be inputted by a tap.

 [Format] TAP [n]

 [Explanation]
    If 'n' is specified, it will become the waiting for input for n seconds.
    If omitted, waiting time will become infinite.

 [e.g.]  It wait for input for two minutes, and display a tapped coordinate.
    10 tap 120
    20 print touch(0);touch(1)



  INP


 [Features]  The input state of Hardware keyboard of a 'keycode' is read.

 [Format] INP(keycode)

 [Explanation]
    Return value.  on:-1  off:0

 [e.g.]



  STICK


 [Features] To read the direction of the virtual pad.

 [Format] STICK(n)

 [Explanation]
    n=0 Horizontal direction.
    n=1 Vertical direction.
    Return(-1,0,1)
    Virtual pad can be selected by menu[Softkey].
    In Virtual pad, by command [ init"kb:n" ],  change is possible [n=3 8way-input] [n=4 4way-input].
    The sensitivity of a touch may differ depending on the model.
    Bluetooth, NVIDIA-Shield, Xperia-Play, the controllers are supported. (c.f. item-Operation)
    It corresponds also to the arrow key of a hardware keyboard.

 [e.g.]
    x = stick(0)



  STRIG


 [Features] To read the state of the button on the virtual pad.

 [Format] STRIG(n)

 [Explanation]
    n: Button number.
    Return(off:0,on:1orMore)
    When pressed in the state of the first, '2' returns.
    Once '2' is read, it will be set to '1',
     and subsequent 'on-state' will return '1'.
    And Bluetooth, NVIDIA-Shield, Xperia-Play, the controllers are supported. (c.f. item-Operation)
    It corresponds also to the [X],[Z] key of a hardware keyboard.

 [e.g.]
    bt = strig(0)


  UI_INPUT$


 [Features] With input from the UI.dialog, and returns the input string.

 [Format] UI_INPUT$("Message","Default-text")

 [Explanation]
    The peculiar character of each country can be inputted.
    Determined by the input and [OK].
    Because when back button is pushed, dialog disappears,
    it is necessary to push and cancel by back button once again then.

 [e.g.]
    a$=ui_input$("Name","")


  UI_SELECT


 [Features] A selection number is returned by the item selection from UI dialog.

 [Format] UI_SELECT("One-dimensional character array name","Message")

 [Explanation]
    It have to declare 'One-dimensional character array' beforehand.
    And it substitutes the item name in order from number '0'.
    To specify the declared array name and the message,
     and call then, List-style dialog will appear.
    The list is displayed until it hits empty data.
    Touch and select then the number will be returned.
    When Cancel is pushed, -1 is returned.

 [e.g.] [smp_uisel.bas]
    100 dim item$(6)
    110 item$(0)="Red"
    120 item$(1)="Blue"
    130 item$(2)="Yellow"
    140 item$(3)="Green"
    150 num=ui_select("item$","Color")
    160 print num,item$(num)



  UI_MSG


 [Features]  Arbitrary message sentence are displayed several seconds by UI(toast).

 [Format] UI_MSG "message"

 [Explanation]

 [e.g.]
    ui_msg"Completed."


  UI_TEXT


 [Features]  Arbitrary sentence are displayed by dialog.

 [Format] UI_TEXT "String|TextFilename" [,TextColor] [,BackColor] [,FontSize]

 [Explanation]
    When string is specified, directly display it,
    when the end of the string is extension".txt", it is distinguished from a text file,
     and the text file is loaded and displayed.
    It can be display a long sentence by scrolling.
    The text display is affected by encoding specified by [init"enc:"].
    It can specify TextColor, BackColor and FontSize.

 [e.g.]
    ui_text st$,col(13),,24
    ui_text "help.txt"



  HALT


 [Features]  It make program stopping completely, and wait for screen touch interrupt.

 [Format] HALT

 [Explanation]
    It stop completely, so there isn't consumption of battery like 'pause' command.
    When screen is touched and interrupt is occured,
     the execution is resumed from next command of 'HALT' command.
    It can't use inside of user function 'FUNC'.
    And button touch selection become possible in combination with 'UI_BUTTON'.

 [e.g.]
    halt


  UI_BUTTON


 [Features]  It set coordinate and display buttons, and wait for the button to be selected.

 [Format] UI_BUTTON ButtonNo,Type,"Text",x1,y1,x2,y2,TextColor

 [Explanation]
    It is used 'HALT' command for selection waiting after display.
    By 'UI_BUTTON()' function, selected button number is acquired.
    Button setting format.
    ui_button ButtonNo,Type,"DisplayText",x1,y1,x2,y2,TextColor
    -Button No.
    It can specify from 1 to 64.
    When Button is touched, this number is returned.
    Also, No.0 is used to display 'menu title'.
    -Type
    The Button type is specified from 1 to 18.
    No.1~No.6 are color variations of standard Button.
    (Blue,Red,Gray,Green,Cyan,Yellow)
    When the case of [specified No.0, Type are omitted]
     the Type will be number 7.(seat type)
    -"Text"
    The text string that displayed on the Button.
    -Button coordinates x1,y1,x2,y2
    (x1,y1) Upper left of Button
    (x2,y2) Lower right of Button
    These are specified.
    By concomitant use of 'LAY()' function, the resolution difference
     between the models are absorbed, easy specification is possible.
    -Text Color
    To specify the color of "Text".

    Button initialize format.
    ui_button -1
    When only '-1' is described, all set Buttons are initialized.

    Button display format.
    ui_button
    With parameterless description, all the set Buttons are displayed.
    Since Buttons are displayed on the text screen,
     it is applied with display priority of Text screen.
    After display complete, please make it waiting of touch selection
     with writing 'HALT' command immediately after.
    When the selection is made, it's possible to acquire
     the button number touched by 'UI_BUTTON()' function.

 [e.g.]  A long sample "smp_button.bas" is also prepared.
    10 ui_button 0,,"Title",250,100,450,200,col(15)
    20 ui_button 1,4,"Yes",100,400,300,500,col(15)
    30 ui_button 2,4,"No ",400,400,600,500,col(15)
    40 ui_button
    50 halt
    60 print ui_button(0)


  UI_BUTTON  (Function)


 [Features]  To return the button number touched. The buttons were set by 'button' command.

 [Format] UI_BUTTON(n)

 [Explanation]
    'n' is a provisional parameter that have no meaning.

 [e.g.]  "smp_button.bas"