Class IOSInput

java.lang.Object
arc.Input
arc.backend.robovm.IOSInput

public class IOSInput extends Input
  • Field Details

  • Constructor Details

  • Method Details

    • setupAccelerometer

      protected void setupAccelerometer()
    • getAccelerometer

      public Vec3 getAccelerometer()
      Overrides:
      getAccelerometer in class Input
      Returns:
      The acceleration force in m/s^2 applied to the device, including the force of gravity
    • mouseX

      public int mouseX()
      Specified by:
      mouseX in class Input
      Returns:
      The x coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first pointer in screen coordinates. The screen origin is the top left corner.
    • mouseX

      public int mouseX(int pointer)
      Description copied from class: Input
      Returns the x coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used.
      Specified by:
      mouseX in class Input
      Parameters:
      pointer - the pointer id.
      Returns:
      the x coordinate
    • deltaX

      public int deltaX()
      Specified by:
      deltaX in class Input
      Returns:
      the different between the current pointer location and the last pointer location on the x-axis.
    • deltaX

      public int deltaX(int pointer)
      Specified by:
      deltaX in class Input
      Returns:
      the different between the current pointer location and the last pointer location on the x-axis.
    • mouseY

      public int mouseY()
      Specified by:
      mouseY in class Input
      Returns:
      The y coordinate of the last touch on touch screen devices and the current mouse position on desktop for the first pointer in screen coordinates. The screen origin is the bottom left corner.
    • mouseY

      public int mouseY(int pointer)
      Description copied from class: Input
      Returns the y coordinate in screen coordinates of the given pointer. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used.
      Specified by:
      mouseY in class Input
      Parameters:
      pointer - the pointer id.
      Returns:
      the y coordinate
    • deltaY

      public int deltaY()
      Specified by:
      deltaY in class Input
      Returns:
      the different between the current pointer location and the last pointer location on the y-axis.
    • deltaY

      public int deltaY(int pointer)
      Specified by:
      deltaY in class Input
      Returns:
      the different between the current pointer location and the last pointer location on the y-axis.
    • isTouched

      public boolean isTouched()
      Specified by:
      isTouched in class Input
      Returns:
      whether the screen is currently touched.
    • justTouched

      public boolean justTouched()
      Specified by:
      justTouched in class Input
      Returns:
      whether a new touch down event just occurred.
    • isTouched

      public boolean isTouched(int pointer)
      Description copied from class: Input
      Whether the screen is currently touched by the pointer with the given index. Pointers are indexed from 0 to n. The pointer id identifies the order in which the fingers went down on the screen, e.g. 0 is the first finger, 1 is the second and so on. When two fingers are touched down and the first one is lifted the second one keeps its index. If another finger is placed on the touch screen the first free index will be used.
      Specified by:
      isTouched in class Input
      Parameters:
      pointer - the pointer
      Returns:
      whether the screen is touched by the pointer
    • getPressure

      public float getPressure()
      Overrides:
      getPressure in class Input
      Returns:
      the pressure of the first pointer
    • getPressure

      public float getPressure(int pointer)
      Description copied from class: Input
      Returns the pressure of the given pointer, where 0 is untouched. On Android it should be up to 1.0, but it can go above that slightly and its not consistent between devices. On iOS 1.0 is the normal touch and significantly more of hard touch. Check relevant manufacturer documentation for details. Check availability with Input.isPeripheralAvailable(Peripheral). If not supported, returns 1.0 when touched.
      Overrides:
      getPressure in class Input
      Parameters:
      pointer - the pointer id.
      Returns:
      the pressure
    • getTextInput

      public void getTextInput(Input.TextInput input)
      Description copied from class: Input
      System dependent method to input a string of text. A dialog box will be created with the given title and the given text as a message for the user. Once the dialog has been closed the consumer be called on the rendering thread.
      Overrides:
      getTextInput in class Input
    • setOnscreenKeyboardVisible

      public void setOnscreenKeyboardVisible(boolean visible)
      Description copied from class: Input
      Sets the on-screen keyboard visible if available. Only applicable on mobile.
      Overrides:
      setOnscreenKeyboardVisible in class Input
      Parameters:
      visible - visible or not
    • setKeyboardCloseOnReturnKey

      public void setKeyboardCloseOnReturnKey(boolean shouldClose)
      Set the keyboard to close when the UITextField return key is pressed
      Parameters:
      shouldClose - Whether or not the keyboard should clsoe on return key press
    • getKeyboardTextField

      public org.robovm.apple.uikit.UITextField getKeyboardTextField()
    • vibrate

      public void vibrate(int milliseconds)
      Description copied from class: Input
      Vibrates for the given amount of time. Note that you'll need the permission <uses-permission android:name="android.permission.VIBRATE" /> in your manifest file in order for this to work.
      Overrides:
      vibrate in class Input
      Parameters:
      milliseconds - the number of milliseconds to vibrate.
    • getCurrentEventTime

      public long getCurrentEventTime()
      Specified by:
      getCurrentEventTime in class Input
      Returns:
      the time of the event currently reported to the InputProcessor.
    • isPeripheralAvailable

      public boolean isPeripheralAvailable(Input.Peripheral peripheral)
      Description copied from class: Input
      Queries whether a Input.Peripheral is currently available. In case of Android and the Input.Peripheral.hardwareKeyboard this returns the whether the keyboard is currently slid out or not.
      Overrides:
      isPeripheralAvailable in class Input
      Parameters:
      peripheral - the Input.Peripheral
      Returns:
      whether the peripheral is available or not.
    • getRotation

      public int getRotation()
      Overrides:
      getRotation in class Input
      Returns:
      the rotation of the device with respect to its native orientation.
    • getNativeOrientation

      public Input.Orientation getNativeOrientation()
      Overrides:
      getNativeOrientation in class Input
      Returns:
      the native orientation of the device.
    • onTouch

      protected void onTouch(long touches)