Skip to content

CSTDev/libgdx-md-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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);
    

About

Scene2dUI style Toggle widget for use with Libgdx

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages