crafty boiler plate

by fdietz

HTML

<script src="https://rawgithub.com/craftyjs/Crafty/release/dist/crafty-min.js"></script>

JavaScript

var width = 600;
var height= 300;

Crafty.init(width, height);
Crafty.background('rgb(127,127,127)');

Crafty.e("Box, 2D, DOM, Color")
	.color('red')
	.attr({ x: 00, y: 00, w: 100, h: 100 });

Crafty.e("Box, 2D, DOM, Color")
	.color('yellow')
	.attr({ x: width-100, y: height-100, w: 100, h: 100 });

Crafty.e("Box, 2D, DOM, Color")
	.color('green')
	.attr({ x: width-100, y: 0, w: 100, h: 100 });

Crafty.e("Box, 2D, DOM, Color")
	.color('blue')
	.attr({ x: 0, y: height-100, w: 100, h: 100 });

Crafty.e("2D, Text, DOM, Color")
	.color('rgb(255,0,0)')
    .attr({ x: 200, y: 200, w: 600 })
    .textFont({ size: '20px', weight: 'bold' })
    .text("Hello World");