Giter Club home page Giter Club logo

vis-ui's Introduction

VisUI

VisUI allows to create nice looking UI in libGDX using scene2d.ui. Library contains scene2d.ui skin, useful widgets like color picker and file chooser, it also contains modified scene2d.ui widgets to provide some extra functionality like focus borders, background change on over and click, etc.

VisUI is licensed under Apache2 license meaning that you can use it for free in both commercial and non-commercial projects.

CHANGES file (definitely read before updating!)

Web demo! (source code)

VisUI screenshot Bigger screenshot

Adding VisUI to your project

Please refer to libGDX documentation if you don't know how to mange dependencies with Gradle. Alternatively JAR can be downloaded from Maven repository. If you are creating new project, you can use gdx-setup to automatically add VisUI for you. (press 'Show Third Party Extension' button)

Manual Gradle setup:

Open build.gradle in project root. In ext section under allprojects add:

visuiVersion = '1.X.X'

Look at CHANGES file to see what version of VisUI you can use for your version of libGDX. Note that using not matching versions is likely to cause runtime exceptions.

Core dependency

compile "com.kotcrab.vis:vis-ui:$visuiVersion"

HTML dependency (only if you are using HTML)

compile "com.kotcrab.vis:vis-ui:$visuiVersion:sources"

GdxDefinition.gwt.xml and GdxDefinitionSuperdev.gwt.xml:

<inherits name='com.kotcrab.vis.vis-ui' />

Refresh Gradle dependencies.

Usage

Using VisUI is pretty simple, to load or unload the skin call:

VisUI.load();
VisUI.dispose();

Create your UI like always, for extra skin features you have to use Vis widgets instead of standard scene2d.ui:

VisUI Standard scene2d.ui
VisLabel Label
LinkLabel -
VisCheckBox CheckBox
VisList List
VisProgressBar ProgressBar
VisRadioButton -
VisScrollPane ScrollPane
VisSelectBox SelectBox
VisSlider Slider
VisSplitPane SplitPane
VisTextArea TextArea
VisTextButton TextButton
VisImageTextButton ImageTextButton
VisImageButton ImageButton
VisTextField TextField
VisValidatableTextField -
VisTree Tree
VisWindow Window
VisTable Table
DragPane -
GridGroup -
ListView -
TabbedPane -
Spinner -
CollapsibleWidget -
ButtonBar -
FlowGroups -

Using Vis widgets is necessary for proper focus border management. All VisUI widgets constructors do not have Skin argument, they are using VisUI.skin field.

VisTable

VisTable allows to easily set default spacing for vis components, construct it like this:

VisTable table = new VisTable(true);

VisTable also allows adding vertical and horizontal separators to table:

table.addSeparator() //horizontal
table.addSeparator(true) //vertical

Using different SkinScales

Default VisUI skin can be too small for high resolution screens or mobile devices, in that case you can load a upscaled skin version simply by calling:

VisUI.load(SkinScale.X2);

Internal classes

Classes inside com.kotcrab.vis.[...].internal packages are considered private and aren't part of public API. Changes to that classes won't be listed in change log.

Default title align

Default title align for VisWindow and VisDialog is Align.left this can be changed by calling:

VisUI.setDefaultTitleAlign(int align)

Calling this method does not affect windows that have been already created.

Modifying skin

Raw skin files are available if you would like to modify them. After you pack them using libGDX texture packer, add generated atlas to your project with uiskin.json, default.fnt and font-small.fnt and load it by calling:

VisUI.load(Gdx.files.internal("path/to/your/modified/files/uiskin.json"))

Consider using USL if you want to extend existing VisUI styles. Read more

See also

vis-ui's People

Contributors

kotcrab avatar czyzby avatar intrigus avatar fgnm avatar pavelpuchok avatar metaphore avatar ericnondahl avatar strongjoshua avatar piotr-j avatar azurvii avatar alexaut avatar code-disaster avatar luisfonsivevo avatar keesvandieren avatar asilkin1 avatar lyze237 avatar blunderchips avatar snehks avatar languageagnostic avatar wickedshell avatar ccmb2r avatar cypherdare avatar crykn avatar strubelz avatar

Stargazers

Michael avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.