Skip to content

Latest commit

 

History

History
26 lines (18 loc) · 1.21 KB

README.md

File metadata and controls

26 lines (18 loc) · 1.21 KB

Libgdx-MD-Toggle

Libgdx-MD-Toggle is a scene2dUI implemetation of a Google material design style Toggle control. It is a simple extension of the Libgdx Slider with the addition of changing the knob and background as the toggle is switched, as well as providing a property to indicate whether it is on or not.

Screenshot

Toggle On Screenshot Toggle Off Screenshot

##GettingStarted ##Prerequisites This is designed to be used with Libgdx

###Usage

  1. Copy Toggle.java somewhere in you application

  2. Create a ToggleStyle in your skin. (uiskin.json and matching requirements in uiskin.atlas and uiskin.png if you're using them, see example for uiskin.json))

    *You will need to include drawables for background, knobBefore, knobAfter, knob and knobOn. Some .svg files have been included to make creating each of them easier.

    *Ensure the package name matches that of where you put the Toggle class.

  3. Create a new Toggle like any other UI widget:

    	Toggle toggle = new Toggle(false, skin);