Comparing version 1.0.0 to 1.0.1
17
index.js
@@ -37,2 +37,8 @@ let PIX = null; | ||
scale: (raw, object) => Object.assign(object.scale, raw.scale), | ||
rectProps: (raw, object) => { | ||
const [x, y, w, h, color, alpha] = raw.rectProps.split(',').map((v) => Number(v)); | ||
object.beginFill(color, alpha); | ||
object.drawRect(x, y, w, h); | ||
}, | ||
}; | ||
@@ -52,3 +58,10 @@ | ||
const props = Object.keys(raw); | ||
const object = new PIX[raw.type](); | ||
let object; | ||
if (raw.type === 'NineSlicePlane') { | ||
object = new PIX.NineSlicePlane(PIXI.Texture.from(raw.texture)); | ||
} else { | ||
object = new PIX[raw.type](); | ||
} | ||
layout[name] = object; | ||
@@ -71,2 +84,2 @@ | ||
module.exports = {populate, init}; | ||
module.exports = { populate, init }; |
{ | ||
"name": "krot-pixi", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Extension for pixi-5 app, to support layouts generated by visual editor - KROT", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
4352
63