common-game
Advanced tools
Comparing version 0.0.25 to 0.0.26
{ | ||
"name": "common-game", | ||
"version": "0.0.25", | ||
"version": "0.0.26", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "common-game.js", |
@@ -51,2 +51,6 @@ import * as PIXI from "@tbminiapp/pixi-miniprogram-engine"; | ||
let base1 = Object.assign({ left: 0, top: 0, right: 0, bottom: 0 }, sprite1.imgObj.bound); | ||
base1.left *= sprite1.scale.x; | ||
base1.right *= sprite1.scale.x; | ||
base1.top *= sprite1.scale.y; | ||
base1.bottom *= sprite1.scale.y; | ||
let temp1 = { left: bounds1.x + base1.left, top: bounds1.y + base1.top, right: bounds1.x + bounds1.width - base1.right, bottom: bounds1.y + bounds1.height - base1.bottom }; | ||
@@ -57,2 +61,6 @@ let w1 = temp1.right - temp1.left, h1 = temp1.bottom - temp1.top; | ||
let base2 = Object.assign({ left: 0, top: 0, right: 0, bottom: 0 }, sprite2.imgObj.bound); | ||
base2.left *= sprite2.scale.x; | ||
base2.right *= sprite2.scale.x; | ||
base2.top *= sprite2.scale.y; | ||
base2.bottom *= sprite2.scale.y; | ||
let temp2 = { left: bounds2.x + base2.left, top: bounds2.y + base2.top, right: bounds2.x + bounds2.width - base2.right, bottom: bounds2.y + bounds2.height - base2.bottom }; | ||
@@ -239,8 +247,8 @@ let w2 = temp2.right - temp2.left, h2 = temp2.bottom - temp2.top; | ||
if (!texture) { console.log(`Please load the ${source} texture into the cache.`); } else { | ||
imageFrame = new PIXI.Graphics(); | ||
imageFrame.beginFill(0xff0000, 0); | ||
imageFrame.drawRect(x, y, width, height); | ||
imageFrame.endFill(); | ||
// imageFrame = new PIXI.Graphics(); | ||
// imageFrame.beginFill(0xff0000, 0); | ||
// imageFrame.drawRect(x, y, width, height); | ||
// imageFrame.endFill(); | ||
// imageFrame = new PIXI.Rectangle(x, y, width, height); | ||
imageFrame = new PIXI.Rectangle(x, y, width, height); | ||
texture.frame = imageFrame; | ||
@@ -247,0 +255,0 @@ return texture; |
46773
1324