JSFiddle - React, Tailwind, and code Playground
by nikkikoole
HTML
<script src="//cdnjs.cloudflare.com/ajax/libs/pixi.js/2.0.0/pixi.js"></script>
CoffeeScript
stage = null
renderer = null
class Item extends PIXI.DisplayObjectContainer
constructor: (pos) ->
super()
@item = new PIXI.DisplayObjectContainer()
@g = new PIXI.Graphics()
@g.beginFill(0xff0000)
@g.drawRect(0,0,100,100)
@g.beginFill(0xffff00)
@g.drawRect(10,10,80,80)
@item.addChild @g
@addChild @item
@position.x = pos.x
@position.y = pos.y
@rotation = Math.PI/4
@item.scale.x = 3
@item.scale.y = 1
initialize = ->
stage = new PIXI.Stage(0x888888)
renderer_options =
resolution: 1
antialias: true
transparent: false
renderer = new PIXI.autoDetectRenderer(window.innerWidth, window.innerHeight)
document.body.appendChild renderer.view
thing = new Item({x:400,y:400})
stage.addChild thing
renderer.render(stage)
initialize()