UNPKG

@drincs/pixi-vn

Version:

Pixi'VN is a npm package that provides various features for creating visual novels.

1 lines 844 B
var r;(o=>(o.log=(t,...a)=>console.log(`[Pixi\u2019VN] ${t}`,...a),o.warn=(t,...a)=>console.warn(`[Pixi\u2019VN] ${t}`,...a),o.error=(t,...a)=>console.error(`[Pixi\u2019VN] ${t}`,...a),o.info=(t,...a)=>console.info(`[Pixi\u2019VN] ${t}`,...a)))(r||={});var m={};function s(n){try{let e=m[n];if(!e){r.error(`CanvasElement ${n} not found, did you forget to register it with the canvasComponentDecorator?`);return}return new e,e}catch(e){r.error(`Error while getting CanvasElement ${n}`,e);return}}async function x(n){let e=p(n.pixivnId);if(e)await e.setMemory(n);else throw new Error("[Pixi\u2019VN] The element "+n.pixivnId+" could not be created");return e}function p(n){try{let e=s(n);return e?new e:void 0}catch(e){r.error(`Error while getting CanvasElement ${n}`,e);return}}export{p as getCanvasElementInstanceById,x as importCanvasElement};