Git Product home page Git Product logo

xgui.js's Introduction

xgui.js

Some simple gui stuff to try and make js experimentation a bit easier.

The idea is to be able to quickly set up a bunch of sliders, knobs, colorPickers, etc. and bind the values of these to objects or functions.

It gives you a bunch of gui stuff, like these (old one here):

example

Basic usage

Download the minified js file and include it in your html.

<script src="xgui.min.js"></script>

This code creates a "xgui" and adds it to the document.body, makes a HSlider, binds some properties of a testObject.

<script>

	var testObject = { x:0, y:0 };

	var gui = new xgui();
	document.body.appendChild( gui.getDomElement() );

	var slider = new gui.HSlider( {x:10, y:10, value: 0, min:-100, max:100} );
	slider.value.bind(testObject, "x", "y");

</script>

So when you drag the slider testObject.x and testObject.y will be set to the value of the slider.

More examples to come. For now look in /examples/testbed.html and /examples/testbed_touch.html for some idea of how to use it. Some examples where I used it: Dragon Curve, Balls Box2d, Drum machine

Inspiration came from similar stuff for OpenFrameworks, like this.

It currently includes these elements: HSlider, VSlider, Label, RadioButton, RadioButtonGroup, CheckBox, Knob, ColorPicker, ColorPicker2, ColorPicker3, TrackPad, Button, ImageButton, Graph, Stepper, InputText, DropDown, Matrix, RangeSlider, Joystick, CircularSlider, Scrollwheel.

History

r2 - Multitouch should now work across Android, iOS and Windows 8.x. Plus various platform specific bugfixes. Added CircularSlider, Scrollwheel and ColorPicker3. Added methods for: onResize, disableEvents, enableEvents and dispose.

r1 - Made it touch friendly, so multitouch should hopefully work(Tested on Nexus 4/7). Added Joystick, like an analog stick. Fixed various bugs and stuff.

r0 - Initial version.

xgui.js's People

Contributors

oosmoxiecode avatar sroucheray 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.