native_require.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. var manifest = JSON.parse(egret_native.readFileSync("manifest.json"));
  2. var game_file_list = manifest.initial.concat(manifest.game);
  3. var window = this;
  4. egret_native.setSearchPaths([""]);
  5. egret_native.requireFiles = function () {
  6. for (var key in game_file_list) {
  7. var src = game_file_list[key];
  8. require(src);
  9. }
  10. };
  11. egret_native.egretInit = function () {
  12. if(egret_native.featureEnable) {
  13. //控制一些优化方案是否开启
  14. //Control whether some optimization options are open
  15. var result = egret_native.featureEnable({
  16. });
  17. }
  18. egret_native.requireFiles();
  19. egret.dom = {};
  20. egret.dom.drawAsCanvas = function () {
  21. };
  22. };
  23. egret_native.egretStart = function () {
  24. var option = {
  25. //以下为自动修改,请勿修改
  26. //The following is automatically modified, please do not modify
  27. //----auto option start----
  28. entryClassName: "Main",
  29. frameRate: 60,
  30. scaleMode: "showAll",
  31. contentWidth: 988,
  32. contentHeight: 718,
  33. showPaintRect: false,
  34. showFPS: true,
  35. fpsStyles: "x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9",
  36. showLog: false,
  37. logFilter: "",
  38. maxTouches: 2,
  39. textureScaleFactor: 1
  40. //----auto option end----
  41. };
  42. egret.native.NativePlayer.option = option;
  43. egret.runEgret();
  44. egret_native.Label.createLabel("/system/fonts/DroidSansFallback.ttf", 20, "", 0);
  45. egret_native.EGTView.preSetOffScreenBufferEnable(true);
  46. };