INNER CODE UNIT · JavaScript

Promise

shixiangxi0/Cobweb · clients/phaser/src/main.js:36

  await new Promise((resolve, reject) => {
    const script = document.createElement('script');
    script.src = './vendor/dragonBones.js';
    script.async = true;
    script.onload = () => resolve();
    script.onerror = () => reject(new Error('Failed to load DragonBones runtime.'));
    document.head.appendChild(script);
  });

  return globalThis.dragonBones?.phaser?.plugin?.DragonBonesScenePlugin ?? null;
}

const deviceResolution = resolveDeviceResolution();
installDefaultTextResolution(deviceResolution);
const dragonBonesScenePlugin = await loadDragonBonesScenePlugin();

if (typeof window !== 'undefined') {
  window.__battleHelp = [

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…