Label cache mode BITMAP

I have a sprite node. In sprite node , i add a label whose cache mode is set to be bitmap. Why does this node need 2 draw call when rendering ? I thought it only needs 1 draw call

Hi, if it is in the Chrome preview, 2 drawcall is normal, because the drawing of profiler information is also regarded as 1 drawcall.

@cary If including profiller drawing, then up to 3 drawcall . Here is example code issue.zip (918.8 KB)

Thank you for your feedback. The space of the dynamic atlas is limited. In order to be able to use it effectively, the size of textures that can be combined is limited. The default maximum value of width and height is 512 * 512. The texture size in the demo is 631 * 88, so It has not been merged in. If you still want to use such a large size texture, you can modify the maxFrameSize of the dynamic atlas. The code example is as follows, and you need to declare it in your startup file.

cc.dynamicAtlasManager.maxFrameSize = 1024;

what is startup file ? Do you mean main.js ? @cary

Yeah, or the first loaded script file.

@cary , how do i test in local ? Local don’t have main.js

@hungpro849 You need to build first, and then the main.js will be generated here:

image

Is this a correct place?
Can we replace/update main.js via hot-update?

What about web build where should we modify?

I would be happy to ask her for you @StudioAMK Stay tuned!

Hi, in native platform, it cant be replace/update, this file local in hot update path, this path wasn’t add to search path when engine start, so the main.js would not be the new one. In web browser platform, the entry file is build/web-mobile/index.js, just enable MD5 cache on build panel, it alway the new one.

1 Like

Thanks for your reply :slight_smile:

What about we modify at application.js like the following:
(which we can hotupdate easily, otherwise we will have to build apk and ask users to download)


  function initializeGame(cc, settings, findCanvas) {
    if (settings.macros) {
      for (let key in settings.macros) {
        cc.macro[key] = settings.macros[key];
      }
    }

    cc.macro.CLEANUP_IMAGE_CACHE = false;
    cc.dynamicAtlasManager.enabled = true;
    cc.dynamicAtlasManager.maxFrameSize = 1024;

    const gameOptions = getGameOptions(cc, settings, findCanvas);
    return Promise.resolve(cc.game.init(gameOptions));
  }

Yes, it’s OK.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.