How to use the pixi.js.Graphics function in pixi

To help you get started, we’ve selected a few pixi examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Coder2012 / pixi / containers / src / js / app.js View on Github external
function createDocks () {
  let port = new PIXI.Graphics()
  port = new PIXI.Graphics()
  port.lineStyle(2, 0x884756);
  port.beginFill(0x991234)
  port.drawRect(0, 0, app.screen.width, 40);
  port.endFill()
  port.y = app.screen.height - port.height
  app.stage.addChild(port)

  dockStore = new Storage(app, 4)
  dockStore.y = app.screen.height - (port.height + 55)
  dockStore.on('platform-selected', onPlatformSelected)
  app.stage.addChild(dockStore)
}
github Coder2012 / pixi / containers / src / js / crane.js View on Github external
constructor (app) {
		super()

		this._platform = undefined
		this._container = undefined
		this._restPos = {x: app.screen.width / 2, y: app.screen.height / 2}

		this._graphics = new PIXI.Graphics()
	  this._graphics.lineStyle(2, 0x0000FF, 1);
	  this._graphics.drawRect(0, 0, 126, 53);
	  this._graphics.position = this._restPos
	  this.addChild(this._graphics)

	}
github Coder2012 / pixi / containers / src / js / storage.js View on Github external
createPlatforms () {
		for (var i = 0; i < this._num; i++) {
	    let g = new PIXI.Graphics()
	    g.interactive = true
	    g.beginFill(0x004400)
	    g.lineStyle(4, 0x008800)
	    g.drawRect(0, 0, 126, 53)
	    g.endFill()
	    g.on('mousedown', this.select, this)
	    g.on('touchstart', this.select, this)
	    g.x = i * 126
	    g.y = 0
	    this.addChild(g)
	  }
	}
github jamro / jsbattle / packages / jsbattle-engine / src / engine / renderers / debug / DebugBattlefieldView.js View on Github external
_create(container) {
    let background = new Graphics();
    background.beginFill(0x000000);
    background.lineStyle(1, 0xffff00, 0.8);
    background.drawRect(0, 0, this.model.width+2*this.model.margin, this.model.height+2*this.model.margin);
    background.endFill();
    container.addChild(background);
    background = new Graphics();
    background.beginFill(0x000000);
    background.lineStyle(1, 0xffff00, 0.8);
    background.drawRect(this.model.margin, this.model.margin, this.model.width, this.model.height);
    background.endFill();
    container.addChild(background);
  }

pixi

Super fast 2D rendering engine for browserify, that uses WebGL with a context 2d fallback.

MIT
Latest version published 9 years ago

Package Health Score

45 / 100
Full package analysis