Socket
Book a DemoInstallSign in
Socket

ccresloadermod

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ccresloadermod

CCResLoaderMod

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

CocosResLoader

CocosResLoader is a module that overrides default preloader function in the cocos2djs opensrc library. It has the following functions:

  • Lazy loading of resources to split out the loading large resource libraries
  • Easy customization of loading scene and loading bar
  • Load with loading bar animation or none(for quick loads)

#Setup

  • Download the project
  • Create a reference to Resloader/ResLoader.js in your project.json list (under "jsList").

Resloader source files are compiled using browserify + uglify into Resloader/ResLoader.js. ResLoader() is an object that is added to the window. Simply replace the preloader scene in main.js with:

var resLoader = new winodw.ResLoader();
var resView = resLoaderTwo.ctrl.view;

cc.director.runScene(resView);


var logoLayer = new LogoLayer();
resView.addChild(logoLayer);
resView.loadingBar = logoLayer.loadingBar;

resLoader.loadResources.call(
  resloader,
  "Init", //key to avoid reloading same resources
  load_resources, //resources you want to load
  true, //set to false if you don't want to show anything during load process, a black sreen will show up
  function(){
    //your code
  }
)

Note that for native devices, ResLoader will simply exit since preloading is not required for mobile devices.

FAQs

Package last updated on 22 Dec 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.