Skip to content

UITextSwitch.java

Raphael Lutz edited this page Jul 12, 2018 · 2 revisions

Button switching between two states (id est two String).

Fields

  • String text1, text2 : the two Strings of the switch button
  • ClickListener clicker : link to the current ClickListener
  • boolean chosen1 : boolean representing if the first string is chosen (false if it's the second one)

Methods

  • UITextSwitch(float x, float y, int width, int height, String text1, String text2, boolean chosen1, ClickListener clicker) : constructor of the class
  • void tick() : tick method if the switch need to be animated
  • void render(Graphics g) : method to render the button
  • void onClick() : called when the button is clicked
  • void setX() : error
  • void switchIt() : switches state of the switch
  • boolean isChosen() : getter for chosen1
Clone this wiki locally