1.0.0 • Published 4 years ago

wings-js v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Alt text

Usage:

Link Wings to your web page

<script src="wings.js"></script>

Add a canvas

<canvas id="view" width="300px" height="300px">

Add View and Component classes to your running scope

const { View, Component } = Wings

Instantiate the view linking it to the canvas

var view = new View(document.getElementById("view"))

Create a component class (demo)

class Box extends Component {
	constructor() {
		super()

		// set the dimensions
		this.width = this.height = 50

		// set colors
		this.backgroundColor = 'magenta'
		this.borderColor = 'cyan'
		this.borderWidth = 5
	}
}

Instantiate it and add it to the view

var box = new Box

view.add(box)

Locate it inside the view

box.x = box.y = 100

Add mouse reaction to it

box.on('MouseClick', () => alert('Hello, World!'))

See demos at https://manuelbarzi.github.io/wings-js

1.0.0

4 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago