Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
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)
}
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)
}
}
_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);
}