UNPKG

starling-framework

Version:

A fast, productive library for 2D cross-platform development.

1,385 lines (1,277 loc) 1.07 MB
/*! * Starling Framework v2.5.1 * https://gamua.com/starling/ * * Copyright Gamua * Released under the Simplified BSD license */ (function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(require("openfl/errors/ArgumentError"), require("openfl/errors/Error"), require("openfl/geom/Rectangle"), require("openfl/geom/Point"), require("openfl/geom/Matrix"), require("openfl/utils/ByteArray"), require("openfl/geom/Matrix3D"), require("openfl/geom/Vector3D"), require("openfl/errors/IllegalOperationError"), require("openfl/display/BitmapData"), require("openfl/Vector"), require("openfl/media/Sound"), require("openfl/Lib"), require("openfl/text/TextFormat"), require("openfl/system/Capabilities"), require("openfl/errors/RangeError"), require("openfl/display/Bitmap"), require("openfl/ui/Mouse"), require("openfl/net/URLRequest"), require("openfl/display/Shape"), require("openfl/text/TextField"), require("openfl/events/Event"), require("openfl/net/URLLoader"), require("openfl/display/Loader"), require("openfl/system/LoaderContext"), require("openfl/display/Stage"), require("openfl/events/MouseEvent"), require("openfl/events/TouchEvent"), require("openfl/display3D/Context3D"), require("openfl/text/Font"), require("openfl/system/System"), require("openfl/display3D/textures/Texture"), require("openfl/display3D/textures/RectangleTexture"), require("openfl/display3D/textures/VideoTexture"), require("openfl/utils/AGALMiniAssembler"), require("openfl/errors/EOFError"), require("openfl/display/DisplayObjectContainer"), require("openfl/ui/Multitouch"), require("openfl/display/Sprite")); else if(typeof define === 'function' && define.amd) define(["openfl/errors/ArgumentError", "openfl/errors/Error", "openfl/geom/Rectangle", "openfl/geom/Point", "openfl/geom/Matrix", "openfl/utils/ByteArray", "openfl/geom/Matrix3D", "openfl/geom/Vector3D", "openfl/errors/IllegalOperationError", "openfl/display/BitmapData", "openfl/Vector", "openfl/media/Sound", "openfl/Lib", "openfl/text/TextFormat", "openfl/system/Capabilities", "openfl/errors/RangeError", "openfl/display/Bitmap", "openfl/ui/Mouse", "openfl/net/URLRequest", "openfl/display/Shape", "openfl/text/TextField", "openfl/events/Event", "openfl/net/URLLoader", "openfl/display/Loader", "openfl/system/LoaderContext", "openfl/display/Stage", "openfl/events/MouseEvent", "openfl/events/TouchEvent", "openfl/display3D/Context3D", "openfl/text/Font", "openfl/system/System", "openfl/display3D/textures/Texture", "openfl/display3D/textures/RectangleTexture", "openfl/display3D/textures/VideoTexture", "openfl/utils/AGALMiniAssembler", "openfl/errors/EOFError", "openfl/display/DisplayObjectContainer", "openfl/ui/Multitouch", "openfl/display/Sprite"], factory); else if(typeof exports === 'object') exports["starling"] = factory(require("openfl/errors/ArgumentError"), require("openfl/errors/Error"), require("openfl/geom/Rectangle"), require("openfl/geom/Point"), require("openfl/geom/Matrix"), require("openfl/utils/ByteArray"), require("openfl/geom/Matrix3D"), require("openfl/geom/Vector3D"), require("openfl/errors/IllegalOperationError"), require("openfl/display/BitmapData"), require("openfl/Vector"), require("openfl/media/Sound"), require("openfl/Lib"), require("openfl/text/TextFormat"), require("openfl/system/Capabilities"), require("openfl/errors/RangeError"), require("openfl/display/Bitmap"), require("openfl/ui/Mouse"), require("openfl/net/URLRequest"), require("openfl/display/Shape"), require("openfl/text/TextField"), require("openfl/events/Event"), require("openfl/net/URLLoader"), require("openfl/display/Loader"), require("openfl/system/LoaderContext"), require("openfl/display/Stage"), require("openfl/events/MouseEvent"), require("openfl/events/TouchEvent"), require("openfl/display3D/Context3D"), require("openfl/text/Font"), require("openfl/system/System"), require("openfl/display3D/textures/Texture"), require("openfl/display3D/textures/RectangleTexture"), require("openfl/display3D/textures/VideoTexture"), require("openfl/utils/AGALMiniAssembler"), require("openfl/errors/EOFError"), require("openfl/display/DisplayObjectContainer"), require("openfl/ui/Multitouch"), require("openfl/display/Sprite")); else root["starling"] = factory(root["openfl"]["errors"]["ArgumentError"], root["openfl"]["errors"]["Error"], root["openfl"]["geom"]["Rectangle"], root["openfl"]["geom"]["Point"], root["openfl"]["geom"]["Matrix"], root["openfl"]["utils"]["ByteArray"], root["openfl"]["geom"]["Matrix3D"], root["openfl"]["geom"]["Vector3D"], root["openfl"]["errors"]["IllegalOperationError"], root["openfl"]["display"]["BitmapData"], root["openfl"]["Vector"], root["openfl"]["media"]["Sound"], root["openfl"]["Lib"], root["openfl"]["text"]["TextFormat"], root["openfl"]["system"]["Capabilities"], root["openfl"]["errors"]["RangeError"], root["openfl"]["display"]["Bitmap"], root["openfl"]["ui"]["Mouse"], root["openfl"]["net"]["URLRequest"], root["openfl"]["display"]["Shape"], root["openfl"]["text"]["TextField"], root["openfl"]["events"]["Event"], root["openfl"]["net"]["URLLoader"], root["openfl"]["display"]["Loader"], root["openfl"]["system"]["LoaderContext"], root["openfl"]["display"]["Stage"], root["openfl"]["events"]["MouseEvent"], root["openfl"]["events"]["TouchEvent"], root["openfl"]["display3D"]["Context3D"], root["openfl"]["text"]["Font"], root["openfl"]["system"]["System"], root["openfl"]["display3D"]["textures"]["Texture"], root["openfl"]["display3D"]["textures"]["RectangleTexture"], root["openfl"]["display3D"]["textures"]["VideoTexture"], root["openfl"]["utils"]["AGALMiniAssembler"], root["openfl"]["errors"]["EOFError"], root["openfl"]["display"]["DisplayObjectContainer"], root["openfl"]["ui"]["Multitouch"], root["openfl"]["display"]["Sprite"]); })(typeof self !== 'undefined' ? self : this, function(__WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_11__, __WEBPACK_EXTERNAL_MODULE_13__, __WEBPACK_EXTERNAL_MODULE_14__, __WEBPACK_EXTERNAL_MODULE_17__, __WEBPACK_EXTERNAL_MODULE_20__, __WEBPACK_EXTERNAL_MODULE_24__, __WEBPACK_EXTERNAL_MODULE_27__, __WEBPACK_EXTERNAL_MODULE_39__, __WEBPACK_EXTERNAL_MODULE_44__, __WEBPACK_EXTERNAL_MODULE_60__, __WEBPACK_EXTERNAL_MODULE_71__, __WEBPACK_EXTERNAL_MODULE_75__, __WEBPACK_EXTERNAL_MODULE_76__, __WEBPACK_EXTERNAL_MODULE_77__, __WEBPACK_EXTERNAL_MODULE_78__, __WEBPACK_EXTERNAL_MODULE_81__, __WEBPACK_EXTERNAL_MODULE_90__, __WEBPACK_EXTERNAL_MODULE_91__, __WEBPACK_EXTERNAL_MODULE_102__, __WEBPACK_EXTERNAL_MODULE_103__, __WEBPACK_EXTERNAL_MODULE_107__, __WEBPACK_EXTERNAL_MODULE_140__, __WEBPACK_EXTERNAL_MODULE_142__, __WEBPACK_EXTERNAL_MODULE_143__, __WEBPACK_EXTERNAL_MODULE_264__, __WEBPACK_EXTERNAL_MODULE_265__, __WEBPACK_EXTERNAL_MODULE_266__, __WEBPACK_EXTERNAL_MODULE_267__, __WEBPACK_EXTERNAL_MODULE_268__, __WEBPACK_EXTERNAL_MODULE_269__, __WEBPACK_EXTERNAL_MODULE_273__, __WEBPACK_EXTERNAL_MODULE_275__, __WEBPACK_EXTERNAL_MODULE_277__, __WEBPACK_EXTERNAL_MODULE_279__, __WEBPACK_EXTERNAL_MODULE_280__, __WEBPACK_EXTERNAL_MODULE_285__, __WEBPACK_EXTERNAL_MODULE_286__, __WEBPACK_EXTERNAL_MODULE_287__) { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = 256); /******/ }) /************************************************************************/ /******/ ([ /* 0 */ /***/ (function(module, exports) { var g; // This works in non-strict mode g = (function() { return this; })(); try { // This works if eval is allowed (see CSP) g = g || Function("return this")() || (1,eval)("this"); } catch(e) { // This works if the window reference is available if(typeof window === "object") g = window; } // g can still be undefined, but nothing to do about it... // We return undefined, instead of nothing here, so it's // easier to handle this case. if(!global) { ...} module.exports = g; /***/ }), /* 1 */ /***/ (function(module, exports) { Object.defineProperty(exports, "__esModule", {value: true}); exports.default = { Enum: {} }; /***/ }), /* 2 */ /***/ (function(module, exports) { Object.defineProperty(exports, "__esModule", {value: true}); // exports.default = function $import(obj) { // if(obj && obj.__esModule) { // // if(!obj.hasOwnProperty('default')) obj.default = obj; // return obj; // } else { // var newObj = {}; // if (obj != null) { // for (var key in obj) { // if (Object.prototype.hasOwnProperty.call(obj, key)) // newObj[key] = obj[key]; // } // } // newObj.default = obj; // return newObj; // } // } exports.default = function $import(obj) { return obj && obj.__esModule ? obj : {default: obj}; } /***/ }), /* 3 */ /***/ (function(module, exports) { Object.defineProperty(exports, "__esModule", {value: true}); exports.default = function $extend(from, fields) { function Inherit() {}; Inherit.prototype = from; var proto = new Inherit(); for (var name in fields) proto[name] = fields[name]; if(fields.toString !== Object.prototype.toString) proto.toString = fields.toString; return proto; }; /***/ }), /* 4 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// Class: js._Boot.HaxeError var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = __webpack_require__(1).default; var $import = __webpack_require__(2).default; var $extend = __webpack_require__(3).default; // Constructor var HaxeError = function(val) { Error.call(this); this.val = val; this.message = String(val); if(Error.captureStackTrace) { Error.captureStackTrace(this,HaxeError); } } // Meta HaxeError.__name__ = ["js","_Boot","HaxeError"]; HaxeError.__super__ = Error; HaxeError.prototype = $extend(Error.prototype, { }); HaxeError.prototype.__class__ = HaxeError.prototype.constructor = $hxClasses["js._Boot.HaxeError"] = HaxeError; // Init // Statics HaxeError.wrap = function(val) { if((val instanceof Error)) { return val; } else { return new HaxeError(val); } } // Export exports.default = HaxeError; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), /* 5 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// Class: Std var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = __webpack_require__(1).default; var $import = __webpack_require__(2).default; function js_Boot() {return __webpack_require__(8);} function HxOverrides() {return __webpack_require__(15);} // Constructor var Std = function(){} // Meta Std.__name__ = ["Std"]; Std.prototype = { }; Std.prototype.__class__ = Std.prototype.constructor = $hxClasses["Std"] = Std; // Init { String.prototype.__class__ = $hxClasses["String"] = String String.__name__ = ["String"]; $hxClasses["Array"] = Array Array.__name__ = ["Array"]; Date.prototype.__class__ = $hxClasses["Date"] = Date; Date.__name__ = ["Date"]; var Int = $hxClasses["Int"] = { __name__ : ["Int"]}; var Dynamic = $hxClasses["Dynamic"] = { __name__ : ["Dynamic"]}; var Float = $hxClasses["Float"] = Number; Float.__name__ = ["Float"]; var Bool = $hxClasses["Bool"] = Boolean; Bool.__ename__ = ["Bool"]; var Class = $hxClasses["Class"] = { __name__ : ["Class"]}; var Enum = { }; var Void = $hxClasses["Void"] = { __ename__ : ["Void"]}; }; // Statics Std.is = function(v,t) { return (js_Boot().default).__instanceof(v,t); } Std.instance = function(value,c) { if((value instanceof c)) { return value; } else { return null; } } Std.string = function(s) { return (js_Boot().default).__string_rec(s,""); } Std.int = function(x) { return x | 0; } Std.parseInt = function(x) { var v = parseInt(x,10); if(v == 0 && ((HxOverrides().default).cca(x,1) == 120 || (HxOverrides().default).cca(x,1) == 88)) { v = parseInt(x); } if(isNaN(v)) { return null; } return v; } Std.parseFloat = function(x) { return parseFloat(x); } Std.random = function(x) { if(x <= 0) { return 0; } else { return Math.floor(Math.random() * x); } } // Export exports.default = Std; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), /* 6 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// Class: openfl._Vector.Vector_Impl_ var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = __webpack_require__(1).default; var $import = __webpack_require__(2).default; function openfl_VectorData() {return $import(__webpack_require__(60));} function openfl__$Vector_VectorIterator() {return __webpack_require__(261);} function Std() {return __webpack_require__(5);} // Constructor var Vector_Impl_ = function(){} // Meta Vector_Impl_.__name__ = ["openfl","_Vector","Vector_Impl_"]; Vector_Impl_.prototype = { }; Vector_Impl_.prototype.__class__ = Vector_Impl_.prototype.constructor = $hxClasses["openfl._Vector.Vector_Impl_"] = Vector_Impl_; // Init // Statics Vector_Impl_._new = function(length,fixed,array) { var this1; if(array != null) { this1 = (openfl_VectorData().default).ofArray(array); } else { this1 = new (openfl_VectorData().default)(length,fixed); } return this1; } Vector_Impl_.concat = function(this1,a) { return (openfl_VectorData().default).ofArray(Array.prototype.concat.call(this1,a)); } Vector_Impl_.copy = function(this1) { return (openfl_VectorData().default).ofArray(this1); } Vector_Impl_.get = function(this1,index) { return this1[index]; } Vector_Impl_.indexOf = function(this1,x,from) { if(from == null) { from = 0; } return Array.prototype.indexOf.call(this1,x,from); } Vector_Impl_.insertAt = function(this1,index,element) { if(!this1.fixed || index < this1.length) { Array.prototype.splice.call(this1,index,0,element); } } Vector_Impl_.iterator = function(this1) { return new (openfl__$Vector_VectorIterator().default)(this1); } Vector_Impl_.join = function(this1,sep) { if(sep == null) { sep = ","; } return Array.prototype.join.call(this1,sep); } Vector_Impl_.lastIndexOf = function(this1,x,from) { if(from == null) { return Array.prototype.lastIndexOf.call(this1,x); } else { return Array.prototype.lastIndexOf.call(this1,x,from); } } Vector_Impl_.pop = function(this1) { if(!this1.fixed) { return Array.prototype.pop.call(this1); } else { return null; } } Vector_Impl_.push = function(this1,x) { if(!this1.fixed) { return Array.prototype.push.call(this1,x); } else { return this.length; } } Vector_Impl_.removeAt = function(this1,index) { if(!this1.fixed || index < this1.length) { return Array.prototype.splice.call(this1,index,1)[0]; } return null; } Vector_Impl_.reverse = function(this1) { return Array.prototype.reverse.call(this1); } Vector_Impl_.set = function(this1,index,value) { if(!this1.fixed || index < this1.length) { return this1[index] = value; } else { return value; } } Vector_Impl_.shift = function(this1) { if(!this1.fixed) { return Array.prototype.shift.call(this1); } else { return null; } } Vector_Impl_.slice = function(this1,startIndex,endIndex) { if(endIndex == null) { endIndex = 16777215; } if(startIndex == null) { startIndex = 0; } return (openfl_VectorData().default).ofArray(Array.prototype.slice.call(this1,startIndex,endIndex)); } Vector_Impl_.sort = function(this1,f) { Array.prototype.sort.call(this1,f); } Vector_Impl_.splice = function(this1,pos,len) { return (openfl_VectorData().default).ofArray(Array.prototype.splice.call(this1,pos,len)); } Vector_Impl_.toString = function(this1) { if(this1 != null) { return (Std().default).string(this1); } else { return null; } } Vector_Impl_.unshift = function(this1,x) { if(!this1.fixed) { Array.prototype.unshift.call(this1,x); } } Vector_Impl_.ofArray = function(a) { return (openfl_VectorData().default).ofArray(a); } Vector_Impl_.convert = function(v) { return v; } Vector_Impl_.get_fixed = function(this1) { return this1.fixed; } Vector_Impl_.set_fixed = function(this1,value) { return this1.fixed = value; } Vector_Impl_.get_length = function(this1) { return this1.length; } Vector_Impl_.set_length = function(this1,value) { return this1.length = value; } // Export exports.default = Vector_Impl_; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), /* 7 */ /***/ (function(module, exports) { module.exports = __WEBPACK_EXTERNAL_MODULE_7__; /***/ }), /* 8 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// Class: js.Boot var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = __webpack_require__(1).default; var $import = __webpack_require__(2).default; function js__$Boot_HaxeError() {return __webpack_require__(4);} function Std() {return __webpack_require__(5);} // Constructor var Boot = function(){} // Meta Boot.__name__ = ["js","Boot"]; Boot.prototype = { }; Boot.prototype.__class__ = Boot.prototype.constructor = $hxClasses["js.Boot"] = Boot; // Init // Statics Boot.__unhtml = function(s) { return s.split("&").join("&amp;").split("<").join("&lt;").split(">").join("&gt;"); } Boot.__trace = function(v,i) { var msg = i != null ? i.fileName + ":" + i.lineNumber + ": " : ""; msg += Boot.__string_rec(v,""); if(i != null && i.customParams != null) { var _g = 0; var _g1 = i.customParams; while(_g < _g1.length) { var v1 = _g1[_g]; ++_g; msg += "," + Boot.__string_rec(v1,""); } } var d; var tmp; if(typeof(document) != "undefined") { d = document.getElementById("haxe:trace"); tmp = d != null; } else { tmp = false; } if(tmp) { d.innerHTML += Boot.__unhtml(msg) + "<br/>"; } else if(typeof console != "undefined" && console.log != null) { console.log(msg); } } Boot.__clear_trace = function() { var d = document.getElementById("haxe:trace"); if(d != null) { d.innerHTML = ""; } } Boot.isClass = function(o) { return o.__name__; } Boot.isEnum = function(e) { return e.__ename__; } Boot.getClass = function(o) { if((o instanceof Array) && o.__enum__ == null) { return Array } else { var cl = o.__class__; if(cl != null) { return cl; } var name = Boot.__nativeClassName(o); if(name != null) { return Boot.__resolveNativeClass(name); } return null; } } Boot.__string_rec = function(o,s) { if(o == null) { return "null"; } if(s.length >= 5) { return "<...>"; } var t = typeof(o); if(t == "function" && (Boot.isClass(o) || Boot.isEnum(o))) { t = "object"; } switch(t) { case "function": return "<function>"; case "object": if(o instanceof Array) { if(o.__enum__) { if(o.length == 2) { return o[0]; } var str = o[0] + "("; s += "\t"; var _g1 = 2; var _g = o.length; while(_g1 < _g) { var i = _g1++; if(i != 2) { str += "," + Boot.__string_rec(o[i],s); } else { str += Boot.__string_rec(o[i],s); } } return str + ")"; } var l = o.length; var i1; var str1 = "["; s += "\t"; var _g11 = 0; var _g2 = l; while(_g11 < _g2) { var i2 = _g11++; str1 += (i2 > 0 ? "," : "") + Boot.__string_rec(o[i2],s); } str1 += "]"; return str1; } var tostr; try { tostr = o.toString; } catch( e ) { return "???"; } if(tostr != null && tostr != Object.toString && typeof(tostr) == "function") { var s2 = o.toString(); if(s2 != "[object Object]") { return s2; } } var k = null; var str2 = "{\n"; s += "\t"; var hasp = o.hasOwnProperty != null; for( var k in o ) { if(hasp && !o.hasOwnProperty(k)) { continue; } if(k == "prototype" || k == "__class__" || k == "__super__" || k == "__interfaces__" || k == "__properties__") { continue; } if(str2.length != 2) { str2 += ", \n"; } str2 += s + k + " : " + Boot.__string_rec(o[k],s); } s = s.substring(1); str2 += "\n" + s + "}"; return str2; case "string": return o; default: return String(o); } } Boot.__interfLoop = function(cc,cl) { if(cc == null) { return false; } if(cc == cl) { return true; } var intf = cc.__interfaces__; if(intf != null) { var _g1 = 0; var _g = intf.length; while(_g1 < _g) { var i = _g1++; var i1 = intf[i]; if(i1 == cl || Boot.__interfLoop(i1,cl)) { return true; } } } return Boot.__interfLoop(cc.__super__,cl); } Boot.__instanceof = function(o,cl) { if(cl == null) { return false; } switch(cl) { case Array: if((o instanceof Array)) { return o.__enum__ == null; } else { return false; } break; case $hxClasses["Bool"]: return typeof(o) == "boolean"; case $hxClasses["Dynamic"]: return true; case $hxClasses["Float"]: return typeof(o) == "number"; case $hxClasses["Int"]: if(typeof(o) == "number") { return (o|0) === o; } else { return false; } break; case String: return typeof(o) == "string"; default: if(o != null) { if(typeof(cl) == "function") { if(o instanceof cl) { return true; } if(Boot.__interfLoop(Boot.getClass(o),cl)) { return true; } } else if(typeof(cl) == "object" && Boot.__isNativeObj(cl)) { if(o instanceof cl) { return true; } } } else { return false; } if(cl == $hxClasses["Class"] ? o.__name__ != null : false) { return true; } if(cl == $hxClasses["Enum"] ? o.__ename__ != null : false) { return true; } return o.__enum__ == cl; } } Boot.__cast = function(o,t) { if(Boot.__instanceof(o,t)) { return o; } else { throw new (js__$Boot_HaxeError().default)("Cannot cast " + (Std().default).string(o) + " to " + (Std().default).string(t)); } } Boot.__nativeClassName = function(o) { var name = Boot.__toStr.call(o).slice(8,-1); if(name == "Object" || name == "Function" || name == "Math" || name == "JSON") { return null; } return name; } Boot.__isNativeObj = function(o) { return Boot.__nativeClassName(o) != null; } Boot.__resolveNativeClass = function(name) { return $global[name]; } Boot.__toStr = ({ }).toString // Export exports.default = Boot; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(0))) /***/ }), /* 9 */ /***/ (function(module, exports, __webpack_require__) { /* WEBPACK VAR INJECTION */(function(global) {// Class: starling.core.Starling var $global = typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : this $global.Object.defineProperty(exports, "__esModule", {value: true}); var __map_reserved = {}; // Imports var $hxClasses = __webpack_require__(1).default; var $import = __webpack_require__(2).default; var $bind = __webpack_require__(10).default; var $extend = __webpack_require__(3).default; function starling_events_EventDispatcher() {return __webpack_require__(21);} function openfl__$Vector_Vector_$Impl_$() {return __webpack_require__(6);} function openfl_Lib() {return $import(__webpack_require__(75));} function Type() {return __webpack_require__(19);} function Std() {return __webpack_require__(5);} function starling_display_DisplayObject() {return __webpack_require__(48);} function js__$Boot_HaxeError() {return __webpack_require__(4);} function openfl_errors_Error() {return $import(__webpack_require__(11));} function starling_utils_Color() {return __webpack_require__(32);} function starling_utils_RectangleUtil() {return __webpack_require__(28);} function starling_utils_Pool() {return __webpack_require__(26);} function openfl_display_Shape() {return $import(__webpack_require__(102));} function openfl_text_TextField() {return $import(__webpack_require__(103));} function openfl_text_TextFormat() {return $import(__webpack_require__(76));} function haxe_Log() {return __webpack_require__(29);} function openfl_system_Capabilities() {return $import(__webpack_require__(77));} function haxe_Timer() {return __webpack_require__(49);} function starling_events_KeyboardEvent() {return __webpack_require__(104);} function js_Boot() {return __webpack_require__(8);} function openfl_display_Stage() {return $import(__webpack_require__(264));} function starling_events_ResizeEvent() {return __webpack_require__(105);} function openfl_events_MouseEvent() {return $import(__webpack_require__(265));} function openfl_events_TouchEvent() {return $import(__webpack_require__(266));} function starling_utils_MatrixUtil() {return __webpack_require__(18);} function Reflect() {return __webpack_require__(16);} function starling_utils_SystemUtil() {return __webpack_require__(34);} function starling_core_StatsDisplay() {return __webpack_require__(106);} function openfl_errors_ArgumentError() {return $import(__webpack_require__(7));} function openfl_display_DisplayObjectContainer() {return $import(__webpack_require__(285));} function openfl_ui_Multitouch() {return $import(__webpack_require__(286));} function openfl_geom_Rectangle() {return $import(__webpack_require__(13));} function starling_display_Stage() {return __webpack_require__(70);} function openfl_display_Sprite() {return $import(__webpack_require__(287));} function starling_events_TouchProcessor() {return __webpack_require__(116);} function starling_animation_Juggler() {return __webpack_require__(121);} function starling_rendering_Painter() {return __webpack_require__(124);} function openfl_ui_Mouse() {return $import(__webpack_require__(90));} // Constructor var Starling = function(rootClass,stage,viewPort,stage3D,renderMode,profile,sharedContext) { if(profile == null) { profile = "auto"; } if(renderMode == null) { renderMode = "auto"; } (starling_events_EventDispatcher().default).call(this); if(stage == null) { throw new (js__$Boot_HaxeError().default)(new (openfl_errors_ArgumentError().default)("Stage must not be null")); } if(viewPort == null) { viewPort = new (openfl_geom_Rectangle().default)(0,0,stage.stageWidth,stage.stageHeight); } if(stage3D == null) { stage3D = stage.stage3Ds[0]; } (starling_utils_SystemUtil().default).initialize(); (openfl__$Vector_Vector_$Impl_$().default).push(Starling.sAll,this); this.makeCurrent(); this.__rootClass = rootClass; this.__viewPort = viewPort; this.__previousViewPort = new (openfl_geom_Rectangle().default)(); this.__stage = new (starling_display_Stage().default)((Std().default)["int"](viewPort.width),(Std().default)["int"](viewPort.height),stage.get_color()); this.__nativeOverlay = new (openfl_display_Sprite().default)(); this.__nativeStage = stage; this.__nativeStage.addChild(this.__nativeOverlay); this.__touchProcessor = new (starling_events_TouchProcessor().default)(this.__stage); this.__touchProcessor.set_discardSystemGestures(!(starling_utils_SystemUtil().default).get_isDesktop()); this.__juggler = new (starling_animation_Juggler().default)(); this.__antiAliasing = 0; this.__supportHighResolutions = false; this.__painter = new (starling_rendering_Painter().default)(stage3D,sharedContext); this.__frameTimestamp = (openfl_Lib().default).getTimer() / 1000.0; this.__frameID = 1; this.__supportsCursor = (openfl_ui_Mouse().default).supportsCursor || (openfl_system_Capabilities().default).get_os().indexOf("Windows") == 0; this.__statsDisplayAlign = { }; this.setMultitouchEnabled((openfl_ui_Multitouch().default).inputMode == "touchPoint",true); this.__nativeOverlayBlocksTouches = true; stage.scaleMode = "noScale"; stage.align = "topLeft"; stage.addEventListener("enterFrame",$bind(this,this.onEnterFrame),false,0,true); stage.addEventListener("keyDown",$bind(this,this.onKey),false,0,true); stage.addEventListener("keyUp",$bind(this,this.onKey),false,0,true); stage.addEventListener("resize",$bind(this,this.onResize),false,0,true); stage.addEventListener("mouseLeave",$bind(this,this.onMouseLeave),false,0,true); stage.addEventListener("activate",$bind(this,this.onActivate),false,0,true); stage3D.addEventListener("context3DCreate",$bind(this,this.onContextCreated),false,10,true); stage3D.addEventListener("error",$bind(this,this.onStage3DError),false,10,true); var runtimeVersion = 26; if(runtimeVersion < 19) { var runtime = (starling_utils_SystemUtil().default).get_isAIR() ? "Adobe AIR" : "Flash Player"; this.stopWithFatalError("Your " + runtime + " installation is outdated. " + "This software requires at least version 19."); } else if(this.__painter.get_shareContext()) { (haxe_Timer().default).delay($bind(this,this.initialize),1); } else { this.__painter.requestContext3D(renderMode,profile); } } // Meta Starling.__name__ = ["starling","core","Starling"]; Starling.__super__ = (starling_events_EventDispatcher().default); Starling.prototype = $extend((starling_events_EventDispatcher().default).prototype, { dispose: function() { this.stop(true); this.__nativeStage.removeEventListener("enterFrame",$bind(this,this.onEnterFrame),false); this.__nativeStage.removeEventListener("keyDown",$bind(this,this.onKey),false); this.__nativeStage.removeEventListener("keyUp",$bind(this,this.onKey),false); this.__nativeStage.removeEventListener("resize",$bind(this,this.onResize),false); this.__nativeStage.removeEventListener("mouseLeave",$bind(this,this.onMouseLeave),false); this.__nativeStage.removeChild(this.__nativeOverlay); this.get_stage3D().removeEventListener("context3DCreate",$bind(this,this.onContextCreated),false); this.get_stage3D().removeEventListener("context3DCreate",$bind(this,this.onContextRestored),false); this.get_stage3D().removeEventListener("error",$bind(this,this.onStage3DError),false); var _g = 0; var _g1 = this.getTouchEventTypes(this.__multitouchEnabled); while(_g < _g1.length) { var touchEventType = _g1[_g]; ++_g; this.__nativeStage.removeEventListener(touchEventType,$bind(this,this.onTouch),false); } if(this.__touchProcessor != null) { this.__touchProcessor.dispose(); } if(this.__painter != null) { this.__painter.dispose(); } if(this.__stage != null) { this.__stage.dispose(); } var this1 = Starling.sAll; var index = Array.prototype.indexOf.call(this1,this,0); if(index != -1) { (openfl__$Vector_Vector_$Impl_$().default).removeAt(Starling.sAll,index); } if(Starling.sCurrent == this) { Starling.sCurrent = null; } }, initialize: function() { this.makeCurrent(); this.updateViewPort(true); this.dispatchEventWith("context3DCreate",false,this.get_context()); this.initializeRoot(); this.__frameTimestamp = (openfl_Lib().default).getTimer() / 1000.0; }, initializeRoot: function() { if(this.__root == null && this.__rootClass != null) { this.__root = (Type().default).createInstance(this.__rootClass,[]); if(this.__root == null || !(Std().default)["is"](this.__root,(starling_display_DisplayObject().default))) { throw new (js__$Boot_HaxeError().default)(new (openfl_errors_Error().default)("Invalid root class: " + (Std().default).string(this.__rootClass))); } this.__stage.addChildAt(this.__root,0); this.dispatchEventWith("rootCreated",false,this.__root); } }, nextFrame: function() { var now = (openfl_Lib().default).getTimer() / 1000.0; var passedTime = now - this.__frameTimestamp; this.__frameTimestamp = now; if(passedTime > 1.0) { passedTime = 1.0; } if(passedTime < 0.0) { passedTime = 1.0 / this.__nativeStage.get_frameRate(); } this.advanceTime(passedTime); this.render(); }, advanceTime: function(passedTime) { if(!this.get_contextValid()) { return; } this.makeCurrent(); this.__touchProcessor.advanceTime(passedTime); this.__stage.advanceTime(passedTime); this.__juggler.advanceTime(passedTime); }, render: function() { if(!this.get_contextValid()) { return; } this.makeCurrent(); this.updateViewPort(); var doRedraw = this.__stage.get_requiresRedraw() || this.get_mustAlwaysRender(); if(doRedraw) { this.dispatchEventWith("render"); var shareContext = this.__painter.get_shareContext(); var scaleX = this.__viewPort.width / this.__stage.get_stageWidth(); var scaleY = this.__viewPort.height / this.__stage.get_stageHeight(); var stageColor = this.__stage.get_color(); this.__painter.nextFrame(); this.__painter.set_pixelSize(1.0 / this.get_contentScaleFactor()); this.__painter.get_state().setProjectionMatrix(this.__viewPort.x < 0 ? -this.__viewPort.x / scaleX : 0.0,this.__viewPort.y < 0 ? -this.__viewPort.y / scaleY : 0.0,this.__clippedViewPort.width / scaleX,this.__clippedViewPort.height / scaleY,this.__stage.get_stageWidth(),this.__stage.get_stageHeight(),this.__stage.get_cameraPosition()); if(!shareContext) { this.__painter.clear(stageColor,(starling_utils_Color().default).getAlpha(stageColor)); } this.__stage.render(this.__painter); this.__painter.finishFrame(); this.__painter.set_frameID(++this.__frameID); if(!shareContext) { this.__painter.present(); } } if(this.__statsDisplay != null) { this.__statsDisplay.set_drawCount(this.__painter.get_drawCount()); if(!doRedraw) { this.__statsDisplay.markFrameAsSkipped(); } } }, updateViewPort: function(forceUpdate) { if(forceUpdate == null) { forceUpdate = false; } if(forceUpdate || !(starling_utils_RectangleUtil().default).compare(this.__viewPort,this.__previousViewPort)) { this.__previousViewPort.setTo(this.__viewPort.x,this.__viewPort.y,this.__viewPort.width,this.__viewPort.height); this.updateClippedViewPort(); this.updateStatsDisplayPosition(); var contentScaleFactor = this.__supportHighResolutions ? this.__nativeStage.get_contentsScaleFactor() : 1.0; this.__painter.configureBackBuffer(this.__clippedViewPort,contentScaleFactor,this.__antiAliasing,true,this.__supportBrowserZoom); this.setRequiresRedraw(); } }, updateClippedViewPort: function() { var stageBounds = (starling_utils_Pool().default).getRectangle(0,0,this.__nativeStage.stageWidth,this.__nativeStage.stageHeight); this.__clippedViewPort = (starling_utils_RectangleUtil().default).intersect(this.__viewPort,stageBounds,this.__clippedViewPort); if(this.__clippedViewPort.width < 32) { this.__clippedViewPort.width = 32; } if(this.__clippedViewPort.height < 32) { this.__clippedViewPort.height = 32; } (starling_utils_Pool().default).putRectangle(stageBounds); }, updateNativeOverlay: function() { this.__nativeOverlay.set_x(this.__viewPort.x); this.__nativeOverlay.set_y(this.__viewPort.y); this.__nativeOverlay.set_scaleX(this.__viewPort.width / this.__stage.get_stageWidth()); this.__nativeOverlay.set_scaleY(this.__viewPort.height / this.__stage.get_stageHeight()); }, stopWithFatalError: function(message) { var background = new (openfl_display_Shape().default)(); background.get_graphics().beginFill(0,0.8); background.get_graphics().drawRect(0,0,this.__stage.get_stageWidth(),this.__stage.get_stageHeight()); background.get_graphics().endFill(); var textField = new (openfl_text_TextField().default)(); var textFormat = new (openfl_text_TextFormat().default)("_sans",14,16777215); textFormat.align = "center"; textField.set_defaultTextFormat(textFormat); textField.set_wordWrap(true); textField.set_width(this.__stage.get_stageWidth() * 0.75); textField.set_autoSize("center"); textField.set_text(message); textField.set_x((this.__stage.get_stageWidth() - textField.get_width()) / 2); textField.set_y((this.__stage.get_stageHeight() - textField.get_height()) / 2); textField.set_background(true); textField.set_backgroundColor(5570560); this.updateNativeOverlay(); this.get_nativeOverlay().addChild(background); this.get_nativeOverlay().addChild(textField); this.stop(true); (haxe_Log().default).trace("[Starling]",{ fileName : "Starling.hx", lineNumber : 616, className : "starling.core.Starling", methodName : "stopWithFatalError", customParams : [message]}); this.dispatchEventWith("fatalError",false,message); }, makeCurrent: function() { Starling.sCurrent = this; }, start: function() { this.__started = this.__rendering = true; this.__frameTimestamp = (openfl_Lib().default).getTimer() / 1000.0; }, stop: function(suspendRendering) { if(suspendRendering == null) { suspendRendering = false; } this.__started = false; this.__rendering = !suspendRendering; }, setRequiresRedraw: function() { this.__stage.setRequiresRedraw(); }, onStage3DError: function(event) { if(event.errorID == 3702) { var mode = (openfl_system_Capabilities().default).playerType == "Desktop" ? "renderMode" : "wmode"; this.stopWithFatalError("Context3D not available! Possible reasons: wrong " + mode + " or missing device support."); } else { this.stopWithFatalError("Stage3D error: " + event.text); } }, onContextCreated: function(event) { this.get_stage3D().removeEventListener("context3DCreate",$bind(this,this.onContextCreated)); this.get_stage3D().addEventListener("context3DCreate",$bind(this,this.onContextRestored),false,10,true); (haxe_Log().default).trace("[Starling] Context ready. Display Driver: " + this.get_context().driverInfo,{ fileName : "Starling.hx", lineNumber : 682, className : "starling.core.Starling", methodName : "onContextCreated"}); this.initialize(); }, onContextRestored: function(event) { (haxe_Log().default).trace("[Starling] Context restored.",{ fileName : "Starling.hx", lineNumber : 688, className : "starling.core.Starling", methodName : "onContextRestored"}); this.updateViewPort(true); this.dispatchEventWith("context3DCreate",false,this.get_context()); }, onEnterFrame: function(event) { if(!this.__painter.get_shareContext()) { if(this.__started) { this.nextFrame(); } else if(this.__rendering) { this.render(); } } this.updateNativeOverlay(); }, onActivate: function(event) { (haxe_Timer().default).delay($bind(this,this.setRequiresRedraw),100); }, onKey: function(event) { if(!this.__started) { return; } var keyEvent = new (starling_events_KeyboardEvent().default)(event.type,event.charCode,event.keyCode,event.keyLocation,event.ctrlKey,event.altKey,event.shiftKey); this.makeCurrent(); this.__stage.dispatchEvent(keyEvent); if(keyEvent.isDefaultPrevented()) { event.preventDefault(); } }, onResize: function(event) { var _gthis = this; var stageWidth = ((js_Boot().default).__cast(event.target , (openfl_display_Stage().default))).stageWidth; var stageHeight = ((js_Boot().default).__cast(event.target , (openfl_display_Stage().default))).stageHeight; var dispatchResizeEvent = null; dispatchResizeEvent = function() { _gthis.makeCurrent(); _gthis.removeEventListener("context3DCreate",dispatchResizeEvent); _gthis.__stage.dispatchEvent(new (starling_events_ResizeEvent().default)("resize",stageWidth,stageHeight)); }; var dispatchResizeEvent1 = dispatchResizeEvent; if(this.get_contextValid()) { dispatchResizeEvent1(); } else { this.addEventListener("context3DCreate",dispatchResizeEvent1); } }, onBrowserZoomChange: function(event) { }, onMouseLeave: function(event) { this.__touchProcessor.enqueueMouseLeftStage(); }, onTouch: function(event) { if(!this.__started) { return; } var globalX; var globalY; var touchID; var phase = null; var pressure = 1.0; var width = 1.0; var height = 1.0; if((Std().default)["is"](event,(openfl_events_MouseEvent().default))) { var mouseEvent = event; globalX = mouseEvent.stageX; globalY = mouseEvent.stageY; touchID = 0; if(event.type == "mouseDown") { this.__leftMouseDown = true; } else if(event.type == "mouseUp") { this.__leftMouseDown = false; } } else { var touchEvent = (js_Boot().default).__cast(event , (openfl_events_TouchEvent().default)); if(this.__supportsCursor && touchEvent.isPrimaryTouchPoint) { return; } else { globalX = touchEvent.stageX; globalY = touchEvent.stageY; touchID = touchEvent.touchPointID; pressure = touchEvent.pressure; width = touchEvent.sizeX; height = touchEvent.sizeY; } } var _g = event.type; switch(_g) { case "mouseDown": phase = "began"; break; case "mouseMove": if(this.__leftMouseDown) { phase = "moved"; } else { phase = "hover"; } break; case "mouseUp": phase = "ended"; break; case "touchBegin": phase = "began"; break; case "touchEnd": phase = "ended"; break; case "touchMove": phase = "moved"; break; } globalX = this.__stage.get_stageWidth() * (globalX - this.__viewPort.x) / this.__viewPort.width; globalY = this.__stage.get_stageHeight() * (globalY - this.__viewPort.y) / this.__viewPort.height; this.__touchProcessor.enqueue(touchID,phase,globalX,globalY,pressure,width,height); if(event.type == "mouseUp" && this.__supportsCursor) { this.__touchProcessor.enqueue(touchID,"hover",globalX,globalY); } }, hitTestNativeOverlay: function(localX,localY) { if(this.__nativeOverlay.get_numChildren() > 0) { var globalPos = (starling_utils_Pool().default).getPoint(); var matrix = (starling_utils_Pool().default).getMatrix(this.__nativeOverlay.get_scaleX(),0,0,this.__nativeOverlay.get_scaleY(),this.__nativeOverlay.get_x(),this.__nativeOverlay.get_y()); (starling_utils_MatrixUtil().default).transformCoords(matrix,localX,localY,globalPos); var result = this.__nativeOverlay.hitTestPoint(globalPos.x,globalPos.y,true); (starling_utils_Pool().default).putPoint(globalPos); (starling_utils_Pool().default).putMatrix(matrix); return result; } return false; }, setMultitouchEnabled: function(value,forceUpdate) { if(forceUpdate == null) { forceUpdate = false; } if(forceUpdate || value != this.__multitouchEnabled) { var oldEventTypes = this.getTouchEventTypes(this.__multitouchEnabled); var newEventTypes = this.getTouchEventTypes(value); var _g = 0; while(_g < oldEventTypes.length) { var oldEventType = oldEventTypes[_g]; ++_g; this.__nativeStage.removeEventListener(oldEventType,$bind(this,this.onTouch)); } var _g1 = 0; while(_g1 < newEventTypes.length) { var newEventType = newEventTypes[_g1]; ++_g1; this.__nativeStage.addEventListener(newEventType,$bind(this,this.onTouch),false,0,true); } this.__touchProcessor.cancelTouches(); this.__multitouchEnabled = value; } }, getTouchEventTypes: function(multitouchEnabled) { var types = []; if(multitouchEnabled) { types.push("touchBegin"); types.push("touchMove"); types.push("touchEnd"); } if(!multitouchEnabled || this.__supportsCursor) { types.push("mouseDown"); types.push("mouseMove"); types.push("mouseUp"); } return types; }, get_mustAlwaysRender: function() { if(!(Reflect().default).hasField(this.__nativeStage,"context3D") || (Reflect().default).field(this.__nativeStage,"context3D") == this.get_context()) { return true; } if(!this.__skipUnchangedFrames || this.__painter.get_shareContext()) { return true; } else if((starling_utils_SystemUtil().default).get_isDesktop() && this.get_profile() != "baselineConstrained") { return false; } else { var nativeStageEmpty = this.isNativeDisplayObjectEmpty(this.__nativeStage); var mustAlwaysRender = !nativeStageEmpty || !this.__nativeStageEmpty; this.__nativeStageEmpty = nativeStageEmpty; return mustAlwaysRender; } }, get_isStarted: function() { return this.__started; }, get_juggler: function() { return this.__juggler; }, get_painter: function() { return this.__painter; }, get_context: function() { return this.__painter.get_context(); }, get_simulateMultitouch: function() { return this.__touchProcessor.get_simulateMultitouch(); }, set_simulateMultitouch: function(value) { return this.__touchProcessor.set_simulateMultitouch(value); }, get_enableErrorChecking: function() { return this.__painter.get_enableErrorChecking(); }, set_enableErrorChecking: function(value) { return this.__painter.set_enableErrorChecking(value); }, get_antiAliasing: function() { return this.__antiAliasing; }, set_antiAliasing: function(value) { if(this.__antiAliasing != value) { this.__antiAliasing = value; if(this.get_contextValid()) { this.updateViewPort(true); } } return value; }, get_viewPort: function() { return this.__viewPort; }, set_viewPort: function(value) { this.__viewPort.copyFrom(value); return value; }, get_contentScaleFactor: function() { return this.__viewPort.width * this.__painter.get_backBufferScaleFactor() / this.__stage.get_stageWidth(); }, get_nativeOverlay: function() { return this.__nativeOverlay; }, get_nativeOverlayBlocksTouches: function() { return this.__touchProcessor.get_occlusionTest() != null; }, set_nativeOverlayBlocksTouches: function(value) { if(value != this.__nativeOverlayBlocksTouches) { this.__touchProcessor.set_occlusionTest(value ? $bind(this,this.hitTestNativeOverlay) : null); } return value; }, get_showStats: function() { return this.__showStats; }, set_showStats: function(value) { this.__showStats = value; if(value) { var h = (Reflect().default).hasField(this.__statsDisplayAlign,"horizontal") ? this.__statsDisplayAlign.horizontal : null; var v = (Reflect().default).hasField(this.__statsDisplayAlign,"vertical") ? this.__statsDisplayAlign.vertical : null; this.showStatsAt(h != null ? h : "left",v != null ? v : "top"); } else if(this.__statsDisplay != null) { this.__statsDisplay.removeFromParent(); } return value; }, showStatsAt: function(horizontalAlign,verticalAlign,scale) { if(scale == null) { scale = 1; } if(verticalAlign == null) { verticalAlign = "top"; } if(horizontalAlign == null) { horizontalAlign = "left"; } var _gthis = this; var onRootCreated = null; onRootCreated = function() { if(_gthis.__showStats) { _gthis.showStatsAt(horizontalAlign,verticalAlign,scale); } _gthis.removeEventListener("rootCreated",onRootCreated); }; var onRootCreated1 = onRootCreated; this.__showStats = true; this.__statsDisplayAlign.horizontal = horizontalAlign; this.__statsDisplayAlign.vertical = verticalAlign; if(this.get_context() == null) { this.addEventListener("rootCreated",onRootCreated1); } else { if(this.__statsDisplay == null) { this.__statsDisplay = new (starling_core_StatsDisplay().default)(); this.__statsDisplay.set_touchable(false); } this.__stage.addChild(this.__statsDisplay); this.__statsDisplay.set_scaleX(this.__statsDisplay.set_scaleY(scale)); this.updateClippedViewPort(); this.updateStatsDisplayPosition(); } }, updateStatsDisplayPosition: function() { if(!this.__showStats || this.__statsDisplay == null) { return; } var horizontalAlign = this.__statsDisplayAlign.horizontal; var verticalAlign = this.__statsDisplayAlign.vertical; var scaleX = this.__viewPort.width / this.__stage.get_stageWidth(); var scaleY = this.__viewPort.height / this.__stage.get_stageHeight(); var clipping = (starling_utils_Pool().default).getRectangle(this.__viewPort.x < 0 ? -this.__viewPort.x / scaleX : 0.0,this.__viewPort.y < 0