All Projects → GreyRook → Gown.js

GreyRook / Gown.js

Licence: other
UI system for pixi.js inspired by feathers-ui

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Gown.js

Pixi Haxe
Externs of Pixi.js for Haxe
Stars: ✭ 175 (-10.26%)
Mutual labels:  webgl, pixijs, pixi, canvas
Pixi.js
The HTML5 Creation Engine: Create beautiful digital content with the fastest, most flexible 2D WebGL renderer.
Stars: ✭ 34,982 (+17839.49%)
Mutual labels:  webgl, pixijs, pixi, canvas
Leaflet.pixioverlay
Bring Pixi.js power to Leaflet maps
Stars: ✭ 264 (+35.38%)
Mutual labels:  webgl, pixijs, pixi
Phaser Kinetic Scrolling Plugin
Kinetic Scrolling plugin for Canvas using Phaser Framework
Stars: ✭ 117 (-40%)
Mutual labels:  webgl, html5-canvas, pixijs
Duckhunt Js
DuckHunt ported to JS and HTML5
Stars: ✭ 390 (+100%)
Mutual labels:  webgl, pixijs, canvas
D Zone
An ambient life simulation driven by user activity within a Discord server
Stars: ✭ 466 (+138.97%)
Mutual labels:  pixijs, pixi, canvas
Pixi Seed
Pixi.js project seed with ES6 and webpack
Stars: ✭ 149 (-23.59%)
Mutual labels:  webgl, pixijs, pixi
Awesome Pixijs
My list of awesome pixi.js related parties
Stars: ✭ 489 (+150.77%)
Mutual labels:  webgl, pixijs, canvas
Earthjs
D3 Earth JS
Stars: ✭ 128 (-34.36%)
Mutual labels:  webgl, canvas
Phaser Examples
Contains hundreds of source code examples and related media for the Phaser HTML5 Game Framework.
Stars: ✭ 1,680 (+761.54%)
Mutual labels:  webgl, canvas
R3f Next Starter
Repo is moving to https://github.com/pmndrs/react-three-next
Stars: ✭ 137 (-29.74%)
Mutual labels:  webgl, canvas
Gcanvas
A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas
Stars: ✭ 1,705 (+774.36%)
Mutual labels:  webgl, canvas
Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-36.92%)
Mutual labels:  webgl, canvas
Vue Canvas Nest
💫 A Vue.js background component for canvas-nest.
Stars: ✭ 136 (-30.26%)
Mutual labels:  html5-canvas, canvas
Freeciv Web
Freeciv-web is an Open Source strategy game implemented in HTML5 and WebGL, which can be played online against other players, or in single player mode against AI opponents.
Stars: ✭ 1,626 (+733.85%)
Mutual labels:  webgl, canvas
Alien.js
Future web pattern
Stars: ✭ 141 (-27.69%)
Mutual labels:  webgl, canvas
Creature webgl
2D Skeletal Animation WebGL Runtimes for Creature ( PixiJS, PhaserJS, ThreeJS, BabylonJS, Cocos Creator )
Stars: ✭ 140 (-28.21%)
Mutual labels:  webgl, pixijs
Ribbon.js
🎀 Only 1kb javascript gist to generate a ribbon in your website with HTML5 canvas.
Stars: ✭ 189 (-3.08%)
Mutual labels:  html5-canvas, canvas
Zen 3d
JavaScript 3D library.
Stars: ✭ 155 (-20.51%)
Mutual labels:  webgl, canvas
Proton
Javascript particle animation library
Stars: ✭ 1,958 (+904.1%)
Mutual labels:  webgl, canvas

gown.js

UI system for pixi.js 4, inspired by feathers-ui.

Inline docs Code Climate Build Status

Features

  1. Basic UI components

    • Button: simple Button, with label and background, easy to extend using themes
    • CheckBox a simple checkbox
    • ToggleButton: a button with pressed state
    • Slider a simple slider with modifyable start and end value
  2. Layouting

    • LayoutGroup: a component to create horizontal, vertical or tile-based layouts
  3. Scrollable container

    • ScrollContainer: provides a viewport that can be scrolled using mouse or touch gestures. When its content is a LayoutGroup the scroll behavior will be dependent on its layout: a horizontal layoutgroup will default to horizontal scrolling, vertical layout to vertical scrolling. But you are in control and can manually overwrite the scroll behavior.
    • ScrollBar: providing a scroll thumb that can be moved. Part of ScrollContainer and List, but can be used separately.
  4. A Text input providing text and password input (based on PIXI Input )

  5. Basic shapes that provide width and height that can be changed easily (for use in themes for example)

Examples

see the examples-folder in this repo or play with some example online at: http://greyrook.github.io/gown.js/examples/

Folder structure

  • examples - simple examples to show the usage (and to have something more graphical besides the jasmine-tests)

  • lib - required libraries (just pixi-dev)

  • src - source code for gown.js

  • test - unit tests, run coverage_karma_istanbul.sh to get a table providing all files and their coverage, run coverage_blanket to start a web server that shows you the coverage for all lines of the generated browserify output file.

  • themes - basic UI example themes

  • AeonTheme.js A theme based on Feather's AeonDesktopTheme making use of 9-tiled images

  • MetalWorksDesktopTheme.js a theme based on Feather's MetalWorksDesktopTheme

  • Themes/ShapeTheme.js a theme using only basic shapes.

Installation

  1. Check out the repository from the GreyRook/gown github repository.
  2. Install node.js (if its not even installed).
  3. Change into the path for the checked out repository and run npm install
  4. run npm run dist to build the library (it will be in docs/dist )
  5. start a webserver e.g. python -m SimpleHTTPServer to show the examples ( find them at /docs/examples/ )

Theming

  • Using the python script themes/xml_to_json.py you can convert your XML file from feathers-ui into JSON so the default PIXI loader can parse it.

  • example:

python xml_to_json.py assets/aeon/aeon_desktop.xml

the script requires PIL (or Pillow) to determine the texture width/height

  • It is possible to have different themes in one project
  • Themes can be switched at run time
  • For reference how to create your own theme check the themes folder. It contains two different approaches on creating themes
  • The test/src/TestTheme.js is a fake theme used only for the unit tests

Under the hood

Center of the theming system is the "skins"-object. It holds unique names of different controls as key (e.g. "button" as identifier for GOWN.Button) and nested objects as value. These nested objects allow you to save different graphics for different skins (e.g. "down" when the user pressed a button down). The graphic for the state can be an images but also any kind of shape (you can set everything that can be added to a PIXI-DisplayObjectContainer as skin). It is important that the variable width/height of your skin can be changed so your skin can be layouted correctly. Every control need its own instance for the skin, so you have to wrap it in a function that creates a new instance of the skin.

In short, the skins-object looks like this: theme.skins = {<control>: {<state>: function () { new <skin>() } }}

Rendering

When changing a component the corresponding setter updates an invalid flag. This will force a redraw on the next frame. (this can be the recalculation of the position and dimensions or a skin change on user interaction).

The loop looks like this:

  1. redraw (gown)
  2. updateTransform (PIXI)
  3. render (PIXI)

The redraw function is hooked into PIXI's render loop in the updateTranform methond but called before the actual calcluation of updateTransform.

Known Bugs

see Issues

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].