Package arc.mock

Class MockInput

java.lang.Object
arc.Input
arc.mock.MockInput

public class MockInput extends Input
The headless backend does its best to mock elements. This is intended to make code-sharing between server and client as simple as possible.
  • Constructor Details

    • MockInput

      public MockInput()
  • Method Details

    • 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
    • getCurrentEventTime

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