game-min.js 410 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553
  1. var egret; (function(b) {
  2. function c(a) {
  3. for (var e = [], k = 1; k < arguments.length; k++) e[k - 1] = arguments[k];
  4. if (k = b.egret_string_code[a]) for (var m = e.length,
  5. d = 0; d < m; d++) k = k.replace("{" + d + "}", e[d]);
  6. return k
  7. }
  8. var d = function() {
  9. function a() {}
  10. a.fatal = function(e, a) {
  11. void 0 === a && (a = null);
  12. b.Logger.traceToConsole("Fatal", e, a);
  13. throw Error(b.Logger.getTraceCode("Fatal", e, a));
  14. };
  15. a.info = function(e, a) {
  16. void 0 === a && (a = null);
  17. b.Logger.traceToConsole("Info", e, a)
  18. };
  19. a.warning = function(e, a) {
  20. void 0 === a && (a = null);
  21. b.Logger.traceToConsole("Warning", e, a)
  22. };
  23. a.fatalWithErrorId = function(e) {
  24. for (var k = [], b = 1; b < arguments.length; b++) k[b - 1] = arguments[b];
  25. k.unshift(e); (k = c.apply(null, k)) ? a.fatal(k) : a.warning(c( - 1, e))
  26. };
  27. a.infoWithErrorId = function(e) {
  28. for (var k = [], b = 1; b < arguments.length; b++) k[b - 1] = arguments[b];
  29. k.unshift(e); (k = c.apply(null, k)) ? a.info(k) : a.warning(c( - 1, e))
  30. };
  31. a.warningWithErrorId = function(e) {
  32. for (var k = [], b = 1; b < arguments.length; b++) k[b - 1] = arguments[b];
  33. k.unshift(e); (k = c.apply(null, k)) ? a.warning(k) : a.warning(c( - 1, e))
  34. };
  35. a.traceToConsole = function(e, a, m) {
  36. console.log(b.Logger.getTraceCode(e, a, m))
  37. };
  38. a.getTraceCode = function(e, a, b) {
  39. return "[" + e + "]" + a + (null == b ? "": ":" + b)
  40. };
  41. return a
  42. } ();
  43. b.Logger = d;
  44. d.prototype.__class__ = "egret.Logger";
  45. b.egret_string_code = {};
  46. b.egret_string_code[ - 1] = "\u4e0d\u5b58\u5728\u7684stringId:{0}";
  47. b.egret_string_code[1E3] = "Browser.isMobile\u63a5\u53e3\u53c2\u6570\u5df2\u7ecf\u53d8\u66f4\uff0c\u8bf7\u5c3d\u5feb\u8c03\u6574\u7528\u6cd5\u4e3a egret.MainContext.deviceType == egret.MainContext.DEVICE_MOBILE";
  48. b.egret_string_code[1001] = "\u8be5\u65b9\u6cd5\u76ee\u524d\u4e0d\u5e94\u4f20\u5165 resolutionPolicy \u53c2\u6570\uff0c\u8bf7\u5728 docs/1.0_Final_ReleaseNote\u4e2d\u67e5\u770b\u5982\u4f55\u5347\u7ea7";
  49. b.egret_string_code[1002] = "egret.Ticker\u662f\u6846\u67b6\u5185\u90e8\u4f7f\u7528\u7684\u5355\u4f8b\uff0c\u4e0d\u5141\u8bb8\u5728\u5916\u90e8\u5b9e\u4f8b\u5316\uff0c\u8ba1\u65f6\u5668\u8bf7\u4f7f\u7528egret.Timer\u7c7b\uff01";
  50. b.egret_string_code[1003] = "Ticker#setTimeout\u65b9\u6cd5\u5373\u5c06\u5e9f\u5f03,\u8bf7\u4f7f\u7528egret.setTimeout";
  51. b.egret_string_code[1004] = "ExternalInterface\u8c03\u7528\u4e86js\u6ca1\u6709\u6ce8\u518c\u7684\u65b9\u6cd5: {0}";
  52. b.egret_string_code[1005] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684blendMode: {0}";
  53. b.egret_string_code[1006] = "child\u4e0d\u5728\u5f53\u524d\u5bb9\u5668\u5185";
  54. b.egret_string_code[1007] = "\u63d0\u4f9b\u7684\u7d22\u5f15\u8d85\u51fa\u8303\u56f4";
  55. b.egret_string_code[1008] = "child\u672a\u88abaddChild\u5230\u8be5parent";
  56. b.egret_string_code[1009] = "\u8bbe\u7f6e\u4e86\u5df2\u7ecf\u5b58\u5728\u7684\u9002\u914d\u6a21\u5f0f:{0}";
  57. b.egret_string_code[1010] = "addEventListener\u4fa6\u542c\u51fd\u6570\u4e0d\u80fd\u4e3a\u7a7a";
  58. b.egret_string_code[1011] = 'BitmapText\u627e\u4e0d\u5230\u6587\u5b57\u6240\u5bf9\u5e94\u7684\u7eb9\u7406:"{0}"';
  59. b.egret_string_code[1012] = "egret.BitmapTextSpriteSheet\u5df2\u5e9f\u5f03\uff0c\u8bf7\u4f7f\u7528egret.BitmapFont\u4ee3\u66ff\u3002";
  60. b.egret_string_code[1013] = "TextField.setFocus \u6ca1\u6709\u5b9e\u73b0";
  61. b.egret_string_code[1014] = "Ease\u4e0d\u80fd\u88ab\u5b9e\u4f8b\u5316";
  62. b.egret_string_code[1015] = "xml not found!";
  63. b.egret_string_code[1016] = "{0}\u5df2\u7ecf\u5e9f\u5f03";
  64. b.egret_string_code[1017] = "JSON\u6587\u4ef6\u683c\u5f0f\u4e0d\u6b63\u786e: {0}\ndata: {1}";
  65. b.egret_string_code[1018] = "egret_html5_localStorage.setItem\u4fdd\u5b58\u5931\u8d25,key={0}&value={1}";
  66. b.egret_string_code[1019] = "\u7f51\u7edc\u5f02\u5e38:{0}";
  67. b.egret_string_code[1020] = "\u65e0\u6cd5\u521d\u59cb\u5316\u7740\u8272\u5668";
  68. b.egret_string_code[1021] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301webgl";
  69. b.egret_string_code[1022] = "{0} ArgumentError";
  70. b.egret_string_code[1023] = "\u6b64\u65b9\u6cd5\u5728ScrollView\u5185\u4e0d\u53ef\u7528!";
  71. b.egret_string_code[1024] = "\u4f7f\u7528\u4e86\u5c1a\u672a\u5b9e\u73b0\u7684ScaleMode";
  72. b.egret_string_code[1025] = "\u9047\u5230\u6587\u4ef6\u5c3e";
  73. b.egret_string_code[1026] = "EncodingError! The code point {0} could not be encoded.";
  74. b.egret_string_code[1027] = "DecodingError";
  75. b.egret_string_code[1028] = "\u8c03\u7528\u4e86\u672a\u914d\u7f6e\u7684\u6ce8\u5165\u89c4\u5219:{0}\u3002 \u8bf7\u5148\u5728\u9879\u76ee\u521d\u59cb\u5316\u91cc\u914d\u7f6e\u6307\u5b9a\u7684\u6ce8\u5165\u89c4\u5219\uff0c\u518d\u8c03\u7528\u5bf9\u5e94\u5355\u4f8b\u3002";
  76. b.egret_string_code[1029] = "Function.prototype.bind - what is trying to be bound is not callable";
  77. b.egret_string_code[1030] = "\u8be5API\u5df2\u5e9f\u5f03";
  78. b.egret_string_code[2E3] = "RES.createGroup()\u4f20\u5165\u4e86\u914d\u7f6e\u4e2d\u4e0d\u5b58\u5728\u7684\u952e\u503c: {0}";
  79. b.egret_string_code[2001] = 'RES\u52a0\u8f7d\u4e86\u4e0d\u5b58\u5728\u6216\u7a7a\u7684\u8d44\u6e90\u7ec4:"{0}"';
  80. b.egret_string_code[3E3] = "\u4e3b\u9898\u914d\u7f6e\u6587\u4ef6\u52a0\u8f7d\u5931\u8d25: {0}";
  81. b.egret_string_code[3001] = "\u627e\u4e0d\u5230\u4e3b\u9898\u4e2d\u6240\u914d\u7f6e\u7684\u76ae\u80a4\u7c7b\u540d: {0}";
  82. b.egret_string_code[3002] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u96c6\u5408\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  83. b.egret_string_code[3003] = "\u5728\u6b64\u7ec4\u4ef6\u4e2d\u4e0d\u53ef\u7528\uff0c\u82e5\u6b64\u7ec4\u4ef6\u4e3a\u5bb9\u5668\u7c7b\uff0c\u8bf7\u4f7f\u7528";
  84. b.egret_string_code[3004] = "addChild(){0}addElement()\u4ee3\u66ff";
  85. b.egret_string_code[3005] = "addChildAt(){0}addElementAt()\u4ee3\u66ff";
  86. b.egret_string_code[3006] = "removeChild(){0}removeElement()\u4ee3\u66ff";
  87. b.egret_string_code[3007] = "removeChildAt(){0}removeElementAt()\u4ee3\u66ff";
  88. b.egret_string_code[3008] = "setChildIndex(){0}setElementIndex()\u4ee3\u66ff";
  89. b.egret_string_code[3009] = "swapChildren(){0}swapElements()\u4ee3\u66ff";
  90. b.egret_string_code[3010] = "swapChildrenAt(){0}swapElementsAt()\u4ee3\u66ff";
  91. b.egret_string_code[3011] = '\u7d22\u5f15:"{0}"\u8d85\u51fa\u53ef\u89c6\u5143\u7d20\u7d22\u5f15\u8303\u56f4';
  92. b.egret_string_code[3012] = "\u6b64\u65b9\u6cd5\u5728Scroller\u7ec4\u4ef6\u5185\u4e0d\u53ef\u7528!";
  93. b.egret_string_code[3013] = "UIStage\u662fGUI\u6839\u5bb9\u5668\uff0c\u53ea\u80fd\u6709\u4e00\u4e2a\u6b64\u5b9e\u4f8b\u5728\u663e\u793a\u5217\u8868\u4e2d\uff01";
  94. b.egret_string_code[4E3] = "An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)";
  95. b.egret_string_code[4001] = "Abstract class can not be instantiated!";
  96. b.egret_string_code[4002] = "Unnamed data!";
  97. b.egret_string_code[4003] = "Nonsupport version!";
  98. b.egret_string_code[3100] = "\u5f53\u524d\u6d4f\u89c8\u5668\u4e0d\u652f\u6301WebSocket";
  99. b.egret_string_code[3101] = "\u8bf7\u5148\u8fde\u63a5WebSocket";
  100. b.getString = c
  101. })(egret || (egret = {})); (function(b) {
  102. var c = function() {
  103. function b() {
  104. this._hashCode = b.hashCount++
  105. }
  106. Object.defineProperty(b.prototype, "hashCode", {
  107. get: function() {
  108. return this._hashCode
  109. },
  110. enumerable: !0,
  111. configurable: !0
  112. });
  113. b.hashCount = 1;
  114. return b
  115. } ();
  116. b.HashObject = c;
  117. c.prototype.__class__ = "egret.HashObject"
  118. })(egret || (egret = {}));
  119. var __extends = this.__extends ||
  120. function(b, c) {
  121. function d() {
  122. this.constructor = b
  123. }
  124. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  125. d.prototype = c.prototype;
  126. b.prototype = new d
  127. }; (function(b) {
  128. var c = function(b) {
  129. function a(e) {
  130. void 0 === e && (e = 300);
  131. b.call(this);
  132. this.objectPool = [];
  133. this._length = 0;
  134. 1 > e && (e = 1);
  135. this.autoDisposeTime = e;
  136. this.frameCount = 0
  137. }
  138. __extends(a, b);
  139. a.prototype._checkFrame = function() {
  140. this.frameCount--;
  141. 0 >= this.frameCount && this.dispose()
  142. };
  143. Object.defineProperty(a.prototype, "length", {
  144. get: function() {
  145. return this._length
  146. },
  147. enumerable: !0,
  148. configurable: !0
  149. });
  150. a.prototype.push = function(e) {
  151. var k = this.objectPool; - 1 == k.indexOf(e) && (k.push(e), e.__recycle && e.__recycle(), this._length++, 0 == this.frameCount && (this.frameCount = this.autoDisposeTime, a._callBackList.push(this)))
  152. };
  153. a.prototype.pop = function() {
  154. if (0 == this._length) return null;
  155. this._length--;
  156. return this.objectPool.pop()
  157. };
  158. a.prototype.dispose = function() {
  159. 0 < this._length && (this.objectPool = [], this._length = 0);
  160. this.frameCount = 0;
  161. var e = a._callBackList,
  162. k = e.indexOf(this); - 1 != k && e.splice(k, 1)
  163. };
  164. a._callBackList = [];
  165. return a
  166. } (b.HashObject);
  167. b.Recycler = c;
  168. c.prototype.__class__ = "egret.Recycler"
  169. })(egret || (egret = {})); (function(b) {
  170. b.__START_TIME;
  171. b.getTimer = function() {
  172. return Date.now() - b.__START_TIME
  173. }
  174. })(egret || (egret = {})); (function(b) {
  175. b.__callLaterFunctionList = [];
  176. b.__callLaterThisList = [];
  177. b.__callLaterArgsList = [];
  178. b.callLater = function(c, d) {
  179. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  180. b.__callLaterFunctionList.push(c);
  181. b.__callLaterThisList.push(d);
  182. b.__callLaterArgsList.push(a)
  183. };
  184. b.__callAsyncFunctionList = [];
  185. b.__callAsyncThisList = [];
  186. b.__callAsyncArgsList = [];
  187. b.__callAsync = function(c, d) {
  188. for (var a = [], e = 2; e < arguments.length; e++) a[e - 2] = arguments[e];
  189. b.__callAsyncFunctionList.push(c);
  190. b.__callAsyncThisList.push(d);
  191. b.__callAsyncArgsList.push(a)
  192. }
  193. })(egret || (egret = {})); (function(b) {
  194. var c = function() {
  195. function d() {}
  196. d.prototype.call = function(a) {
  197. this.callback && this.callback.call(this.thisObject, a)
  198. };
  199. d.prototype.dispose = function() {
  200. this.thisObject = this.callback = null;
  201. d.__freeList.push(this)
  202. };
  203. d.push = function(a, e) {
  204. var k;
  205. k = d.__freeList.length ? d.__freeList.pop() : new b.RenderCommand;
  206. k.callback = a;
  207. k.thisObject = e;
  208. b.MainContext.__DRAW_COMMAND_LIST.push(k)
  209. };
  210. d.__freeList = [];
  211. return d
  212. } ();
  213. b.RenderCommand = c;
  214. c.prototype.__class__ = "egret.RenderCommand"
  215. })(egret || (egret = {}));
  216. var egret_dom; (function(b) {
  217. function c() {
  218. for (var b = document.createElement("div").style, a = ["t", "webkitT", "msT", "MozT", "OT"], e = 0; e < a.length; e++) if (a[e] + "ransform" in b) return a[e];
  219. return a[0]
  220. }
  221. b.header = "";
  222. b.getHeader = c;
  223. b.getTrans = function(d) {
  224. "" == b.header && (b.header = c());
  225. return b.header + d.substring(1, d.length)
  226. }
  227. })(egret_dom || (egret_dom = {}));
  228. __extends = this.__extends ||
  229. function(b, c) {
  230. function d() {
  231. this.constructor = b
  232. }
  233. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  234. d.prototype = c.prototype;
  235. b.prototype = new d
  236. }; (function(b) {
  237. var c = function(d) {
  238. function a(e, a, b) {
  239. void 0 === a && (a = !1);
  240. void 0 === b && (b = !1);
  241. d.call(this);
  242. this.data = null;
  243. this._type = "";
  244. this._cancelable = this._bubbles = !1;
  245. this._eventPhase = 2;
  246. this._target = this._currentTarget = null;
  247. this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1;
  248. this.isNew = !0;
  249. this._type = e;
  250. this._bubbles = a;
  251. this._cancelable = b
  252. }
  253. __extends(a, d);
  254. Object.defineProperty(a.prototype, "type", {
  255. get: function() {
  256. return this._type
  257. },
  258. enumerable: !0,
  259. configurable: !0
  260. });
  261. Object.defineProperty(a.prototype, "bubbles", {
  262. get: function() {
  263. return this._bubbles
  264. },
  265. enumerable: !0,
  266. configurable: !0
  267. });
  268. Object.defineProperty(a.prototype, "cancelable", {
  269. get: function() {
  270. return this._cancelable
  271. },
  272. enumerable: !0,
  273. configurable: !0
  274. });
  275. Object.defineProperty(a.prototype, "eventPhase", {
  276. get: function() {
  277. return this._eventPhase
  278. },
  279. enumerable: !0,
  280. configurable: !0
  281. });
  282. Object.defineProperty(a.prototype, "currentTarget", {
  283. get: function() {
  284. return this._currentTarget
  285. },
  286. enumerable: !0,
  287. configurable: !0
  288. });
  289. Object.defineProperty(a.prototype, "target", {
  290. get: function() {
  291. return this._target
  292. },
  293. enumerable: !0,
  294. configurable: !0
  295. });
  296. a.prototype.isDefaultPrevented = function() {
  297. return this._isDefaultPrevented
  298. };
  299. a.prototype.preventDefault = function() {
  300. this._cancelable && (this._isDefaultPrevented = !0)
  301. };
  302. a.prototype.stopPropagation = function() {
  303. this._bubbles && (this._isPropagationStopped = !0)
  304. };
  305. a.prototype.stopImmediatePropagation = function() {
  306. this._bubbles && (this._isPropagationImmediateStopped = !0)
  307. };
  308. a.prototype._reset = function() {
  309. this.isNew ? this.isNew = !1 : (this._isPropagationImmediateStopped = this._isPropagationStopped = this._isDefaultPrevented = !1, this._currentTarget = this._target = null, this._eventPhase = 2)
  310. };
  311. a.prototype.__recycle = function() {
  312. this.data = this._target = this._currentTarget = null
  313. };
  314. a._dispatchByTarget = function(e, a, m, d, c, f) {
  315. void 0 === c && (c = !1);
  316. void 0 === f && (f = !1);
  317. var l = e.eventRecycler;
  318. l || (l = e.eventRecycler = new b.Recycler);
  319. var n = l.pop();
  320. n ? n._type = m: n = new e(m);
  321. n._bubbles = c;
  322. n._cancelable = f;
  323. if (d) for (var p in d) n[p] = d[p],
  324. null !== n[p] && (d[p] = null);
  325. e = a.dispatchEvent(n);
  326. l.push(n);
  327. return e
  328. };
  329. a._getPropertyData = function(e) {
  330. var a = e._props;
  331. a || (a = e._props = {});
  332. return a
  333. };
  334. a.dispatchEvent = function(e, k, b, d) {
  335. void 0 === b && (b = !1);
  336. var c = a._getPropertyData(a);
  337. d && (c.data = d);
  338. a._dispatchByTarget(a, e, k, c, b)
  339. };
  340. a.ADDED_TO_STAGE = "addedToStage";
  341. a.REMOVED_FROM_STAGE = "removedFromStage";
  342. a.ADDED = "added";
  343. a.REMOVED = "removed";
  344. a.COMPLETE = "complete";
  345. a.LOOP_COMPLETE = "loopcomplete";
  346. a.ENTER_FRAME = "enterFrame";
  347. a.RENDER = "render";
  348. a.FINISH_RENDER = "finishRender";
  349. a.FINISH_UPDATE_TRANSFORM = "finishUpdateTransform";
  350. a.LEAVE_STAGE = "leaveStage";
  351. a.RESIZE = "resize";
  352. a.CHANGE = "change";
  353. a.ACTIVATE = "activate";
  354. a.DEACTIVATE = "deactivate";
  355. a.CLOSE = "close";
  356. a.CONNECT = "connect";
  357. return a
  358. } (b.HashObject);
  359. b.Event = c;
  360. c.prototype.__class__ = "egret.Event"
  361. })(egret || (egret = {}));
  362. __extends = this.__extends ||
  363. function(b, c) {
  364. function d() {
  365. this.constructor = b
  366. }
  367. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  368. d.prototype = c.prototype;
  369. b.prototype = new d
  370. }; (function(b) {
  371. var c = function(b) {
  372. function a(e, a, m) {
  373. void 0 === a && (a = !1);
  374. void 0 === m && (m = !1);
  375. b.call(this, e, a, m);
  376. this._status = 0
  377. }
  378. __extends(a, b);
  379. Object.defineProperty(a.prototype, "status", {
  380. get: function() {
  381. return this._status
  382. },
  383. enumerable: !0,
  384. configurable: !0
  385. });
  386. a.dispatchHTTPStatusEvent = function(e, k) {
  387. null == a.httpStatusEvent && (a.httpStatusEvent = new a(a.HTTP_STATUS));
  388. a.httpStatusEvent._status = k;
  389. e.dispatchEvent(a.httpStatusEvent)
  390. };
  391. a.HTTP_STATUS = "httpStatus";
  392. a.httpStatusEvent = null;
  393. return a
  394. } (b.Event);
  395. b.HTTPStatusEvent = c;
  396. c.prototype.__class__ = "egret.HTTPStatusEvent"
  397. })(egret || (egret = {}));
  398. __extends = this.__extends ||
  399. function(b, c) {
  400. function d() {
  401. this.constructor = b
  402. }
  403. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  404. d.prototype = c.prototype;
  405. b.prototype = new d
  406. }; (function(b) {
  407. var c = function(d) {
  408. function a(e, a, b) {
  409. void 0 === a && (a = !1);
  410. void 0 === b && (b = !1);
  411. d.call(this, e, a, b)
  412. }
  413. __extends(a, d);
  414. a.dispatchIOErrorEvent = function(e) {
  415. b.Event._dispatchByTarget(a, e, a.IO_ERROR)
  416. };
  417. a.IO_ERROR = "ioError";
  418. return a
  419. } (b.Event);
  420. b.IOErrorEvent = c;
  421. c.prototype.__class__ = "egret.IOErrorEvent"
  422. })(egret || (egret = {}));
  423. __extends = this.__extends ||
  424. function(b, c) {
  425. function d() {
  426. this.constructor = b
  427. }
  428. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  429. d.prototype = c.prototype;
  430. b.prototype = new d
  431. }; (function(b) {
  432. var c = function(d) {
  433. function a(e, a, b, h, c, f, l, n, p, q) {
  434. void 0 === a && (a = !0);
  435. void 0 === b && (b = !0);
  436. void 0 === h && (h = 0);
  437. void 0 === c && (c = 0);
  438. void 0 === f && (f = 0);
  439. void 0 === l && (l = !1);
  440. void 0 === n && (n = !1);
  441. void 0 === q && (q = !1);
  442. d.call(this, e, a, b);
  443. this._stageY = this._stageX = 0;
  444. this.touchPointID = NaN;
  445. this.touchDown = this.altKey = this.shiftKey = this.ctrlKey = !1;
  446. this.touchPointID = h;
  447. this._stageX = c;
  448. this._stageY = f;
  449. this.ctrlKey = l;
  450. this.altKey = n;
  451. this.touchDown = q
  452. }
  453. __extends(a, d);
  454. Object.defineProperty(a.prototype, "stageX", {
  455. get: function() {
  456. return this._stageX
  457. },
  458. enumerable: !0,
  459. configurable: !0
  460. });
  461. Object.defineProperty(a.prototype, "stageY", {
  462. get: function() {
  463. return this._stageY
  464. },
  465. enumerable: !0,
  466. configurable: !0
  467. });
  468. Object.defineProperty(a.prototype, "localX", {
  469. get: function() {
  470. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).x
  471. },
  472. enumerable: !0,
  473. configurable: !0
  474. });
  475. Object.defineProperty(a.prototype, "localY", {
  476. get: function() {
  477. return this._currentTarget.globalToLocal(this._stageX, this._stageY, b.Point.identity).y
  478. },
  479. enumerable: !0,
  480. configurable: !0
  481. });
  482. a.dispatchTouchEvent = function(e, k, m, d, c, f, l, n, p) {
  483. void 0 === m && (m = 0);
  484. void 0 === d && (d = 0);
  485. void 0 === c && (c = 0);
  486. void 0 === f && (f = !1);
  487. void 0 === l && (l = !1);
  488. void 0 === n && (n = !1);
  489. void 0 === p && (p = !1);
  490. var q = b.Event._getPropertyData(a);
  491. q.touchPointID = m;
  492. q._stageX = d;
  493. q._stageY = c;
  494. q.ctrlKey = f;
  495. q.altKey = l;
  496. q.shiftKey = n;
  497. q.touchDown = p;
  498. b.Event._dispatchByTarget(a, e, k, q, !0, !0)
  499. };
  500. a.TOUCH_TAP = "touchTap";
  501. a.TOUCH_MOVE = "touchMove";
  502. a.TOUCH_BEGIN = "touchBegin";
  503. a.TOUCH_END = "touchEnd";
  504. a.TOUCH_RELEASE_OUTSIDE = "touchReleaseOutside";
  505. a.TOUCH_ROLL_OUT = "touchRollOut";
  506. a.TOUCH_ROLL_OVER = "touchRollOver";
  507. a.TOUCH_OUT = "touchOut";
  508. a.TOUCH_OVER = "touchOver";
  509. return a
  510. } (b.Event);
  511. b.TouchEvent = c;
  512. c.prototype.__class__ = "egret.TouchEvent"
  513. })(egret || (egret = {}));
  514. __extends = this.__extends ||
  515. function(b, c) {
  516. function d() {
  517. this.constructor = b
  518. }
  519. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  520. d.prototype = c.prototype;
  521. b.prototype = new d
  522. }; (function(b) {
  523. var c = function(d) {
  524. function a(e, a, b) {
  525. void 0 === a && (a = !1);
  526. void 0 === b && (b = !1);
  527. d.call(this, e, a, b)
  528. }
  529. __extends(a, d);
  530. a.dispatchTimerEvent = function(e, k) {
  531. b.Event._dispatchByTarget(a, e, k)
  532. };
  533. a.TIMER = "timer";
  534. a.TIMER_COMPLETE = "timerComplete";
  535. return a
  536. } (b.Event);
  537. b.TimerEvent = c;
  538. c.prototype.__class__ = "egret.TimerEvent"
  539. })(egret || (egret = {}));
  540. __extends = this.__extends ||
  541. function(b, c) {
  542. function d() {
  543. this.constructor = b
  544. }
  545. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  546. d.prototype = c.prototype;
  547. b.prototype = new d
  548. }; (function(b) {
  549. var c = function(d) {
  550. function a(e, a, b, h, c) {
  551. void 0 === a && (a = !1);
  552. void 0 === b && (b = !1);
  553. void 0 === h && (h = 0);
  554. void 0 === c && (c = 0);
  555. d.call(this, e, a, b);
  556. this.bytesTotal = this.bytesLoaded = 0;
  557. this.bytesLoaded = h;
  558. this.bytesTotal = c
  559. }
  560. __extends(a, d);
  561. a.dispatchProgressEvent = function(e, k, m, d) {
  562. void 0 === m && (m = 0);
  563. void 0 === d && (d = 0);
  564. b.Event._dispatchByTarget(a, e, k, {
  565. bytesLoaded: m,
  566. bytesTotal: d
  567. })
  568. };
  569. a.PROGRESS = "progress";
  570. a.SOCKET_DATA = "socketData";
  571. return a
  572. } (b.Event);
  573. b.ProgressEvent = c;
  574. c.prototype.__class__ = "egret.ProgressEvent"
  575. })(egret || (egret = {})); (function(b) {
  576. var c = function() {
  577. function b() {}
  578. b.CAPTURING_PHASE = 1;
  579. b.AT_TARGET = 2;
  580. b.BUBBLING_PHASE = 3;
  581. return b
  582. } ();
  583. b.EventPhase = c;
  584. c.prototype.__class__ = "egret.EventPhase"
  585. })(egret || (egret = {}));
  586. __extends = this.__extends ||
  587. function(b, c) {
  588. function d() {
  589. this.constructor = b
  590. }
  591. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  592. d.prototype = c.prototype;
  593. b.prototype = new d
  594. }; (function(b) {
  595. var c = function(d) {
  596. function a(e) {
  597. void 0 === e && (e = null);
  598. d.call(this);
  599. this._captureEventsMap = this._eventsMap = this._eventTarget = null;
  600. this._eventTarget = e ? e: this
  601. }
  602. __extends(a, d);
  603. a.prototype.addEventListener = function(e, a, m, d, c) {
  604. void 0 === d && (d = !1);
  605. void 0 === c && (c = 0);
  606. "undefined" === typeof d && (d = !1);
  607. "undefined" === typeof c && (c = 0);
  608. a || b.Logger.fatalWithErrorId(1010);
  609. d ? (this._captureEventsMap || (this._captureEventsMap = {}), d = this._captureEventsMap) : (this._eventsMap || (this._eventsMap = {}), d = this._eventsMap);
  610. var f = d[e];
  611. f || (f = d[e] = []);
  612. this._insertEventBin(f, a, m, c)
  613. };
  614. a.prototype._insertEventBin = function(e, a, b, d, c) {
  615. void 0 === c && (c = void 0);
  616. for (var f = -1,
  617. l = e.length,
  618. n = 0; n < l; n++) {
  619. var p = e[n];
  620. if (p.listener === a && p.thisObject === b && p.display === c) return ! 1; - 1 == f && p.priority < d && (f = n)
  621. }
  622. a = {
  623. listener: a,
  624. thisObject: b,
  625. priority: d
  626. };
  627. c && (a.display = c); - 1 != f ? e.splice(f, 0, a) : e.push(a);
  628. return ! 0
  629. };
  630. a.prototype.removeEventListener = function(e, a, b, d) {
  631. void 0 === d && (d = !1);
  632. if (d = d ? this._captureEventsMap: this._eventsMap) {
  633. var c = d[e];
  634. c && (this._removeEventBin(c, a, b), 0 == c.length && delete d[e])
  635. }
  636. };
  637. a.prototype._removeEventBin = function(e, a, b, d) {
  638. void 0 === d && (d = void 0);
  639. for (var c = e.length,
  640. f = 0; f < c; f++) {
  641. var l = e[f];
  642. if (l.listener === a && l.thisObject === b && l.display === d) return e.splice(f, 1),
  643. !0
  644. }
  645. return ! 1
  646. };
  647. a.prototype.hasEventListener = function(e) {
  648. return this._eventsMap && this._eventsMap[e] || this._captureEventsMap && this._captureEventsMap[e]
  649. };
  650. a.prototype.willTrigger = function(e) {
  651. return this.hasEventListener(e)
  652. };
  653. a.prototype.dispatchEvent = function(e) {
  654. e._reset();
  655. e._target = this._eventTarget;
  656. e._currentTarget = this._eventTarget;
  657. return this._notifyListener(e)
  658. };
  659. a.prototype._notifyListener = function(e) {
  660. var a = 1 == e._eventPhase ? this._captureEventsMap: this._eventsMap;
  661. if (!a) return ! 0;
  662. a = a[e._type];
  663. if (!a) return ! 0;
  664. var b = a.length;
  665. if (0 == b) return ! 0;
  666. for (var a = a.concat(), d = 0; d < b; d++) {
  667. var c = a[d];
  668. c.listener.call(c.thisObject, e);
  669. if (e._isPropagationImmediateStopped) break
  670. }
  671. return ! e._isDefaultPrevented
  672. };
  673. a.prototype.dispatchEventWith = function(e, a, m) {
  674. void 0 === a && (a = !1);
  675. b.Event.dispatchEvent(this, e, a, m)
  676. };
  677. return a
  678. } (b.HashObject);
  679. b.EventDispatcher = c;
  680. c.prototype.__class__ = "egret.EventDispatcher"
  681. })(egret || (egret = {}));
  682. __extends = this.__extends ||
  683. function(b, c) {
  684. function d() {
  685. this.constructor = b
  686. }
  687. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  688. d.prototype = c.prototype;
  689. b.prototype = new d
  690. }; (function(b) {
  691. var c = function(d) {
  692. function a() {
  693. d.call(this);
  694. this.stage = this.deviceContext = this.netContext = this.touchContext = this.rendererContext = null;
  695. this.reuseEvent = new b.Event("")
  696. }
  697. __extends(a, d);
  698. a.prototype.run = function() {
  699. b.Ticker.getInstance().run();
  700. b.Ticker.getInstance().register(this.renderLoop, this, Number.NEGATIVE_INFINITY);
  701. b.Ticker.getInstance().register(this.broadcastEnterFrame, this, Number.POSITIVE_INFINITY);
  702. this.touchContext.run();
  703. this._profileInstance = b.Profiler.getInstance()
  704. };
  705. a.prototype.renderLoop = function(e) {
  706. if (0 < b.__callLaterFunctionList.length) {
  707. var k = b.__callLaterFunctionList;
  708. b.__callLaterFunctionList = [];
  709. var m = b.__callLaterThisList;
  710. b.__callLaterThisList = [];
  711. var d = b.__callLaterArgsList;
  712. b.__callLaterArgsList = []
  713. }
  714. e = this.stage;
  715. var c = a.cachedEvent;
  716. c._type = b.Event.RENDER;
  717. this.dispatchEvent(c);
  718. b.Stage._invalidateRenderFlag && (this.broadcastRender(), b.Stage._invalidateRenderFlag = !1);
  719. k && this.doCallLaterList(k, m, d);
  720. 0 < b.__callAsyncFunctionList.length && this.doCallAsyncList();
  721. k = this.rendererContext;
  722. k.onRenderStart();
  723. k.clearScreen();
  724. a.__DRAW_COMMAND_LIST = [];
  725. a._renderLoopPhase = "updateTransform";
  726. e._updateTransform();
  727. a._renderLoopPhase = "draw";
  728. c._type = b.Event.FINISH_UPDATE_TRANSFORM;
  729. this.dispatchEvent(c);
  730. a.__use_new_draw ? this._draw(k) : e._draw(k);
  731. c._type = b.Event.FINISH_RENDER;
  732. this.dispatchEvent(c);
  733. this._profileInstance._isRunning && this._profileInstance._drawProfiler();
  734. k.onRenderFinish()
  735. };
  736. a.prototype._draw = function(e) {
  737. for (var k = a.__DRAW_COMMAND_LIST,
  738. b = k.length,
  739. d = 0; d < b; d++) {
  740. var c = k[d];
  741. c.call(e);
  742. c.dispose()
  743. }
  744. };
  745. a.prototype.broadcastEnterFrame = function(e) {
  746. e = this.reuseEvent;
  747. e._type = b.Event.ENTER_FRAME;
  748. this.dispatchEvent(e);
  749. for (var a = b.DisplayObject._enterFrameCallBackList.concat(), m = a.length, d = 0; d < m; d++) {
  750. var c = a[d];
  751. e._target = c.display;
  752. e._currentTarget = c.display;
  753. c.listener.call(c.thisObject, e)
  754. }
  755. a = b.Recycler._callBackList;
  756. for (d = a.length - 1; 0 <= d; d--) a[d]._checkFrame()
  757. };
  758. a.prototype.broadcastRender = function() {
  759. var e = this.reuseEvent;
  760. e._type = b.Event.RENDER;
  761. for (var a = b.DisplayObject._renderCallBackList.concat(), m = a.length, d = 0; d < m; d++) {
  762. var c = a[d],
  763. f = c.display;
  764. e._target = f;
  765. e._currentTarget = f;
  766. c.listener.call(c.thisObject, e)
  767. }
  768. };
  769. a.prototype.doCallLaterList = function(e, a, b) {
  770. for (var d = e.length,
  771. c = 0; c < d; c++) {
  772. var f = e[c];
  773. null != f && f.apply(a[c], b[c])
  774. }
  775. };
  776. a.prototype.doCallAsyncList = function() {
  777. var e = b.__callAsyncFunctionList.concat(),
  778. a = b.__callAsyncThisList.concat(),
  779. m = b.__callAsyncArgsList.concat();
  780. b.__callAsyncFunctionList.length = 0;
  781. b.__callAsyncThisList.length = 0;
  782. for (var d = b.__callAsyncArgsList.length = 0; d < e.length; d++) {
  783. var c = e[d];
  784. null != c && c.apply(a[d], m[d])
  785. }
  786. };
  787. a.deviceType = null;
  788. a.DEVICE_PC = "web";
  789. a.DEVICE_MOBILE = "native";
  790. a.RUNTIME_HTML5 = "runtime_html5";
  791. a.RUNTIME_NATIVE = "runtime_native";
  792. a.__DRAW_COMMAND_LIST = [];
  793. a.__use_new_draw = !0;
  794. a.cachedEvent = new b.Event("");
  795. return a
  796. } (b.EventDispatcher);
  797. b.MainContext = c;
  798. c.prototype.__class__ = "egret.MainContext"
  799. })(egret || (egret = {}));
  800. var testDeviceType = function() {
  801. if (!this.navigator) return ! 0;
  802. var b = navigator.userAgent.toLowerCase();
  803. return - 1 != b.indexOf("mobile") || -1 != b.indexOf("android")
  804. },
  805. testRuntimeType = function() {
  806. return this.navigator ? !0 : !1
  807. };
  808. egret.MainContext.instance = new egret.MainContext;
  809. egret.MainContext.deviceType = testDeviceType() ? egret.MainContext.DEVICE_MOBILE: egret.MainContext.DEVICE_PC;
  810. egret.MainContext.runtimeType = testRuntimeType() ? egret.MainContext.RUNTIME_HTML5: egret.MainContext.RUNTIME_NATIVE;
  811. delete testDeviceType;
  812. delete testRuntimeType; (function(b) {
  813. var c = function() {
  814. function d() {
  815. this._preDrawCount = this._updateTransformPerformanceCost = this._renderPerformanceCost = this._logicPerformanceCost = this._lastTime = 0;
  816. this._txt = null;
  817. this._tick = 0;
  818. this._maxDeltaTime = 500;
  819. this._totalDeltaTime = 0;
  820. this._isRunning = !1
  821. }
  822. d.getInstance = function() {
  823. null == d.instance && (d.instance = new d);
  824. return d.instance
  825. };
  826. d.prototype.stop = function() {
  827. if (this._isRunning) {
  828. this._isRunning = !1;
  829. b.Ticker.getInstance().unregister(this.update, this);
  830. var a = b.MainContext.instance;
  831. a.removeEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  832. a.removeEventListener(b.Event.RENDER, this.onStartRender, this);
  833. a.removeEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  834. a.removeEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  835. }
  836. };
  837. d.prototype.run = function() {
  838. null == this._txt && (this._txt = new b.TextField, this._txt.size = 28, this._txt.multiline = !0, this._txt._parent = new b.DisplayObjectContainer);
  839. if (!this._isRunning) {
  840. this._isRunning = !0;
  841. b.Ticker.getInstance().register(this.update, this);
  842. var a = b.MainContext.instance;
  843. a.addEventListener(b.Event.ENTER_FRAME, this.onEnterFrame, this);
  844. a.addEventListener(b.Event.RENDER, this.onStartRender, this);
  845. a.addEventListener(b.Event.FINISH_RENDER, this.onFinishRender, this);
  846. a.addEventListener(b.Event.FINISH_UPDATE_TRANSFORM, this.onFinishUpdateTransform, this)
  847. }
  848. };
  849. d.prototype._drawProfiler = function() {
  850. this._txt._updateTransform();
  851. this._txt._draw(b.MainContext.instance.rendererContext)
  852. };
  853. d.prototype._setTxtFontSize = function(a) {
  854. this._txt.size = a
  855. };
  856. d.prototype.onEnterFrame = function(a) {
  857. this._lastTime = b.getTimer()
  858. };
  859. d.prototype.onStartRender = function(a) {
  860. a = b.getTimer();
  861. this._logicPerformanceCost = a - this._lastTime;
  862. this._lastTime = a
  863. };
  864. d.prototype.onFinishUpdateTransform = function(a) {
  865. a = b.getTimer();
  866. this._updateTransformPerformanceCost = a - this._lastTime;
  867. this._lastTime = a
  868. };
  869. d.prototype.onFinishRender = function(a) {
  870. a = b.getTimer();
  871. this._renderPerformanceCost = a - this._lastTime;
  872. this._lastTime = a
  873. };
  874. d.prototype.update = function(a) {
  875. this._tick++;
  876. this._totalDeltaTime += a;
  877. if (this._totalDeltaTime >= this._maxDeltaTime) {
  878. a = (this._preDrawCount - 3).toString();
  879. var e = Math.ceil(this._logicPerformanceCost).toString() + "," + Math.ceil(this._updateTransformPerformanceCost).toString() + "," + Math.ceil(this._renderPerformanceCost).toString() + "," + Math.ceil(b.MainContext.instance.rendererContext.renderCost).toString();
  880. this._txt.text = "draw:" + a + "\ncost:" + e + "\nFPS:" + Math.floor(1E3 * this._tick / this._totalDeltaTime).toString();
  881. this._tick = this._totalDeltaTime = 0
  882. }
  883. this._preDrawCount = 0
  884. };
  885. d.prototype.onDrawImage = function() {
  886. this._preDrawCount++
  887. };
  888. return d
  889. } ();
  890. b.Profiler = c;
  891. c.prototype.__class__ = "egret.Profiler"
  892. })(egret || (egret = {}));
  893. __extends = this.__extends ||
  894. function(b, c) {
  895. function d() {
  896. this.constructor = b
  897. }
  898. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  899. d.prototype = c.prototype;
  900. b.prototype = new d
  901. }; (function(b) {
  902. var c = function(d) {
  903. function a() {
  904. d.call(this);
  905. this._timeScale = 1;
  906. this._paused = !1;
  907. this.callBackList = [];
  908. null != a.instance && b.Logger.fatalWithErrorId(1002)
  909. }
  910. __extends(a, d);
  911. a.prototype.run = function() {
  912. b.__START_TIME = (new Date).getTime();
  913. b.MainContext.instance.deviceContext.executeMainLoop(this.update, this)
  914. };
  915. a.prototype.update = function(e) {
  916. if (!this._paused) {
  917. var a = this.callBackList.concat(),
  918. b = a.length;
  919. e *= this._timeScale;
  920. e *= this._timeScale;
  921. for (var d = 0; d < b; d++) {
  922. var c = a[d];
  923. c.listener.call(c.thisObject, e)
  924. }
  925. }
  926. };
  927. a.prototype.register = function(e, a, b) {
  928. void 0 === b && (b = 0);
  929. this._insertEventBin(this.callBackList, e, a, b)
  930. };
  931. a.prototype.unregister = function(e, a) {
  932. this._removeEventBin(this.callBackList, e, a)
  933. };
  934. a.prototype.setTimeout = function(e, a, m) {
  935. for (var d = [], c = 3; c < arguments.length; c++) d[c - 3] = arguments[c];
  936. b.Logger.warningWithErrorId(1003);
  937. b.setTimeout.apply(null, [e, a, m].concat(d))
  938. };
  939. a.prototype.setTimeScale = function(e) {
  940. this._timeScale = e
  941. };
  942. a.prototype.getTimeScale = function() {
  943. return this._timeScale
  944. };
  945. a.prototype.pause = function() {
  946. this._paused = !0
  947. };
  948. a.prototype.resume = function() {
  949. this._paused = !1
  950. };
  951. a.getInstance = function() {
  952. null == a.instance && (a.instance = new a);
  953. return a.instance
  954. };
  955. return a
  956. } (b.EventDispatcher);
  957. b.Ticker = c;
  958. c.prototype.__class__ = "egret.Ticker"
  959. })(egret || (egret = {})); (function(b) {
  960. var c = function() {
  961. function b() {}
  962. b.LEFT = "left";
  963. b.RIGHT = "right";
  964. b.CENTER = "center";
  965. b.JUSTIFY = "justify";
  966. b.CONTENT_JUSTIFY = "contentJustify";
  967. return b
  968. } ();
  969. b.HorizontalAlign = c;
  970. c.prototype.__class__ = "egret.HorizontalAlign"
  971. })(egret || (egret = {})); (function(b) {
  972. var c = function() {
  973. function b() {}
  974. b.TOP = "top";
  975. b.BOTTOM = "bottom";
  976. b.MIDDLE = "middle";
  977. b.JUSTIFY = "justify";
  978. b.CONTENT_JUSTIFY = "contentJustify";
  979. return b
  980. } ();
  981. b.VerticalAlign = c;
  982. c.prototype.__class__ = "egret.VerticalAlign"
  983. })(egret || (egret = {}));
  984. __extends = this.__extends ||
  985. function(b, c) {
  986. function d() {
  987. this.constructor = b
  988. }
  989. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  990. d.prototype = c.prototype;
  991. b.prototype = new d
  992. }; (function(b) {
  993. var c = function(d) {
  994. function a(e, a) {
  995. void 0 === a && (a = 0);
  996. d.call(this);
  997. this._currentCount = 0;
  998. this._running = !1;
  999. this.lastTime = 0;
  1000. this.delay = e;
  1001. this.repeatCount = a
  1002. }
  1003. __extends(a, d);
  1004. Object.defineProperty(a.prototype, "currentCount", {
  1005. get: function() {
  1006. return this._currentCount
  1007. },
  1008. enumerable: !0,
  1009. configurable: !0
  1010. });
  1011. Object.defineProperty(a.prototype, "running", {
  1012. get: function() {
  1013. return this._running
  1014. },
  1015. enumerable: !0,
  1016. configurable: !0
  1017. });
  1018. a.prototype.reset = function() {
  1019. this.stop();
  1020. this._currentCount = 0
  1021. };
  1022. a.prototype.start = function() {
  1023. this._running || (this.lastTime = b.getTimer(), b.Ticker.getInstance().register(this.onEnterFrame, this), this._running = !0)
  1024. };
  1025. a.prototype.stop = function() {
  1026. this._running && (b.Ticker.getInstance().unregister(this.onEnterFrame, this), this._running = !1)
  1027. };
  1028. a.prototype.onEnterFrame = function(e) {
  1029. e = b.getTimer();
  1030. e - this.lastTime > this.delay && (this.lastTime = e, this._currentCount++, b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER), 0 < this.repeatCount && this._currentCount >= this.repeatCount && (this.stop(), b.TimerEvent.dispatchTimerEvent(this, b.TimerEvent.TIMER_COMPLETE)))
  1031. };
  1032. return a
  1033. } (b.EventDispatcher);
  1034. b.Timer = c;
  1035. c.prototype.__class__ = "egret.Timer"
  1036. })(egret || (egret = {})); (function(b) {
  1037. function c(b) {
  1038. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1039. if (b.hasOwnProperty("__class__")) return b.__class__;
  1040. var a = b.constructor.toString(),
  1041. e = a.indexOf("("),
  1042. a = a.substring(9, e);
  1043. Object.defineProperty(b, "__class__", {
  1044. value: a,
  1045. enumerable: !1,
  1046. writable: !0
  1047. });
  1048. return a
  1049. }
  1050. b.getQualifiedClassName = c;
  1051. b.getQualifiedSuperclassName = function(b) {
  1052. b = b.prototype ? b.prototype: Object.getPrototypeOf(b);
  1053. if (b.hasOwnProperty("__superclass__")) return b.__superclass__;
  1054. var a = Object.getPrototypeOf(b);
  1055. if (null == a) return null;
  1056. a = c(a.constructor);
  1057. if (!a) return null;
  1058. Object.defineProperty(b, "__superclass__", {
  1059. value: a,
  1060. enumerable: !1,
  1061. writable: !0
  1062. });
  1063. return a
  1064. }
  1065. })(egret || (egret = {})); (function(b) {
  1066. var c = {};
  1067. b.getDefinitionByName = function(b) {
  1068. if (!b) return null;
  1069. var a = c[b];
  1070. if (a) return a;
  1071. for (var e = b.split("."), k = e.length, a = __global, m = 0; m < k; m++) if (a = a[e[m]], !a) return null;
  1072. return c[b] = a
  1073. }
  1074. })(egret || (egret = {}));
  1075. var __global = __global || this; (function(b) {
  1076. function c(e) {
  1077. for (var a in d) {
  1078. var b = d[a];
  1079. b.delay -= e;
  1080. 0 >= b.delay && (b.listener.apply(b.thisObject, b.params), delete d[a])
  1081. }
  1082. }
  1083. var d = {},
  1084. a = 0;
  1085. b.setTimeout = function(e, k, m) {
  1086. for (var h = [], g = 3; g < arguments.length; g++) h[g - 3] = arguments[g];
  1087. h = {
  1088. listener: e,
  1089. thisObject: k,
  1090. delay: m,
  1091. params: h
  1092. };
  1093. 0 == a && b.Ticker.getInstance().register(c, null);
  1094. a++;
  1095. d[a] = h;
  1096. return a
  1097. };
  1098. b.clearTimeout = function(e) {
  1099. delete d[e]
  1100. }
  1101. })(egret || (egret = {})); (function(b) {
  1102. b.hasDefinition = function(c) {
  1103. return b.getDefinitionByName(c) ? !0 : !1
  1104. }
  1105. })(egret || (egret = {})); (function(b) {
  1106. b.toColorString = function(b) {
  1107. if (isNaN(b) || 0 > b) b = 0;
  1108. 16777215 < b && (b = 16777215);
  1109. for (b = b.toString(16).toUpperCase(); 6 > b.length;) b = "0" + b;
  1110. return "#" + b
  1111. }
  1112. })(egret || (egret = {}));
  1113. __extends = this.__extends ||
  1114. function(b, c) {
  1115. function d() {
  1116. this.constructor = b
  1117. }
  1118. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1119. d.prototype = c.prototype;
  1120. b.prototype = new d
  1121. }; (function(b) {
  1122. var c = function(d) {
  1123. function a(e, a, b, c, g, f) {
  1124. void 0 === e && (e = 1);
  1125. void 0 === a && (a = 0);
  1126. void 0 === b && (b = 0);
  1127. void 0 === c && (c = 1);
  1128. void 0 === g && (g = 0);
  1129. void 0 === f && (f = 0);
  1130. d.call(this);
  1131. this.a = e;
  1132. this.b = a;
  1133. this.c = b;
  1134. this.d = c;
  1135. this.tx = g;
  1136. this.ty = f
  1137. }
  1138. __extends(a, d);
  1139. a.prototype.prepend = function(e, a, b, d, c, f) {
  1140. var l = this.tx;
  1141. if (1 != e || 0 != a || 0 != b || 1 != d) {
  1142. var n = this.a,
  1143. p = this.c;
  1144. this.a = n * e + this.b * b;
  1145. this.b = n * a + this.b * d;
  1146. this.c = p * e + this.d * b;
  1147. this.d = p * a + this.d * d
  1148. }
  1149. this.tx = l * e + this.ty * b + c;
  1150. this.ty = l * a + this.ty * d + f;
  1151. return this
  1152. };
  1153. a.prototype.append = function(e, a, b, d, c, f) {
  1154. var l = this.a,
  1155. n = this.b,
  1156. p = this.c,
  1157. q = this.d;
  1158. if (1 != e || 0 != a || 0 != b || 1 != d) this.a = e * l + a * p,
  1159. this.b = e * n + a * q,
  1160. this.c = b * l + d * p,
  1161. this.d = b * n + d * q;
  1162. this.tx = c * l + f * p + this.tx;
  1163. this.ty = c * n + f * q + this.ty;
  1164. return this
  1165. };
  1166. a.prototype.prependTransform = function(e, a, m, d, c, f, l, n, p) {
  1167. if (c % 360) {
  1168. var q = b.NumberUtils.cos(c);
  1169. c = b.NumberUtils.sin(c)
  1170. } else q = 1,
  1171. c = 0;
  1172. if (n || p) this.tx -= n,
  1173. this.ty -= p;
  1174. f || l ? (this.prepend(q * m, c * m, -c * d, q * d, 0, 0), this.prepend(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a)) : this.prepend(q * m, c * m, -c * d, q * d, e, a);
  1175. return this
  1176. };
  1177. a.prototype.appendTransform = function(e, a, m, d, c, f, l, n, p) {
  1178. if (c % 360) {
  1179. var q = b.NumberUtils.cos(c);
  1180. c = b.NumberUtils.sin(c)
  1181. } else q = 1,
  1182. c = 0;
  1183. f || l ? (this.append(b.NumberUtils.cos(l), b.NumberUtils.sin(l), -b.NumberUtils.sin(f), b.NumberUtils.cos(f), e, a), this.append(q * m, c * m, -c * d, q * d, 0, 0)) : this.append(q * m, c * m, -c * d, q * d, e, a);
  1184. if (n || p) this.tx -= n * this.a + p * this.c,
  1185. this.ty -= n * this.b + p * this.d;
  1186. return this
  1187. };
  1188. a.prototype.rotate = function(e) {
  1189. var a = Math.cos(e);
  1190. e = Math.sin(e);
  1191. var b = this.a,
  1192. d = this.c,
  1193. c = this.tx;
  1194. this.a = b * a - this.b * e;
  1195. this.b = b * e + this.b * a;
  1196. this.c = d * a - this.d * e;
  1197. this.d = d * e + this.d * a;
  1198. this.tx = c * a - this.ty * e;
  1199. this.ty = c * e + this.ty * a;
  1200. return this
  1201. };
  1202. a.prototype.skew = function(e, a) {
  1203. this.append(b.NumberUtils.cos(a), b.NumberUtils.sin(a), -b.NumberUtils.sin(e), b.NumberUtils.cos(e), 0, 0);
  1204. return this
  1205. };
  1206. a.prototype.scale = function(e, a) {
  1207. this.a *= e;
  1208. this.d *= a;
  1209. this.c *= e;
  1210. this.b *= a;
  1211. this.tx *= e;
  1212. this.ty *= a;
  1213. return this
  1214. };
  1215. a.prototype.translate = function(e, a) {
  1216. this.tx += e;
  1217. this.ty += a;
  1218. return this
  1219. };
  1220. a.prototype.identity = function() {
  1221. this.a = this.d = 1;
  1222. this.b = this.c = this.tx = this.ty = 0;
  1223. return this
  1224. };
  1225. a.prototype.identityMatrix = function(e) {
  1226. this.a = e.a;
  1227. this.b = e.b;
  1228. this.c = e.c;
  1229. this.d = e.d;
  1230. this.tx = e.tx;
  1231. this.ty = e.ty;
  1232. return this
  1233. };
  1234. a.prototype.invert = function() {
  1235. var e = this.a,
  1236. a = this.b,
  1237. b = this.c,
  1238. d = this.d,
  1239. c = this.tx,
  1240. f = e * d - a * b;
  1241. this.a = d / f;
  1242. this.b = -a / f;
  1243. this.c = -b / f;
  1244. this.d = e / f;
  1245. this.tx = (b * this.ty - d * c) / f;
  1246. this.ty = -(e * this.ty - a * c) / f;
  1247. return this
  1248. };
  1249. a.transformCoords = function(e, a, m) {
  1250. var d = b.Point.identity;
  1251. d.x = e.a * a + e.c * m + e.tx;
  1252. d.y = e.d * m + e.b * a + e.ty;
  1253. return d
  1254. };
  1255. a.prototype.toArray = function(e) {
  1256. this.array || (this.array = new Float32Array(9));
  1257. e ? (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = 0, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = 0, this.array[6] = this.tx, this.array[7] = this.ty) : (this.array[0] = this.a, this.array[1] = this.b, this.array[2] = this.tx, this.array[3] = this.c, this.array[4] = this.d, this.array[5] = this.ty, this.array[6] = 0, this.array[7] = 0);
  1258. this.array[8] = 1;
  1259. return this.array
  1260. };
  1261. a.identity = new a;
  1262. a.DEG_TO_RAD = Math.PI / 180;
  1263. return a
  1264. } (b.HashObject);
  1265. b.Matrix = c;
  1266. c.prototype.__class__ = "egret.Matrix"
  1267. })(egret || (egret = {}));
  1268. __extends = this.__extends ||
  1269. function(b, c) {
  1270. function d() {
  1271. this.constructor = b
  1272. }
  1273. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1274. d.prototype = c.prototype;
  1275. b.prototype = new d
  1276. }; (function(b) {
  1277. var c = function(b) {
  1278. function a(e, a) {
  1279. void 0 === e && (e = 0);
  1280. void 0 === a && (a = 0);
  1281. b.call(this);
  1282. this.x = e;
  1283. this.y = a
  1284. }
  1285. __extends(a, b);
  1286. a.prototype.clone = function() {
  1287. return new a(this.x, this.y)
  1288. };
  1289. a.prototype.equals = function(e) {
  1290. return this.x == e.x && this.y == e.y
  1291. };
  1292. a.distance = function(e, a) {
  1293. return Math.sqrt((e.x - a.x) * (e.x - a.x) + (e.y - a.y) * (e.y - a.y))
  1294. };
  1295. a.identity = new a(0, 0);
  1296. return a
  1297. } (b.HashObject);
  1298. b.Point = c;
  1299. c.prototype.__class__ = "egret.Point"
  1300. })(egret || (egret = {}));
  1301. __extends = this.__extends ||
  1302. function(b, c) {
  1303. function d() {
  1304. this.constructor = b
  1305. }
  1306. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1307. d.prototype = c.prototype;
  1308. b.prototype = new d
  1309. }; (function(b) {
  1310. var c = function(b) {
  1311. function a(e, a, m, c) {
  1312. void 0 === e && (e = 0);
  1313. void 0 === a && (a = 0);
  1314. void 0 === m && (m = 0);
  1315. void 0 === c && (c = 0);
  1316. b.call(this);
  1317. this.x = e;
  1318. this.y = a;
  1319. this.width = m;
  1320. this.height = c
  1321. }
  1322. __extends(a, b);
  1323. Object.defineProperty(a.prototype, "right", {
  1324. get: function() {
  1325. return this.x + this.width
  1326. },
  1327. set: function(e) {
  1328. this.width = e - this.x
  1329. },
  1330. enumerable: !0,
  1331. configurable: !0
  1332. });
  1333. Object.defineProperty(a.prototype, "bottom", {
  1334. get: function() {
  1335. return this.y + this.height
  1336. },
  1337. set: function(e) {
  1338. this.height = e - this.y
  1339. },
  1340. enumerable: !0,
  1341. configurable: !0
  1342. });
  1343. a.prototype.initialize = function(e, a, b, d) {
  1344. this.x = e;
  1345. this.y = a;
  1346. this.width = b;
  1347. this.height = d;
  1348. return this
  1349. };
  1350. a.prototype.contains = function(e, a) {
  1351. return this.x <= e && this.x + this.width >= e && this.y <= a && this.y + this.height >= a
  1352. };
  1353. a.prototype.intersects = function(e) {
  1354. return Math.max(this.x, e.x) <= Math.min(this.right, e.right) && Math.max(this.y, e.y) <= Math.min(this.bottom, e.bottom)
  1355. };
  1356. a.prototype.setEmpty = function() {
  1357. this.height = this.width = this.y = this.x = 0
  1358. };
  1359. a.prototype.clone = function() {
  1360. return new a(this.x, this.y, this.width, this.height)
  1361. };
  1362. a.prototype.containsPoint = function(e) {
  1363. return this.x < e.x && this.x + this.width > e.x && this.y < e.y && this.y + this.height > e.y ? !0 : !1
  1364. };
  1365. a.identity = new a(0, 0, 0, 0);
  1366. return a
  1367. } (b.HashObject);
  1368. b.Rectangle = c;
  1369. c.prototype.__class__ = "egret.Rectangle"
  1370. })(egret || (egret = {}));
  1371. __extends = this.__extends ||
  1372. function(b, c) {
  1373. function d() {
  1374. this.constructor = b
  1375. }
  1376. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1377. d.prototype = c.prototype;
  1378. b.prototype = new d
  1379. }; (function(b) {
  1380. var c = function(d) {
  1381. function a() {
  1382. d.call(this);
  1383. this._isSupportDOMParser = this._xmlDict = this._parser = null;
  1384. this._xmlDict = {};
  1385. window.DOMParser ? (this._isSupportDOMParser = !0, this._parser = new DOMParser) : this._isSupportDOMParser = !1
  1386. }
  1387. __extends(a, d);
  1388. a.getInstance = function() {
  1389. a._instance || (a._instance = new a);
  1390. return a._instance
  1391. };
  1392. a.prototype.parserXML = function(e) {
  1393. for (var a = 0;
  1394. "\n" == e.charAt(a) || "\t" == e.charAt(a) || "\r" == e.charAt(a) || " " == e.charAt(a);) a++;
  1395. 0 != a && (e = e.substring(a, e.length));
  1396. this._isSupportDOMParser ? a = this._parser.parseFromString(e, "text/xml") : (a = new ActiveXObject("Microsoft.XMLDOM"), a.async = "false", a.loadXML(e));
  1397. null == a && b.Logger.infoWithErrorId(1015);
  1398. return a
  1399. };
  1400. a._instance = null;
  1401. return a
  1402. } (b.HashObject);
  1403. b.SAXParser = c;
  1404. c.prototype.__class__ = "egret.SAXParser"
  1405. })(egret || (egret = {}));
  1406. __extends = this.__extends ||
  1407. function(b, c) {
  1408. function d() {
  1409. this.constructor = b
  1410. }
  1411. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1412. d.prototype = c.prototype;
  1413. b.prototype = new d
  1414. }; (function(b) {
  1415. var c = function(e) {
  1416. function k() {
  1417. e.call(this);
  1418. this._designHeight = this._designWidth = 0;
  1419. this._scaleY = this._scaleX = 1;
  1420. this._stageHeight = this._stageWidth = this._offSetY = 0
  1421. }
  1422. __extends(k, e);
  1423. k.getInstance = function() {
  1424. null == k.instance && (a.initialize(), k.instance = new k);
  1425. return k.instance
  1426. };
  1427. k.prototype.setDesignSize = function(e, a, k) {
  1428. this._designWidth = e;
  1429. this._designHeight = a;
  1430. k && (b.Logger.warningWithErrorId(1001), this._setResolutionPolicy(k))
  1431. };
  1432. k.prototype._setResolutionPolicy = function(e) {
  1433. this._resolutionPolicy = e;
  1434. e.init(this);
  1435. e._apply(this, this._designWidth, this._designHeight)
  1436. };
  1437. k.prototype.getScaleX = function() {
  1438. return this._scaleX
  1439. };
  1440. k.prototype.getScaleY = function() {
  1441. return this._scaleY
  1442. };
  1443. k.prototype.getOffSetY = function() {
  1444. return this._offSetY
  1445. };
  1446. k.canvas_name = "egretCanvas";
  1447. k.canvas_div_name = "gameDiv";
  1448. return k
  1449. } (b.HashObject);
  1450. b.StageDelegate = c;
  1451. c.prototype.__class__ = "egret.StageDelegate";
  1452. var d = function() {
  1453. function e(a, b) {
  1454. this._containerStrategy = a;
  1455. this._contentStrategy = b
  1456. }
  1457. e.prototype.init = function(e) {
  1458. this._containerStrategy.init(e);
  1459. this._contentStrategy.init(e)
  1460. };
  1461. e.prototype._apply = function(e, a, b) {
  1462. this._containerStrategy._apply(e, a, b);
  1463. this._contentStrategy._apply(e, a, b)
  1464. };
  1465. return e
  1466. } ();
  1467. b.ResolutionPolicy = d;
  1468. d.prototype.__class__ = "egret.ResolutionPolicy";
  1469. var a = function() {
  1470. function a() {}
  1471. a.initialize = function() {
  1472. a.EQUAL_TO_FRAME = new e
  1473. };
  1474. a.prototype.init = function(e) {};
  1475. a.prototype._apply = function(e, a, b) {};
  1476. a.prototype._setupContainer = function() {
  1477. var e = document.body,
  1478. a;
  1479. e && (a = e.style) && (a.paddingTop = a.paddingTop || "0px", a.paddingRight = a.paddingRight || "0px", a.paddingBottom = a.paddingBottom || "0px", a.paddingLeft = a.paddingLeft || "0px", a.borderTop = a.borderTop || "0px", a.borderRight = a.borderRight || "0px", a.borderBottom = a.borderBottom || "0px", a.borderLeft = a.borderLeft || "0px", a.marginTop = a.marginTop || "0px", a.marginRight = a.marginRight || "0px", a.marginBottom = a.marginBottom || "0px", a.marginLeft = a.marginLeft || "0px")
  1480. };
  1481. return a
  1482. } ();
  1483. b.ContainerStrategy = a;
  1484. a.prototype.__class__ = "egret.ContainerStrategy";
  1485. var e = function(e) {
  1486. function a() {
  1487. e.apply(this, arguments)
  1488. }
  1489. __extends(a, e);
  1490. a.prototype._apply = function(e) {
  1491. this._setupContainer()
  1492. };
  1493. return a
  1494. } (a);
  1495. b.EqualToFrame = e;
  1496. e.prototype.__class__ = "egret.EqualToFrame";
  1497. d = function() {
  1498. function e() {}
  1499. e.prototype.init = function(e) {};
  1500. e.prototype._apply = function(e, a, b) {};
  1501. e.prototype.setEgretSize = function(e, a, k, m, d, p) {
  1502. void 0 === p && (p = 0);
  1503. b.StageDelegate.getInstance()._stageWidth = Math.round(e);
  1504. b.StageDelegate.getInstance()._stageHeight = Math.round(a);
  1505. e = document.getElementById(c.canvas_div_name);
  1506. e.style.width = k + "px";
  1507. e.style.height = m + "px";
  1508. e.style.top = p + "px"
  1509. };
  1510. e.prototype._getClientWidth = function() {
  1511. return document.documentElement.clientWidth
  1512. };
  1513. e.prototype._getClientHeight = function() {
  1514. return document.documentElement.clientHeight
  1515. };
  1516. return e
  1517. } ();
  1518. b.ContentStrategy = d;
  1519. d.prototype.__class__ = "egret.ContentStrategy";
  1520. var k = function(e) {
  1521. function a(b) {
  1522. void 0 === b && (b = 0);
  1523. e.call(this);
  1524. this.minWidth = NaN;
  1525. this.minWidth = b
  1526. }
  1527. __extends(a, e);
  1528. a.prototype._apply = function(e, a, b) {
  1529. a = this._getClientWidth();
  1530. var k = this._getClientHeight(),
  1531. m = k / b,
  1532. d = a / m,
  1533. c = 1;
  1534. 0 != this.minWidth && (c = Math.min(1, d / this.minWidth));
  1535. this.setEgretSize(d / c, b, a, k * c);
  1536. e._scaleX = m * c;
  1537. e._scaleY = m * c
  1538. };
  1539. return a
  1540. } (d);
  1541. b.FixedHeight = k;
  1542. k.prototype.__class__ = "egret.FixedHeight";
  1543. k = function(e) {
  1544. function a(b) {
  1545. void 0 === b && (b = 0);
  1546. e.call(this);
  1547. this.minHeight = NaN;
  1548. this.minHeight = b
  1549. }
  1550. __extends(a, e);
  1551. a.prototype._apply = function(e, a, b) {
  1552. b = this._getClientWidth();
  1553. var k = this._getClientHeight(),
  1554. m = b / a,
  1555. d = k / m,
  1556. c = 1;
  1557. 0 != this.minHeight && (c = Math.min(1, d / this.minHeight));
  1558. this.setEgretSize(a, d / c, b * c, k, b * (1 - c) / 2);
  1559. e._scaleX = m * c;
  1560. e._scaleY = m * c
  1561. };
  1562. return a
  1563. } (d);
  1564. b.FixedWidth = k;
  1565. k.prototype.__class__ = "egret.FixedWidth";
  1566. k = function(e) {
  1567. function a(b, k) {
  1568. e.call(this);
  1569. this.width = b;
  1570. this.height = k
  1571. }
  1572. __extends(a, e);
  1573. a.prototype._apply = function(e, a, b) {
  1574. b = this.width;
  1575. var k = this.height,
  1576. m = b / a;
  1577. this.setEgretSize(a, k / m, b, k);
  1578. e._scaleX = m;
  1579. e._scaleY = m
  1580. };
  1581. return a
  1582. } (d);
  1583. b.FixedSize = k;
  1584. k.prototype.__class__ = "egret.FixedSize";
  1585. k = function(e) {
  1586. function a() {
  1587. e.call(this)
  1588. }
  1589. __extends(a, e);
  1590. a.prototype._apply = function(e, a, b) {
  1591. this.setEgretSize(a, b, a, b, Math.floor((a - a) / 2));
  1592. e._scaleX = 1;
  1593. e._scaleY = 1
  1594. };
  1595. return a
  1596. } (d);
  1597. b.NoScale = k;
  1598. k.prototype.__class__ = "egret.NoScale";
  1599. k = function(e) {
  1600. function a() {
  1601. e.call(this)
  1602. }
  1603. __extends(a, e);
  1604. a.prototype._apply = function(e, a, b) {
  1605. var k = this._getClientWidth(),
  1606. m = this._getClientHeight(),
  1607. d = k,
  1608. c = m,
  1609. h = d / a < c / b ? d / a: c / b,
  1610. d = a * h,
  1611. c = b * h,
  1612. k = Math.floor((k - d) / 2);
  1613. e._offSetY = Math.floor((m - c) / 2);
  1614. this.setEgretSize(a, b / 1, 1 * d, c, k, e._offSetY);
  1615. e._scaleX = 1 * h;
  1616. e._scaleY = 1 * h
  1617. };
  1618. return a
  1619. } (d);
  1620. b.ShowAll = k;
  1621. k.prototype.__class__ = "egret.ShowAll";
  1622. d = function(e) {
  1623. function a() {
  1624. e.call(this)
  1625. }
  1626. __extends(a, e);
  1627. a.prototype._apply = function(e, a, b) {
  1628. var k = this._getClientWidth(),
  1629. m = this._getClientHeight(),
  1630. k = k / a,
  1631. m = m / b;
  1632. this.setEgretSize(a, b, a * k, b * m);
  1633. e._scaleX = k;
  1634. e._scaleY = m
  1635. };
  1636. return a
  1637. } (d);
  1638. b.FullScreen = d;
  1639. d.prototype.__class__ = "egret.FullScreen"
  1640. })(egret || (egret = {}));
  1641. __extends = this.__extends ||
  1642. function(b, c) {
  1643. function d() {
  1644. this.constructor = b
  1645. }
  1646. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1647. d.prototype = c.prototype;
  1648. b.prototype = new d
  1649. }; (function(b) {
  1650. var c = function(d) {
  1651. function a() {
  1652. d.call(this);
  1653. this._originalData = {};
  1654. this._drawAreaList = []
  1655. }
  1656. __extends(a, d);
  1657. a.getInstance = function() {
  1658. null == a.instance && (a.instance = new a);
  1659. return a.instance
  1660. };
  1661. a.prototype.addDrawArea = function(e) {
  1662. this._drawAreaList.push(e)
  1663. };
  1664. a.prototype.clearDrawArea = function() {
  1665. this._drawAreaList = []
  1666. };
  1667. a.prototype.drawImage = function(e, k, m, d, c, f, l, n, p, q, r) {
  1668. void 0 === r && (r = void 0);
  1669. l = l || 0;
  1670. n = n || 0;
  1671. var t = k._texture_to_render;
  1672. if (null != t && 0 != f && 0 != c && 0 != p && 0 != q) {
  1673. var s = b.MainContext.instance.rendererContext._texture_scale_factor;
  1674. c /= s;
  1675. f /= s;
  1676. if (0 != this._drawAreaList.length && b.MainContext.instance.rendererContext._cacheCanvasContext) {
  1677. s = b.DisplayObject.getTransformBounds(k._getSize(a.identityRectangle), k._worldTransform);
  1678. k._worldBounds.initialize(s.x, s.y, s.width, s.height);
  1679. s = this._originalData;
  1680. s.sourceX = m;
  1681. s.sourceY = d;
  1682. s.sourceWidth = c;
  1683. s.sourceHeight = f;
  1684. s.destX = l;
  1685. s.destY = n;
  1686. s.destWidth = p;
  1687. s.destHeight = q;
  1688. for (var u = this.getDrawAreaList(), w = 0; w < u.length; w++) if (!this.ignoreRender(k, u[w], s.destX, s.destY)) {
  1689. e.drawImage(t, m, d, c, f, l, n, p, q, r);
  1690. break
  1691. }
  1692. } else e.drawImage(t, m, d, c, f, l, n, p, q, r)
  1693. }
  1694. };
  1695. a.prototype.ignoreRender = function(e, a, b, d) {
  1696. var c = e._worldBounds;
  1697. b *= e._worldTransform.a;
  1698. d *= e._worldTransform.d;
  1699. return c.x + c.width + b <= a.x || c.x + b >= a.x + a.width || c.y + c.height + d <= a.y || c.y + d >= a.y + a.height ? !0 : !1
  1700. };
  1701. a.prototype.getDrawAreaList = function() {
  1702. var e;
  1703. 0 == this._drawAreaList.length ? (this._defaultDrawAreaList || (this._defaultDrawAreaList = [new b.Rectangle(0, 0, b.MainContext.instance.stage.stageWidth, b.MainContext.instance.stage.stageHeight)], b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)), e = this._defaultDrawAreaList) : e = this._drawAreaList;
  1704. return e
  1705. };
  1706. a.prototype.onResize = function() {
  1707. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this);
  1708. this._defaultDrawAreaList = null
  1709. };
  1710. a.identityRectangle = new b.Rectangle;
  1711. return a
  1712. } (b.HashObject);
  1713. b.RenderFilter = c;
  1714. c.prototype.__class__ = "egret.RenderFilter"
  1715. })(egret || (egret = {})); (function(b) {
  1716. var c = function() {
  1717. function d() {}
  1718. d.mapClass = function(a, e, b) {
  1719. void 0 === b && (b = "");
  1720. a = this.getKey(a) + "#" + b;
  1721. this.mapClassDic[a] = e
  1722. };
  1723. d.getKey = function(a) {
  1724. return "string" == typeof a ? a: b.getQualifiedClassName(a)
  1725. };
  1726. d.mapValue = function(a, e, b) {
  1727. void 0 === b && (b = "");
  1728. a = this.getKey(a) + "#" + b;
  1729. this.mapValueDic[a] = e
  1730. };
  1731. d.hasMapRule = function(a, e) {
  1732. void 0 === e && (e = "");
  1733. var b = this.getKey(a) + "#" + e;
  1734. return this.mapValueDic[b] || this.mapClassDic[b] ? !0 : !1
  1735. };
  1736. d.getInstance = function(a, e) {
  1737. void 0 === e && (e = "");
  1738. var k = this.getKey(a) + "#" + e;
  1739. if (this.mapValueDic[k]) return this.mapValueDic[k];
  1740. var d = this.mapClassDic[k];
  1741. if (d) return d = new d,
  1742. this.mapValueDic[k] = d,
  1743. delete this.mapClassDic[k],
  1744. d;
  1745. throw Error(b.getString(1028, k));
  1746. };
  1747. d.mapClassDic = {};
  1748. d.mapValueDic = {};
  1749. return d
  1750. } ();
  1751. b.Injector = c;
  1752. c.prototype.__class__ = "egret.Injector"
  1753. })(egret || (egret = {})); (function(b) {
  1754. var c = function() {
  1755. return function() {
  1756. this.type = null
  1757. }
  1758. } ();
  1759. b.Filter = c;
  1760. c.prototype.__class__ = "egret.Filter"
  1761. })(egret || (egret = {}));
  1762. __extends = this.__extends ||
  1763. function(b, c) {
  1764. function d() {
  1765. this.constructor = b
  1766. }
  1767. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1768. d.prototype = c.prototype;
  1769. b.prototype = new d
  1770. }; (function(b) {
  1771. var c = function(b) {
  1772. function a(e, a) {
  1773. b.call(this);
  1774. this.blurX = e;
  1775. this.blurY = a;
  1776. this.type = "blur"
  1777. }
  1778. __extends(a, b);
  1779. return a
  1780. } (b.Filter);
  1781. b.BlurFilter = c;
  1782. c.prototype.__class__ = "egret.BlurFilter"
  1783. })(egret || (egret = {})); (function(b) {
  1784. var c = function() {
  1785. function b() {}
  1786. b.NORMAL = "normal";
  1787. b.ADD = "add";
  1788. return b
  1789. } ();
  1790. b.BlendMode = c;
  1791. c.prototype.__class__ = "egret.BlendMode"
  1792. })(egret || (egret = {}));
  1793. __extends = this.__extends ||
  1794. function(b, c) {
  1795. function d() {
  1796. this.constructor = b
  1797. }
  1798. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  1799. d.prototype = c.prototype;
  1800. b.prototype = new d
  1801. }; (function(b) {
  1802. var c = function(d) {
  1803. function a() {
  1804. d.call(this);
  1805. this.__hack_local_matrix = null;
  1806. this._sizeDirty = this._normalDirty = !0;
  1807. this._parent = this._texture_to_render = this.name = this._sizeChangeCallTarget = this._sizeChangeCallBack = null;
  1808. this._y = this._x = 0;
  1809. this._scaleY = this._scaleX = 1;
  1810. this._anchorY = this._anchorX = this._anchorOffsetY = this._anchorOffsetX = 0;
  1811. this._visible = !0;
  1812. this._rotation = 0;
  1813. this._alpha = 1;
  1814. this._skewY = this._skewX = 0;
  1815. this._touchEnabled = !1;
  1816. this._scrollRect = this.blendMode = null;
  1817. this._explicitHeight = this._explicitWidth = NaN;
  1818. this._hasHeightSet = this._hasWidthSet = !1;
  1819. this._worldBounds = this.mask = null;
  1820. this.worldAlpha = 1;
  1821. this.needDraw = this._isContainer = !1;
  1822. this._hitTestPointTexture = null;
  1823. this._rectH = this._rectW = 0;
  1824. this._stage = null;
  1825. this._cacheAsBitmap = !1;
  1826. this.renderTexture = null;
  1827. this._cacheDirty = !1;
  1828. this._filter = this._colorTransform = null;
  1829. this._worldTransform = new b.Matrix;
  1830. this._worldBounds = new b.Rectangle(0, 0, 0, 0);
  1831. this._cacheBounds = new b.Rectangle(0, 0, 0, 0)
  1832. }
  1833. __extends(a, d);
  1834. a.prototype._setDirty = function() {
  1835. this._normalDirty = !0
  1836. };
  1837. a.prototype.getDirty = function() {
  1838. return this._normalDirty || this._sizeDirty
  1839. };
  1840. a.prototype._setParentSizeDirty = function() {
  1841. var e = this._parent; ! e || e._hasWidthSet || e._hasHeightSet || e._setSizeDirty()
  1842. };
  1843. a.prototype._setSizeDirty = function() {
  1844. this._sizeDirty || (this._sizeDirty = !0, this._setDirty(), this._setCacheDirty(), this._setParentSizeDirty(), null != this._sizeChangeCallBack && (this._sizeChangeCallTarget == this._parent ? this._sizeChangeCallBack.call(this._sizeChangeCallTarget) : this._sizeChangeCallTarget = this._sizeChangeCallBack = null))
  1845. };
  1846. a.prototype._clearDirty = function() {
  1847. this._normalDirty = !1
  1848. };
  1849. a.prototype._clearSizeDirty = function() {
  1850. this._sizeDirty = !1
  1851. };
  1852. Object.defineProperty(a.prototype, "parent", {
  1853. get: function() {
  1854. return this._parent
  1855. },
  1856. enumerable: !0,
  1857. configurable: !0
  1858. });
  1859. a.prototype._parentChanged = function(e) {
  1860. this._parent = e
  1861. };
  1862. Object.defineProperty(a.prototype, "x", {
  1863. get: function() {
  1864. return this._x
  1865. },
  1866. set: function(e) {
  1867. this._setX(e)
  1868. },
  1869. enumerable: !0,
  1870. configurable: !0
  1871. });
  1872. a.prototype._setX = function(e) {
  1873. b.NumberUtils.isNumber(e) && this._x != e && (this._x = e, this._setDirty(), this._setParentSizeDirty())
  1874. };
  1875. Object.defineProperty(a.prototype, "y", {
  1876. get: function() {
  1877. return this._y
  1878. },
  1879. set: function(e) {
  1880. this._setY(e)
  1881. },
  1882. enumerable: !0,
  1883. configurable: !0
  1884. });
  1885. a.prototype._setY = function(e) {
  1886. b.NumberUtils.isNumber(e) && this._y != e && (this._y = e, this._setDirty(), this._setParentSizeDirty())
  1887. };
  1888. Object.defineProperty(a.prototype, "scaleX", {
  1889. get: function() {
  1890. return this._scaleX
  1891. },
  1892. set: function(e) {
  1893. b.NumberUtils.isNumber(e) && this._scaleX != e && (this._scaleX = e, this._setDirty(), this._setParentSizeDirty())
  1894. },
  1895. enumerable: !0,
  1896. configurable: !0
  1897. });
  1898. Object.defineProperty(a.prototype, "scaleY", {
  1899. get: function() {
  1900. return this._scaleY
  1901. },
  1902. set: function(e) {
  1903. b.NumberUtils.isNumber(e) && this._scaleY != e && (this._scaleY = e, this._setDirty(), this._setParentSizeDirty())
  1904. },
  1905. enumerable: !0,
  1906. configurable: !0
  1907. });
  1908. Object.defineProperty(a.prototype, "anchorOffsetX", {
  1909. get: function() {
  1910. return this._anchorOffsetX
  1911. },
  1912. set: function(e) {
  1913. b.NumberUtils.isNumber(e) && this._anchorOffsetX != e && (this._anchorOffsetX = e, this._setDirty(), this._setParentSizeDirty())
  1914. },
  1915. enumerable: !0,
  1916. configurable: !0
  1917. });
  1918. Object.defineProperty(a.prototype, "anchorOffsetY", {
  1919. get: function() {
  1920. return this._anchorOffsetY
  1921. },
  1922. set: function(e) {
  1923. b.NumberUtils.isNumber(e) && this._anchorOffsetY != e && (this._anchorOffsetY = e, this._setDirty(), this._setParentSizeDirty())
  1924. },
  1925. enumerable: !0,
  1926. configurable: !0
  1927. });
  1928. Object.defineProperty(a.prototype, "anchorX", {
  1929. get: function() {
  1930. return this._anchorX
  1931. },
  1932. set: function(e) {
  1933. this._setAnchorX(e)
  1934. },
  1935. enumerable: !0,
  1936. configurable: !0
  1937. });
  1938. a.prototype._setAnchorX = function(e) {
  1939. b.NumberUtils.isNumber(e) && this._anchorX != e && (this._anchorX = e, this._setDirty(), this._setParentSizeDirty())
  1940. };
  1941. Object.defineProperty(a.prototype, "anchorY", {
  1942. get: function() {
  1943. return this._anchorY
  1944. },
  1945. set: function(e) {
  1946. this._setAnchorY(e)
  1947. },
  1948. enumerable: !0,
  1949. configurable: !0
  1950. });
  1951. a.prototype._setAnchorY = function(e) {
  1952. b.NumberUtils.isNumber(e) && this._anchorY != e && (this._anchorY = e, this._setDirty(), this._setParentSizeDirty())
  1953. };
  1954. Object.defineProperty(a.prototype, "visible", {
  1955. get: function() {
  1956. return this._visible
  1957. },
  1958. set: function(e) {
  1959. this._setVisible(e)
  1960. },
  1961. enumerable: !0,
  1962. configurable: !0
  1963. });
  1964. a.prototype._setVisible = function(e) {
  1965. this._visible != e && (this._visible = e, this._setSizeDirty())
  1966. };
  1967. Object.defineProperty(a.prototype, "rotation", {
  1968. get: function() {
  1969. return this._rotation
  1970. },
  1971. set: function(e) {
  1972. b.NumberUtils.isNumber(e) && this._rotation != e && (this._rotation = e, this._setParentSizeDirty())
  1973. },
  1974. enumerable: !0,
  1975. configurable: !0
  1976. });
  1977. Object.defineProperty(a.prototype, "alpha", {
  1978. get: function() {
  1979. return this._alpha
  1980. },
  1981. set: function(e) {
  1982. b.NumberUtils.isNumber(e) && this._alpha != e && (this._alpha = e, this._setDirty(), this._setCacheDirty())
  1983. },
  1984. enumerable: !0,
  1985. configurable: !0
  1986. });
  1987. Object.defineProperty(a.prototype, "skewX", {
  1988. get: function() {
  1989. return this._skewX
  1990. },
  1991. set: function(e) {
  1992. b.NumberUtils.isNumber(e) && this._skewX != e && (this._skewX = e, this._setParentSizeDirty())
  1993. },
  1994. enumerable: !0,
  1995. configurable: !0
  1996. });
  1997. Object.defineProperty(a.prototype, "skewY", {
  1998. get: function() {
  1999. return this._skewY
  2000. },
  2001. set: function(e) {
  2002. b.NumberUtils.isNumber(e) && this._skewY != e && (this._skewY = e, this._setParentSizeDirty())
  2003. },
  2004. enumerable: !0,
  2005. configurable: !0
  2006. });
  2007. Object.defineProperty(a.prototype, "touchEnabled", {
  2008. get: function() {
  2009. return this._touchEnabled
  2010. },
  2011. set: function(e) {
  2012. this._setTouchEnabled(e)
  2013. },
  2014. enumerable: !0,
  2015. configurable: !0
  2016. });
  2017. a.prototype._setTouchEnabled = function(e) {
  2018. this._touchEnabled = e
  2019. };
  2020. Object.defineProperty(a.prototype, "scrollRect", {
  2021. get: function() {
  2022. return this._scrollRect
  2023. },
  2024. set: function(e) {
  2025. this._setScrollRect(e)
  2026. },
  2027. enumerable: !0,
  2028. configurable: !0
  2029. });
  2030. a.prototype._setScrollRect = function(e) {
  2031. this._scrollRect = e;
  2032. this._setSizeDirty()
  2033. };
  2034. Object.defineProperty(a.prototype, "measuredWidth", {
  2035. get: function() {
  2036. return this._measureBounds().width
  2037. },
  2038. enumerable: !0,
  2039. configurable: !0
  2040. });
  2041. Object.defineProperty(a.prototype, "measuredHeight", {
  2042. get: function() {
  2043. return this._measureBounds().height
  2044. },
  2045. enumerable: !0,
  2046. configurable: !0
  2047. });
  2048. Object.defineProperty(a.prototype, "explicitWidth", {
  2049. get: function() {
  2050. return this._explicitWidth
  2051. },
  2052. enumerable: !0,
  2053. configurable: !0
  2054. });
  2055. Object.defineProperty(a.prototype, "explicitHeight", {
  2056. get: function() {
  2057. return this._explicitHeight
  2058. },
  2059. enumerable: !0,
  2060. configurable: !0
  2061. });
  2062. Object.defineProperty(a.prototype, "width", {
  2063. get: function() {
  2064. return this._getSize(b.Rectangle.identity).width
  2065. },
  2066. set: function(e) {
  2067. this._setWidth(e)
  2068. },
  2069. enumerable: !0,
  2070. configurable: !0
  2071. });
  2072. Object.defineProperty(a.prototype, "height", {
  2073. get: function() {
  2074. return this._getSize(b.Rectangle.identity).height
  2075. },
  2076. set: function(e) {
  2077. this._setHeight(e)
  2078. },
  2079. enumerable: !0,
  2080. configurable: !0
  2081. });
  2082. a.prototype._setWidth = function(e) {
  2083. this._setSizeDirty();
  2084. this._setCacheDirty();
  2085. this._explicitWidth = e;
  2086. this._hasWidthSet = b.NumberUtils.isNumber(e)
  2087. };
  2088. a.prototype._setHeight = function(e) {
  2089. this._setSizeDirty();
  2090. this._setCacheDirty();
  2091. this._explicitHeight = e;
  2092. this._hasHeightSet = b.NumberUtils.isNumber(e)
  2093. };
  2094. a.prototype._draw = function(e) {
  2095. if (this._visible && !this.drawCacheTexture(e)) {
  2096. var a = b.MainContext.__use_new_draw && this._isContainer;
  2097. this._filter && !a && e.setGlobalFilter(this._filter);
  2098. this._colorTransform && !a && e.setGlobalColorTransform(this._colorTransform.matrix);
  2099. e.setAlpha(this.worldAlpha, this.blendMode);
  2100. e.setTransform(this._worldTransform);
  2101. var d = this.mask || this._scrollRect;
  2102. d && !a && e.pushMask(d);
  2103. this._render(e);
  2104. d && !a && e.popMask();
  2105. this._colorTransform && !a && e.setGlobalColorTransform(null);
  2106. this._filter && !a && e.setGlobalFilter(null)
  2107. }
  2108. this.destroyCacheBounds()
  2109. };
  2110. a.prototype._setGlobalFilter = function(e) {
  2111. e.setGlobalFilter(this._filter)
  2112. };
  2113. a.prototype._removeGlobalFilter = function(e) {
  2114. e.setGlobalFilter(null)
  2115. };
  2116. a.prototype._setGlobalColorTransform = function(e) {
  2117. e.setGlobalColorTransform(this._colorTransform.matrix)
  2118. };
  2119. a.prototype._removeGlobalColorTransform = function(e) {
  2120. e.setGlobalColorTransform(null)
  2121. };
  2122. a.prototype._pushMask = function(e) {
  2123. e.setTransform(this._worldTransform);
  2124. var a = this.mask || this._scrollRect;
  2125. a && e.pushMask(a)
  2126. };
  2127. a.prototype._popMask = function(e) {
  2128. e.popMask()
  2129. };
  2130. a.prototype.drawCacheTexture = function(e) {
  2131. if (!1 == this._cacheAsBitmap) return ! 1;
  2132. var a = this.getBounds(b.Rectangle.identity),
  2133. d = b.MainContext.instance.rendererContext._texture_scale_factor;
  2134. if (this._cacheDirty || null == this._texture_to_render || Math.round(a.width) != Math.round(this._texture_to_render._sourceWidth * d) || Math.round(a.height) != Math.round(this._texture_to_render._sourceHeight * d)) this._cacheDirty = !this._makeBitmapCache();
  2135. if (null == this._texture_to_render) return ! 1;
  2136. var c = this._texture_to_render,
  2137. a = c._offsetX,
  2138. d = c._offsetY,
  2139. g = c._textureWidth,
  2140. c = c._textureHeight;
  2141. this._updateTransform();
  2142. e.setAlpha(this.worldAlpha, this.blendMode);
  2143. e.setTransform(this._worldTransform);
  2144. b.RenderFilter.getInstance().drawImage(e, this, 0, 0, g, c, a, d, g, c);
  2145. return ! 0
  2146. };
  2147. a.prototype._updateTransform = function() {
  2148. this._calculateWorldTransform();
  2149. "updateTransform" == b.MainContext._renderLoopPhase && (this.needDraw || this._texture_to_render || this._cacheAsBitmap) && b.RenderCommand.push(this._draw, this)
  2150. };
  2151. a.prototype._calculateWorldTransform = function() {
  2152. var e = this._worldTransform,
  2153. a = this._parent;
  2154. e.identityMatrix(a._worldTransform);
  2155. this._getMatrix(e);
  2156. var b = this._scrollRect;
  2157. b && e.append(1, 0, 0, 1, -b.x, -b.y);
  2158. this.worldAlpha = a.worldAlpha * this._alpha
  2159. };
  2160. a.prototype._render = function(e) {};
  2161. a.prototype.getBounds = function(e, a) {
  2162. void 0 === a && (a = !0);
  2163. var d = this._measureBounds(),
  2164. c = this._hasWidthSet ? this._explicitWidth: d.width,
  2165. g = this._hasHeightSet ? this._explicitHeight: d.height;
  2166. this._rectW = d.width;
  2167. this._rectH = d.height;
  2168. this._clearSizeDirty();
  2169. var f = d.x,
  2170. d = d.y,
  2171. l = 0,
  2172. n = 0;
  2173. a && (0 != this._anchorX || 0 != this._anchorY ? (l = c * this._anchorX, n = g * this._anchorY) : (l = this._anchorOffsetX, n = this._anchorOffsetY));
  2174. this._cacheBounds.initialize(f - l, d - n, c, g);
  2175. c = this._cacheBounds;
  2176. e || (e = new b.Rectangle);
  2177. return e.initialize(c.x, c.y, c.width, c.height)
  2178. };
  2179. a.prototype.destroyCacheBounds = function() {
  2180. this._cacheBounds.x = 0;
  2181. this._cacheBounds.y = 0;
  2182. this._cacheBounds.width = 0;
  2183. this._cacheBounds.height = 0
  2184. };
  2185. a.prototype._getConcatenatedMatrix = function() {
  2186. for (var e = a.identityMatrixForGetConcatenated.identity(), k = this; null != k;) {
  2187. if (0 != k._anchorX || 0 != k._anchorY) {
  2188. var d = k._getSize(b.Rectangle.identity);
  2189. e.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, d.width * k._anchorX, d.height * k._anchorY)
  2190. } else e.prependTransform(k._x, k._y, k._scaleX, k._scaleY, k._rotation, k._skewX, k._skewY, k._anchorOffsetX, k._anchorOffsetY);
  2191. k._scrollRect && e.prepend(1, 0, 0, 1, -k._scrollRect.x, -k._scrollRect.y);
  2192. k = k._parent
  2193. }
  2194. return e
  2195. };
  2196. a.prototype.localToGlobal = function(e, a, d) {
  2197. void 0 === e && (e = 0);
  2198. void 0 === a && (a = 0);
  2199. var c = this._getConcatenatedMatrix();
  2200. c.append(1, 0, 0, 1, e, a);
  2201. d || (d = new b.Point);
  2202. d.x = c.tx;
  2203. d.y = c.ty;
  2204. return d
  2205. };
  2206. a.prototype.globalToLocal = function(e, a, d) {
  2207. void 0 === e && (e = 0);
  2208. void 0 === a && (a = 0);
  2209. var c = this._getConcatenatedMatrix();
  2210. c.invert();
  2211. c.append(1, 0, 0, 1, e, a);
  2212. d || (d = new b.Point);
  2213. d.x = c.tx;
  2214. d.y = c.ty;
  2215. return d
  2216. };
  2217. a.prototype.hitTest = function(e, a, d) {
  2218. void 0 === d && (d = !1);
  2219. if (!this._visible || !d && !this._touchEnabled) return null;
  2220. d = this.getBounds(b.Rectangle.identity, !1);
  2221. e -= d.x;
  2222. a -= d.y;
  2223. return 0 <= e && e < d.width && 0 <= a && a < d.height ? this.mask || this._scrollRect ? this._scrollRect && e > this._scrollRect.x && a > this._scrollRect.y && e < this._scrollRect.x + this._scrollRect.width && a < this._scrollRect.y + this._scrollRect.height || this.mask && this.mask.x <= e && e < this.mask.x + this.mask.width && this.mask.y <= a && a < this.mask.y + this.mask.height ? this: null: this: null
  2224. };
  2225. a.prototype.hitTestPoint = function(e, a, d) {
  2226. e = this.globalToLocal(e, a);
  2227. return d ? (this._hitTestPointTexture || (this._hitTestPointTexture = new b.RenderTexture), d = this._hitTestPointTexture, d.drawToTexture(this), 0 != d.getPixel32(e.x - this._hitTestPointTexture._offsetX, e.y - this._hitTestPointTexture._offsetY)[3] ? !0 : !1) : !!this.hitTest(e.x, e.y, !0)
  2228. };
  2229. a.prototype._getMatrix = function(e) {
  2230. e || (e = b.Matrix.identity.identity());
  2231. var a, d;
  2232. d = this._getOffsetPoint();
  2233. a = d.x;
  2234. d = d.y;
  2235. var c = this.__hack_local_matrix;
  2236. c ? (e.append(c.a, c.b, c.c, c.d, c.tx, c.ty), e.append(1, 0, 0, 1, -a, -d)) : e.appendTransform(this._x, this._y, this._scaleX, this._scaleY, this._rotation, this._skewX, this._skewY, a, d);
  2237. return e
  2238. };
  2239. a.prototype._getSize = function(e) {
  2240. if (this._hasHeightSet && this._hasWidthSet) return this._clearSizeDirty(),
  2241. e.initialize(0, 0, this._explicitWidth, this._explicitHeight);
  2242. this._measureSize(e);
  2243. this._hasWidthSet && (e.width = this._explicitWidth);
  2244. this._hasHeightSet && (e.height = this._explicitHeight);
  2245. return e
  2246. };
  2247. a.prototype._measureSize = function(e) {
  2248. this._sizeDirty ? (e = this._measureBounds(), this._rectW = e.width, this._rectH = e.height, this._clearSizeDirty()) : (e.width = this._rectW, e.height = this._rectH);
  2249. e.x = 0;
  2250. e.y = 0;
  2251. return e
  2252. };
  2253. a.prototype._measureBounds = function() {
  2254. return b.Rectangle.identity.initialize(0, 0, 0, 0)
  2255. };
  2256. a.prototype._getOffsetPoint = function() {
  2257. var e = this._anchorOffsetX,
  2258. a = this._anchorOffsetY;
  2259. if (0 != this._anchorX || 0 != this._anchorY) a = this._getSize(b.Rectangle.identity),
  2260. e = this._anchorX * a.width,
  2261. a = this._anchorY * a.height;
  2262. var d = b.Point.identity;
  2263. d.x = e;
  2264. d.y = a;
  2265. return d
  2266. };
  2267. a.prototype._onAddToStage = function() {
  2268. this._stage = b.MainContext.instance.stage;
  2269. b.DisplayObjectContainer.__EVENT__ADD_TO_STAGE_LIST.push(this)
  2270. };
  2271. a.prototype._onRemoveFromStage = function() {
  2272. b.DisplayObjectContainer.__EVENT__REMOVE_FROM_STAGE_LIST.push(this)
  2273. };
  2274. Object.defineProperty(a.prototype, "stage", {
  2275. get: function() {
  2276. return this._stage
  2277. },
  2278. enumerable: !0,
  2279. configurable: !0
  2280. });
  2281. a.prototype.addEventListener = function(e, k, m, c, g) {
  2282. void 0 === c && (c = !1);
  2283. void 0 === g && (g = 0);
  2284. d.prototype.addEventListener.call(this, e, k, m, c, g); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._insertEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, k, m, g, this)
  2285. };
  2286. a.prototype.removeEventListener = function(e, k, m, c) {
  2287. void 0 === c && (c = !1);
  2288. d.prototype.removeEventListener.call(this, e, k, m, c); ((c = e == b.Event.ENTER_FRAME) || e == b.Event.RENDER) && this._removeEventBin(c ? a._enterFrameCallBackList: a._renderCallBackList, k, m, this)
  2289. };
  2290. a.prototype.dispatchEvent = function(e) {
  2291. if (!e._bubbles) return d.prototype.dispatchEvent.call(this, e);
  2292. for (var a = [], b = this; b;) a.push(b),
  2293. b = b._parent;
  2294. e._reset();
  2295. this._dispatchPropagationEvent(e, a);
  2296. return ! e._isDefaultPrevented
  2297. };
  2298. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2299. b = a.length;
  2300. for (var d = 1,
  2301. c = b - 1; 0 <= c; c--) {
  2302. var f = a[c];
  2303. e._currentTarget = f;
  2304. e._target = this;
  2305. e._eventPhase = d;
  2306. f._notifyListener(e);
  2307. if (e._isPropagationStopped || e._isPropagationImmediateStopped) return
  2308. }
  2309. f = a[0];
  2310. e._currentTarget = f;
  2311. e._target = this;
  2312. e._eventPhase = 2;
  2313. f._notifyListener(e);
  2314. if (!e._isPropagationStopped && !e._isPropagationImmediateStopped) for (d = 3, c = 1; c < b && (f = a[c], e._currentTarget = f, e._target = this, e._eventPhase = d, f._notifyListener(e), !e._isPropagationStopped && !e._isPropagationImmediateStopped); c++);
  2315. };
  2316. a.prototype.willTrigger = function(e) {
  2317. for (var a = this; a;) {
  2318. if (a.hasEventListener(e)) return ! 0;
  2319. a = a._parent
  2320. }
  2321. return ! 1
  2322. };
  2323. Object.defineProperty(a.prototype, "cacheAsBitmap", {
  2324. get: function() {
  2325. return this._cacheAsBitmap
  2326. },
  2327. set: function(e) { (this._cacheAsBitmap = e) ? b.callLater(this._makeBitmapCache, this) : this._texture_to_render = null
  2328. },
  2329. enumerable: !0,
  2330. configurable: !0
  2331. });
  2332. a.prototype._makeBitmapCache = function() {
  2333. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  2334. var e = this.renderTexture.drawToTexture(this);
  2335. this._texture_to_render = e ? this.renderTexture: null;
  2336. return e
  2337. };
  2338. a.prototype._setCacheDirty = function(e) {
  2339. void 0 === e && (e = !0);
  2340. this._cacheDirty = e
  2341. };
  2342. a.getTransformBounds = function(e, a) {
  2343. var b = e.x,
  2344. d = e.y,
  2345. c = e.width,
  2346. f = e.height; (b || d) && a.appendTransform(0, 0, 1, 1, 0, 0, 0, -b, -d);
  2347. var l = c * a.a,
  2348. c = c * a.b,
  2349. n = f * a.c,
  2350. f = f * a.d,
  2351. p = a.tx,
  2352. q = a.ty,
  2353. r = p,
  2354. t = p,
  2355. s = q,
  2356. u = q; (b = l + p) < r ? r = b: b > t && (t = b); (b = l + n + p) < r ? r = b: b > t && (t = b); (b = n + p) < r ? r = b: b > t && (t = b); (d = c + q) < s ? s = d: d > u && (u = d); (d = c + f + q) < s ? s = d: d > u && (u = d); (d = f + q) < s ? s = d: d > u && (u = d);
  2357. return e.initialize(r, s, t - r, u - s)
  2358. };
  2359. Object.defineProperty(a.prototype, "colorTransform", {
  2360. get: function() {
  2361. return this._colorTransform
  2362. },
  2363. set: function(e) {
  2364. this._colorTransform = e
  2365. },
  2366. enumerable: !0,
  2367. configurable: !0
  2368. });
  2369. Object.defineProperty(a.prototype, "filter", {
  2370. get: function() {
  2371. return this._filter
  2372. },
  2373. set: function(e) {
  2374. this._filter = e
  2375. },
  2376. enumerable: !0,
  2377. configurable: !0
  2378. });
  2379. a.identityMatrixForGetConcatenated = new b.Matrix;
  2380. a._enterFrameCallBackList = [];
  2381. a._renderCallBackList = [];
  2382. return a
  2383. } (b.EventDispatcher);
  2384. b.DisplayObject = c;
  2385. c.prototype.__class__ = "egret.DisplayObject";
  2386. c = function() {
  2387. function b() {
  2388. this.matrix = null
  2389. }
  2390. b.prototype.updateColor = function(a, e, b, d, c, g, f, l) {};
  2391. return b
  2392. } ();
  2393. b.ColorTransform = c;
  2394. c.prototype.__class__ = "egret.ColorTransform"
  2395. })(egret || (egret = {}));
  2396. __extends = this.__extends ||
  2397. function(b, c) {
  2398. function d() {
  2399. this.constructor = b
  2400. }
  2401. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2402. d.prototype = c.prototype;
  2403. b.prototype = new d
  2404. }; (function(b) {
  2405. var c = function(d) {
  2406. function a() {
  2407. d.call(this);
  2408. this._touchChildren = !0;
  2409. this._children = [];
  2410. this._isContainer = !0
  2411. }
  2412. __extends(a, d);
  2413. Object.defineProperty(a.prototype, "touchChildren", {
  2414. get: function() {
  2415. return this._touchChildren
  2416. },
  2417. set: function(e) {
  2418. this._touchChildren = e
  2419. },
  2420. enumerable: !0,
  2421. configurable: !0
  2422. });
  2423. Object.defineProperty(a.prototype, "numChildren", {
  2424. get: function() {
  2425. return this._children.length
  2426. },
  2427. enumerable: !0,
  2428. configurable: !0
  2429. });
  2430. a.prototype.setChildIndex = function(e, a) {
  2431. this.doSetChildIndex(e, a)
  2432. };
  2433. a.prototype.doSetChildIndex = function(e, a) {
  2434. var d = this._children.indexOf(e);
  2435. 0 > d && b.Logger.fatalWithErrorId(1006);
  2436. this._children.splice(d, 1);
  2437. 0 > a || this._children.length <= a ? this._children.push(e) : this._children.splice(a, 0, e)
  2438. };
  2439. a.prototype.addChild = function(e) {
  2440. var a = this._children.length;
  2441. e._parent == this && a--;
  2442. return this._doAddChild(e, a)
  2443. };
  2444. a.prototype.addChildAt = function(e, a) {
  2445. return this._doAddChild(e, a)
  2446. };
  2447. a.prototype._doAddChild = function(e, k, d) {
  2448. void 0 === d && (d = !0);
  2449. if (e == this) return e;
  2450. if (0 > k || k > this._children.length) return b.Logger.fatalWithErrorId(1007),
  2451. e;
  2452. var c = e._parent;
  2453. if (c == this) return this.doSetChildIndex(e, k),
  2454. e;
  2455. if (c) {
  2456. var g = c._children.indexOf(e);
  2457. 0 <= g && c._doRemoveChild(g)
  2458. }
  2459. this._children.splice(k, 0, e);
  2460. e._parentChanged(this);
  2461. d && e.dispatchEventWith(b.Event.ADDED, !0);
  2462. if (this._stage) for (e._onAddToStage(), k = a.__EVENT__ADD_TO_STAGE_LIST; 0 < k.length;) k.shift().dispatchEventWith(b.Event.ADDED_TO_STAGE);
  2463. e._setDirty();
  2464. this._setSizeDirty();
  2465. return e
  2466. };
  2467. a.prototype.removeChild = function(e) {
  2468. e = this._children.indexOf(e);
  2469. if (0 <= e) return this._doRemoveChild(e);
  2470. b.Logger.fatalWithErrorId(1008);
  2471. return null
  2472. };
  2473. a.prototype.removeChildAt = function(e) {
  2474. if (0 <= e && e < this._children.length) return this._doRemoveChild(e);
  2475. b.Logger.fatalWithErrorId(1007);
  2476. return null
  2477. };
  2478. a.prototype._doRemoveChild = function(e, k) {
  2479. void 0 === k && (k = !0);
  2480. var d = this._children,
  2481. c = d[e];
  2482. k && c.dispatchEventWith(b.Event.REMOVED, !0);
  2483. if (this._stage) {
  2484. c._onRemoveFromStage();
  2485. for (var g = a.__EVENT__REMOVE_FROM_STAGE_LIST; 0 < g.length;) {
  2486. var f = g.shift();
  2487. f.dispatchEventWith(b.Event.REMOVED_FROM_STAGE);
  2488. f._stage = null
  2489. }
  2490. }
  2491. c._parentChanged(null);
  2492. d.splice(e, 1);
  2493. this._setSizeDirty();
  2494. return c
  2495. };
  2496. a.prototype.getChildAt = function(e) {
  2497. if (0 <= e && e < this._children.length) return this._children[e];
  2498. b.Logger.fatalWithErrorId(1007);
  2499. return null
  2500. };
  2501. a.prototype.contains = function(e) {
  2502. for (; e;) {
  2503. if (e == this) return ! 0;
  2504. e = e._parent
  2505. }
  2506. return ! 1
  2507. };
  2508. a.prototype.swapChildrenAt = function(e, a) {
  2509. 0 <= e && e < this._children.length && 0 <= a && a < this._children.length ? this._swapChildrenAt(e, a) : b.Logger.fatalWithErrorId(1007)
  2510. };
  2511. a.prototype.swapChildren = function(e, a) {
  2512. var d = this._children.indexOf(e),
  2513. c = this._children.indexOf(a); - 1 == d || -1 == c ? b.Logger.fatalWithErrorId(1008) : this._swapChildrenAt(d, c)
  2514. };
  2515. a.prototype._swapChildrenAt = function(e, a) {
  2516. if (e != a) {
  2517. var b = this._children,
  2518. d = b[e];
  2519. b[e] = b[a];
  2520. b[a] = d
  2521. }
  2522. };
  2523. a.prototype.getChildIndex = function(e) {
  2524. return this._children.indexOf(e)
  2525. };
  2526. a.prototype.removeChildren = function() {
  2527. for (var e = this._children.length - 1; 0 <= e; e--) this._doRemoveChild(e)
  2528. };
  2529. a.prototype._updateTransform = function() {
  2530. if (this._visible) {
  2531. this._filter && b.RenderCommand.push(this._setGlobalFilter, this);
  2532. this._colorTransform && b.RenderCommand.push(this._setGlobalColorTransform, this);
  2533. var e = this.mask || this._scrollRect;
  2534. e && b.RenderCommand.push(this._pushMask, this);
  2535. d.prototype._updateTransform.call(this);
  2536. if (!this._cacheAsBitmap || !this._texture_to_render) for (var a = 0,
  2537. c = this._children.length; a < c; a++) this._children[a]._updateTransform();
  2538. e && b.RenderCommand.push(this._popMask, this);
  2539. this._colorTransform && b.RenderCommand.push(this._removeGlobalColorTransform, this);
  2540. this._filter && b.RenderCommand.push(this._removeGlobalFilter, this)
  2541. }
  2542. };
  2543. a.prototype._render = function(e) {
  2544. if (!b.MainContext.__use_new_draw) for (var a = 0,
  2545. d = this._children.length; a < d; a++) this._children[a]._draw(e)
  2546. };
  2547. a.prototype._measureBounds = function() {
  2548. for (var e = 0,
  2549. a = 0,
  2550. d = 0,
  2551. c = 0,
  2552. g = this._children.length,
  2553. f = 0; f < g; f++) {
  2554. var l = this._children[f];
  2555. if (l._visible) {
  2556. var n = l.getBounds(b.Rectangle.identity, !1),
  2557. p = n.x,
  2558. q = n.y,
  2559. r = n.width,
  2560. n = n.height,
  2561. l = l._getMatrix(),
  2562. l = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p, q, r, n), l),
  2563. p = l.x,
  2564. q = l.y,
  2565. r = l.width + l.x,
  2566. l = l.height + l.y;
  2567. if (p < e || 0 == f) e = p;
  2568. if (r > a || 0 == f) a = r;
  2569. if (q < d || 0 == f) d = q;
  2570. if (l > c || 0 == f) c = l
  2571. }
  2572. }
  2573. return b.Rectangle.identity.initialize(e, d, a - e, c - d)
  2574. };
  2575. a.prototype.hitTest = function(e, a, c) {
  2576. void 0 === c && (c = !1);
  2577. var h;
  2578. if (!this._visible) return null;
  2579. if (this._scrollRect) {
  2580. if (e < this._scrollRect.x || a < this._scrollRect.y || e > this._scrollRect.x + this._scrollRect.width || a > this._scrollRect.y + this._scrollRect.height) return null
  2581. } else if (this.mask && (this.mask.x > e || e > this.mask.x + this.mask.width || this.mask.y > a || a > this.mask.y + this.mask.height)) return null;
  2582. for (var g = this._children,
  2583. f = this._touchChildren,
  2584. l = g.length - 1; 0 <= l; l--) {
  2585. var n = g[l],
  2586. p = n._getMatrix(),
  2587. q = n._scrollRect;
  2588. q && p.append(1, 0, 0, 1, -q.x, -q.y);
  2589. p.invert();
  2590. p = b.Matrix.transformCoords(p, e, a);
  2591. if (n = n.hitTest(p.x, p.y, !0)) {
  2592. if (!f) return this;
  2593. if (n._touchEnabled && f) return n;
  2594. h = this
  2595. }
  2596. }
  2597. return h ? h: this._texture_to_render ? d.prototype.hitTest.call(this, e, a, c) : null
  2598. };
  2599. a.prototype._onAddToStage = function() {
  2600. d.prototype._onAddToStage.call(this);
  2601. for (var e = this._children.length,
  2602. a = 0; a < e; a++) this._children[a]._onAddToStage()
  2603. };
  2604. a.prototype._onRemoveFromStage = function() {
  2605. d.prototype._onRemoveFromStage.call(this);
  2606. for (var e = this._children.length,
  2607. a = 0; a < e; a++) this._children[a]._onRemoveFromStage()
  2608. };
  2609. a.prototype.getChildByName = function(e) {
  2610. for (var a = this._children,
  2611. b = a.length,
  2612. d, c = 0; c < b; c++) if (d = a[c], d.name == e) return d;
  2613. return null
  2614. };
  2615. a.__EVENT__ADD_TO_STAGE_LIST = [];
  2616. a.__EVENT__REMOVE_FROM_STAGE_LIST = [];
  2617. return a
  2618. } (b.DisplayObject);
  2619. b.DisplayObjectContainer = c;
  2620. c.prototype.__class__ = "egret.DisplayObjectContainer"
  2621. })(egret || (egret = {})); (function(b) {
  2622. var c = function() {
  2623. function b() {}
  2624. b.NO_BORDER = "noBorder";
  2625. b.NO_SCALE = "noScale";
  2626. b.SHOW_ALL = "showAll";
  2627. b.EXACT_FIT = "exactFit";
  2628. return b
  2629. } ();
  2630. b.StageScaleMode = c;
  2631. c.prototype.__class__ = "egret.StageScaleMode";
  2632. c = function() {
  2633. function b() {}
  2634. b.FIXED_WIDTH = 1;
  2635. b.FIXED_HEIGHT = 2;
  2636. return b
  2637. } ();
  2638. b.NoBorderMode = c;
  2639. c.prototype.__class__ = "egret.NoBorderMode"
  2640. })(egret || (egret = {}));
  2641. __extends = this.__extends ||
  2642. function(b, c) {
  2643. function d() {
  2644. this.constructor = b
  2645. }
  2646. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2647. d.prototype = c.prototype;
  2648. b.prototype = new d
  2649. }; (function(b) {
  2650. var c = function(d) {
  2651. function a(e, a) {
  2652. void 0 === e && (e = 480);
  2653. void 0 === a && (a = 800);
  2654. d.call(this);
  2655. this._changeSizeDispatchFlag = !0;
  2656. this._scaleMode = "";
  2657. this._stageHeight = this._stageWidth = NaN;
  2658. this.touchEnabled = !0;
  2659. this._stage = this;
  2660. this._stageWidth = e;
  2661. this._stageHeight = a
  2662. }
  2663. __extends(a, d);
  2664. a.prototype.invalidate = function() {
  2665. a._invalidateRenderFlag = !0
  2666. };
  2667. Object.defineProperty(a.prototype, "scaleMode", {
  2668. get: function() {
  2669. return this._scaleMode
  2670. },
  2671. set: function(e) {
  2672. this._scaleMode != e && (this._scaleMode = e, this.setResolutionPolicy())
  2673. },
  2674. enumerable: !0,
  2675. configurable: !0
  2676. });
  2677. a.prototype.changeSize = function() {
  2678. this._changeSizeDispatchFlag && (this.setResolutionPolicy(), this.dispatchEventWith(b.Event.RESIZE))
  2679. };
  2680. a.prototype.setResolutionPolicy = function() {
  2681. var e = a.SCALE_MODE_ENUM[this._scaleMode];
  2682. if (!e) throw Error(b.getString(1024));
  2683. var k = new b.EqualToFrame,
  2684. e = new b.ResolutionPolicy(k, e);
  2685. b.StageDelegate.getInstance()._setResolutionPolicy(e);
  2686. this._stageWidth = b.StageDelegate.getInstance()._stageWidth;
  2687. this._stageHeight = b.StageDelegate.getInstance()._stageHeight
  2688. };
  2689. Object.defineProperty(a.prototype, "stageWidth", {
  2690. get: function() {
  2691. return this._stageWidth
  2692. },
  2693. enumerable: !0,
  2694. configurable: !0
  2695. });
  2696. Object.defineProperty(a.prototype, "stageHeight", {
  2697. get: function() {
  2698. return this._stageHeight
  2699. },
  2700. enumerable: !0,
  2701. configurable: !0
  2702. });
  2703. a.prototype.hitTest = function(e, a, d) {
  2704. if (!this._touchEnabled) return null;
  2705. var c;
  2706. if (!this._touchChildren) return this;
  2707. d = this._children;
  2708. for (var g = d.length - 1; 0 <= g; g--) {
  2709. c = d[g];
  2710. var f = c._getMatrix(),
  2711. l = c._scrollRect;
  2712. l && f.append(1, 0, 0, 1, -l.x, -l.y);
  2713. f.invert();
  2714. f = b.Matrix.transformCoords(f, e, a);
  2715. if ((c = c.hitTest(f.x, f.y, !0)) && c._touchEnabled) return c
  2716. }
  2717. return this
  2718. };
  2719. a.prototype.getBounds = function(e) {
  2720. e || (e = new b.Rectangle);
  2721. return e.initialize(0, 0, this._stageWidth, this._stageHeight)
  2722. };
  2723. a.prototype._updateTransform = function() {
  2724. for (var e = 0,
  2725. a = this._children.length; e < a; e++) this._children[e]._updateTransform()
  2726. };
  2727. Object.defineProperty(a.prototype, "focus", {
  2728. get: function() {
  2729. return null
  2730. },
  2731. enumerable: !0,
  2732. configurable: !0
  2733. });
  2734. a.registerScaleMode = function(e, k, d) {
  2735. a.SCALE_MODE_ENUM[e] && !d ? b.Logger.warningWithErrorId(1009, e) : a.SCALE_MODE_ENUM[e] = k
  2736. };
  2737. a._invalidateRenderFlag = !1;
  2738. a.SCALE_MODE_ENUM = {};
  2739. return a
  2740. } (b.DisplayObjectContainer);
  2741. b.Stage = c;
  2742. c.prototype.__class__ = "egret.Stage"
  2743. })(egret || (egret = {}));
  2744. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_SCALE] = new egret.NoScale;
  2745. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.SHOW_ALL] = new egret.ShowAll;
  2746. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.NO_BORDER] = new egret.FixedWidth;
  2747. egret.Stage.SCALE_MODE_ENUM[egret.StageScaleMode.EXACT_FIT] = new egret.FullScreen;
  2748. __extends = this.__extends ||
  2749. function(b, c) {
  2750. function d() {
  2751. this.constructor = b
  2752. }
  2753. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  2754. d.prototype = c.prototype;
  2755. b.prototype = new d
  2756. }; (function(b) {
  2757. var c = function(d) {
  2758. function a(e) {
  2759. void 0 === e && (e = null);
  2760. d.call(this);
  2761. this._lastTouchPosition = new b.Point(0, 0);
  2762. this._touchStartPosition = new b.Point(0, 0);
  2763. this._scrollStarted = !1;
  2764. this._lastTouchTime = 0;
  2765. this._lastTouchEvent = null;
  2766. this._velocitys = [];
  2767. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  2768. this._vScrollTween = this._hScrollTween = null;
  2769. this.scrollBeginThreshold = 10;
  2770. this.scrollSpeed = 1;
  2771. this._content = null;
  2772. this._horizontalScrollPolicy = this._verticalScrollPolicy = "auto";
  2773. this._scrollTop = this._scrollLeft = 0;
  2774. this._vCanScroll = this._hCanScroll = !1;
  2775. this.touchBeginTimer = this.delayTouchBeginEvent = null;
  2776. this.touchEnabled = !0;
  2777. e && this.setContent(e)
  2778. }
  2779. __extends(a, d);
  2780. a.prototype.setContent = function(e) {
  2781. this._content !== e && (this.removeContent(), e && (this._content = e, d.prototype.addChild.call(this, e), this._addEvents()))
  2782. };
  2783. a.prototype.removeContent = function() {
  2784. this._content && (this._removeEvents(), d.prototype.removeChildAt.call(this, 0));
  2785. this._content = null
  2786. };
  2787. Object.defineProperty(a.prototype, "verticalScrollPolicy", {
  2788. get: function() {
  2789. return this._verticalScrollPolicy
  2790. },
  2791. set: function(e) {
  2792. e != this._verticalScrollPolicy && (this._verticalScrollPolicy = e)
  2793. },
  2794. enumerable: !0,
  2795. configurable: !0
  2796. });
  2797. Object.defineProperty(a.prototype, "horizontalScrollPolicy", {
  2798. get: function() {
  2799. return this._horizontalScrollPolicy
  2800. },
  2801. set: function(e) {
  2802. e != this._horizontalScrollPolicy && (this._horizontalScrollPolicy = e)
  2803. },
  2804. enumerable: !0,
  2805. configurable: !0
  2806. });
  2807. Object.defineProperty(a.prototype, "scrollLeft", {
  2808. get: function() {
  2809. return this._scrollLeft
  2810. },
  2811. set: function(e) {
  2812. e != this._scrollLeft && (this._scrollLeft = e, this._validatePosition(!1, !0), this._updateContentPosition())
  2813. },
  2814. enumerable: !0,
  2815. configurable: !0
  2816. });
  2817. Object.defineProperty(a.prototype, "scrollTop", {
  2818. get: function() {
  2819. return this._scrollTop
  2820. },
  2821. set: function(e) {
  2822. e != this._scrollTop && (this._scrollTop = e, this._validatePosition(!0, !1), this._updateContentPosition())
  2823. },
  2824. enumerable: !0,
  2825. configurable: !0
  2826. });
  2827. a.prototype.setScrollPosition = function(e, a, b) {
  2828. void 0 === b && (b = !1);
  2829. if (!b || 0 != e || 0 != a) if (b || this._scrollTop != e || this._scrollLeft != a) {
  2830. if (b) {
  2831. b = this._isOnTheEdge(!0);
  2832. var d = this._isOnTheEdge(!1);
  2833. this._scrollTop += b ? e / 2 : e;
  2834. this._scrollLeft += d ? a / 2 : a
  2835. } else this._scrollTop = e,
  2836. this._scrollLeft = a;
  2837. this._validatePosition(!0, !0);
  2838. this._updateContentPosition()
  2839. }
  2840. };
  2841. a.prototype._isOnTheEdge = function(e) {
  2842. void 0 === e && (e = !0);
  2843. var a = this._scrollTop,
  2844. b = this._scrollLeft;
  2845. return e ? 0 > a || a > this.getMaxScrollTop() : 0 > b || b > this.getMaxScrollLeft()
  2846. };
  2847. a.prototype._validatePosition = function(e, a) {
  2848. void 0 === e && (e = !1);
  2849. void 0 === a && (a = !1);
  2850. if (e) {
  2851. var b = this.height,
  2852. d = this._getContentHeight();
  2853. this._scrollTop = Math.max(this._scrollTop, (0 - b) / 2);
  2854. this._scrollTop = Math.min(this._scrollTop, d > b ? d - b / 2 : b / 2)
  2855. }
  2856. a && (b = this.width, d = this._getContentWidth(), this._scrollLeft = Math.max(this._scrollLeft, (0 - b) / 2), this._scrollLeft = Math.min(this._scrollLeft, d > b ? d - b / 2 : b / 2))
  2857. };
  2858. a.prototype._setWidth = function(e) {
  2859. this._explicitWidth != e && (d.prototype._setWidth.call(this, e), this._updateContentPosition())
  2860. };
  2861. a.prototype._setHeight = function(e) {
  2862. this._explicitHeight != e && (d.prototype._setHeight.call(this, e), this._updateContentPosition())
  2863. };
  2864. a.prototype._updateContentPosition = function() {
  2865. var e = this.getBounds(b.Rectangle.identity);
  2866. this.scrollRect = new b.Rectangle(this._scrollLeft, this._scrollTop, e.width, e.height);
  2867. this.dispatchEvent(new b.Event(b.Event.CHANGE))
  2868. };
  2869. a.prototype._checkScrollPolicy = function() {
  2870. var e = this.__checkScrollPolicy(this._horizontalScrollPolicy, this._getContentWidth(), this.width);
  2871. this._hCanScroll = e;
  2872. var a = this.__checkScrollPolicy(this._verticalScrollPolicy, this._getContentHeight(), this.height);
  2873. this._vCanScroll = a;
  2874. return e || a
  2875. };
  2876. a.prototype.__checkScrollPolicy = function(e, a, b) {
  2877. return "on" == e ? !0 : "off" == e ? !1 : a > b
  2878. };
  2879. a.prototype._addEvents = function() {
  2880. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2881. this.addEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2882. this.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2883. };
  2884. a.prototype._removeEvents = function() {
  2885. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);
  2886. this.removeEventListener(b.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, !0);
  2887. this.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, !0)
  2888. };
  2889. a.prototype._onTouchBegin = function(e) { ! e._isDefaultPrevented && this._checkScrollPolicy() && (this._touchStartPosition.x = e.stageX, this._touchStartPosition.y = e.stageY, (this._isHTweenPlaying || this._isVTweenPlaying) && this._onScrollFinished(), this.stage.addEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this), this.stage.addEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this), this.stage.addEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this), this.addEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this), this._logTouchEvent(e), e.preventDefault())
  2890. };
  2891. a.prototype._onTouchBeginCapture = function(e) {
  2892. var k = this._checkScrollPolicy();
  2893. if (k) {
  2894. for (var d = e.target; d != this;) {
  2895. if (d instanceof a && (k = d._checkScrollPolicy())) return;
  2896. d = d.parent
  2897. }
  2898. e.stopPropagation();
  2899. this.delayTouchBeginEvent = this.cloneTouchEvent(e);
  2900. this.touchBeginTimer || (this.touchBeginTimer = new b.Timer(100, 1), this.touchBeginTimer.addEventListener(b.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this));
  2901. this.touchBeginTimer.start();
  2902. this._onTouchBegin(e)
  2903. }
  2904. };
  2905. a.prototype._onTouchEndCapture = function(e) {
  2906. this.delayTouchBeginEvent && this._onTouchBeginTimer()
  2907. };
  2908. a.prototype._onTouchBeginTimer = function() {
  2909. this.touchBeginTimer.stop();
  2910. var e = this.delayTouchBeginEvent;
  2911. this.delayTouchBeginEvent = null;
  2912. this.stage && this.dispatchPropagationEvent(e)
  2913. };
  2914. a.prototype.dispatchPropagationEvent = function(e) {
  2915. for (var a = [], b = e._target; b;) a.push(b),
  2916. b = b.parent;
  2917. for (var d = this._content,
  2918. c = 1;; c += 2) {
  2919. b = a[c];
  2920. if (!b || b === d) break;
  2921. a.unshift(b)
  2922. }
  2923. this._dispatchPropagationEvent(e, a)
  2924. };
  2925. a.prototype._dispatchPropagationEvent = function(e, a, b) {
  2926. for (var d = a.length,
  2927. c = 0; c < d; c++) {
  2928. var f = a[c];
  2929. e._currentTarget = f;
  2930. e._target = this;
  2931. e._eventPhase = c < b ? 1 : c == b ? 2 : 3;
  2932. f._notifyListener(e);
  2933. if (e._isPropagationStopped || e._isPropagationImmediateStopped) break
  2934. }
  2935. };
  2936. a.prototype._onTouchMove = function(e) {
  2937. if (this._lastTouchPosition.x != e.stageX || this._lastTouchPosition.y != e.stageY) {
  2938. if (!this._scrollStarted) {
  2939. var a = e.stageX - this._touchStartPosition.x,
  2940. b = e.stageY - this._touchStartPosition.y;
  2941. if (Math.sqrt(a * a + b * b) < this.scrollBeginThreshold) {
  2942. this._logTouchEvent(e);
  2943. return
  2944. }
  2945. }
  2946. this._scrollStarted = !0;
  2947. this.delayTouchBeginEvent && (this.delayTouchBeginEvent = null, this.touchBeginTimer.stop());
  2948. this.touchChildren = !1;
  2949. a = this._getPointChange(e);
  2950. this.setScrollPosition(a.y, a.x, !0);
  2951. this._calcVelocitys(e);
  2952. this._logTouchEvent(e)
  2953. }
  2954. };
  2955. a.prototype._onTouchEnd = function(e) {
  2956. this.touchChildren = !0;
  2957. this._scrollStarted = !1;
  2958. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);
  2959. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_END, this._onTouchEnd, this);
  2960. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);
  2961. this.removeEventListener(b.Event.ENTER_FRAME, this._onEnterFrame, this);
  2962. this._moveAfterTouchEnd()
  2963. };
  2964. a.prototype._onEnterFrame = function(e) {
  2965. e = b.getTimer();
  2966. 100 < e - this._lastTouchTime && 300 > e - this._lastTouchTime && this._calcVelocitys(this._lastTouchEvent)
  2967. };
  2968. a.prototype._logTouchEvent = function(e) {
  2969. this._lastTouchPosition.x = e.stageX;
  2970. this._lastTouchPosition.y = e.stageY;
  2971. this._lastTouchEvent = this.cloneTouchEvent(e);
  2972. this._lastTouchTime = b.getTimer()
  2973. };
  2974. a.prototype._getPointChange = function(e) {
  2975. return {
  2976. x: !1 === this._hCanScroll ? 0 : this._lastTouchPosition.x - e.stageX,
  2977. y: !1 === this._vCanScroll ? 0 : this._lastTouchPosition.y - e.stageY
  2978. }
  2979. };
  2980. a.prototype._calcVelocitys = function(e) {
  2981. var a = b.getTimer();
  2982. if (0 == this._lastTouchTime) this._lastTouchTime = a;
  2983. else {
  2984. var d = this._getPointChange(e),
  2985. a = a - this._lastTouchTime;
  2986. d.x /= a;
  2987. d.y /= a;
  2988. this._velocitys.push(d);
  2989. 5 < this._velocitys.length && this._velocitys.shift();
  2990. this._lastTouchPosition.x = e.stageX;
  2991. this._lastTouchPosition.y = e.stageY
  2992. }
  2993. };
  2994. a.prototype._getContentWidth = function() {
  2995. return this._content.explicitWidth || this._content.width
  2996. };
  2997. a.prototype._getContentHeight = function() {
  2998. return this._content.explicitHeight || this._content.height
  2999. };
  3000. a.prototype.getMaxScrollLeft = function() {
  3001. var e = this._getContentWidth() - this.width;
  3002. return Math.max(0, e)
  3003. };
  3004. a.prototype.getMaxScrollTop = function() {
  3005. var e = this._getContentHeight() - this.height;
  3006. return Math.max(0, e)
  3007. };
  3008. a.prototype._moveAfterTouchEnd = function() {
  3009. if (0 != this._velocitys.length) {
  3010. for (var e = 0,
  3011. b = 0,
  3012. d = 0,
  3013. c = 0; c < this._velocitys.length; c++) var g = this._velocitys[c],
  3014. f = a.weight[c],
  3015. e = e + g.x * f,
  3016. b = b + g.y * f,
  3017. d = d + f;
  3018. this._velocitys.length = 0;
  3019. 0 >= this.scrollSpeed && (this.scrollSpeed = 1);
  3020. e = e / d * this.scrollSpeed;
  3021. b = b / d * this.scrollSpeed;
  3022. g = Math.abs(e);
  3023. d = Math.abs(b);
  3024. f = this.getMaxScrollLeft();
  3025. c = this.getMaxScrollTop();
  3026. e = 0.02 < g ? this.getAnimationDatas(e, this._scrollLeft, f) : {
  3027. position: this._scrollLeft,
  3028. duration: 1
  3029. };
  3030. b = 0.02 < d ? this.getAnimationDatas(b, this._scrollTop, c) : {
  3031. position: this._scrollTop,
  3032. duration: 1
  3033. };
  3034. this.setScrollLeft(e.position, e.duration);
  3035. this.setScrollTop(b.position, b.duration)
  3036. }
  3037. };
  3038. a.prototype._onTweenFinished = function(e) {
  3039. e == this._vScrollTween && (this._isVTweenPlaying = !1);
  3040. e == this._hScrollTween && (this._isHTweenPlaying = !1); ! 1 == this._isHTweenPlaying && !1 == this._isVTweenPlaying && this._onScrollFinished()
  3041. };
  3042. a.prototype._onScrollStarted = function() {};
  3043. a.prototype._onScrollFinished = function() {
  3044. b.Tween.removeTweens(this);
  3045. this._vScrollTween = this._hScrollTween = null;
  3046. this._isVTweenPlaying = this._isHTweenPlaying = !1;
  3047. this.dispatchEvent(new b.Event(b.Event.COMPLETE))
  3048. };
  3049. a.prototype.setScrollTop = function(e, a) {
  3050. void 0 === a && (a = 0);
  3051. var d = Math.min(this.getMaxScrollTop(), Math.max(e, 0));
  3052. if (0 == a) return this.scrollTop = d,
  3053. null;
  3054. var c = b.Tween.get(this).to({
  3055. scrollTop: e
  3056. },
  3057. a, b.Ease.quartOut);
  3058. d != e && c.to({
  3059. scrollTop: d
  3060. },
  3061. 300, b.Ease.quintOut);
  3062. this._isVTweenPlaying = !0;
  3063. this._vScrollTween = c;
  3064. c.call(this._onTweenFinished, this, [c]);
  3065. this._isHTweenPlaying || this._onScrollStarted();
  3066. return c
  3067. };
  3068. a.prototype.setScrollLeft = function(e, a) {
  3069. void 0 === a && (a = 0);
  3070. var d = Math.min(this.getMaxScrollLeft(), Math.max(e, 0));
  3071. if (0 == a) return this.scrollLeft = d,
  3072. null;
  3073. var c = b.Tween.get(this).to({
  3074. scrollLeft: e
  3075. },
  3076. a, b.Ease.quartOut);
  3077. d != e && c.to({
  3078. scrollLeft: d
  3079. },
  3080. 300, b.Ease.quintOut);
  3081. this._isHTweenPlaying = !0;
  3082. this._hScrollTween = c;
  3083. c.call(this._onTweenFinished, this, [c]);
  3084. this._isVTweenPlaying || this._onScrollStarted();
  3085. return c
  3086. };
  3087. a.prototype.getAnimationDatas = function(e, a, b) {
  3088. var d = Math.abs(e),
  3089. c = 0,
  3090. f = a + 500 * e;
  3091. if (0 > f || f > b) for (f = a; Infinity != Math.abs(e) && 0.02 < Math.abs(e);) f += e,
  3092. e = 0 > f || f > b ? 0.998 * e * 0.95 : 0.998 * e,
  3093. c++;
  3094. else c = 500 * -Math.log(0.02 / d);
  3095. return {
  3096. position: Math.min(b + 50, Math.max(f, -50)),
  3097. duration: c
  3098. }
  3099. };
  3100. a.prototype.cloneTouchEvent = function(e) {
  3101. var a = new b.TouchEvent(e._type, e._bubbles, e.cancelable);
  3102. a.touchPointID = e.touchPointID;
  3103. a._stageX = e._stageX;
  3104. a._stageY = e._stageY;
  3105. a.ctrlKey = e.ctrlKey;
  3106. a.altKey = e.altKey;
  3107. a.shiftKey = e.shiftKey;
  3108. a.touchDown = e.touchDown;
  3109. a._isDefaultPrevented = !1;
  3110. a._target = e._target;
  3111. return a
  3112. };
  3113. a.prototype.throwNotSupportedError = function() {
  3114. throw Error(b.getString(1023));
  3115. };
  3116. a.prototype.addChild = function(e) {
  3117. this.throwNotSupportedError();
  3118. return null
  3119. };
  3120. a.prototype.addChildAt = function(e, a) {
  3121. this.throwNotSupportedError();
  3122. return null
  3123. };
  3124. a.prototype.removeChild = function(e) {
  3125. this.throwNotSupportedError();
  3126. return null
  3127. };
  3128. a.prototype.removeChildAt = function(e) {
  3129. this.throwNotSupportedError();
  3130. return null
  3131. };
  3132. a.prototype.setChildIndex = function(e, a) {
  3133. this.throwNotSupportedError()
  3134. };
  3135. a.prototype.swapChildren = function(e, a) {
  3136. this.throwNotSupportedError()
  3137. };
  3138. a.prototype.swapChildrenAt = function(e, a) {
  3139. this.throwNotSupportedError()
  3140. };
  3141. a.prototype.hitTest = function(e, a, c) {
  3142. void 0 === c && (c = !1);
  3143. var h = d.prototype.hitTest.call(this, e, a, c);
  3144. return h ? h: b.DisplayObject.prototype.hitTest.call(this, e, a, c)
  3145. };
  3146. a.weight = [1, 1.33, 1.66, 2, 2.33];
  3147. return a
  3148. } (b.DisplayObjectContainer);
  3149. b.ScrollView = c;
  3150. c.prototype.__class__ = "egret.ScrollView"
  3151. })(egret || (egret = {})); (function(b) {
  3152. var c = function() {
  3153. function b() {}
  3154. b.REPEAT = "repeat";
  3155. b.SCALE = "scale";
  3156. return b
  3157. } ();
  3158. b.BitmapFillMode = c;
  3159. c.prototype.__class__ = "egret.BitmapFillMode"
  3160. })(egret || (egret = {}));
  3161. __extends = this.__extends ||
  3162. function(b, c) {
  3163. function d() {
  3164. this.constructor = b
  3165. }
  3166. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3167. d.prototype = c.prototype;
  3168. b.prototype = new d
  3169. }; (function(b) {
  3170. var c = function(d) {
  3171. function a(e) {
  3172. d.call(this);
  3173. this.debug = !1;
  3174. this.debugColor = 16711680;
  3175. this.scale9Grid = this._texture = null;
  3176. this.fillMode = "scale";
  3177. e && (this._texture = e, this._setSizeDirty());
  3178. this.needDraw = !0
  3179. }
  3180. __extends(a, d);
  3181. Object.defineProperty(a.prototype, "texture", {
  3182. get: function() {
  3183. return this._texture
  3184. },
  3185. set: function(e) {
  3186. e != this._texture && (this._setSizeDirty(), this._texture = e)
  3187. },
  3188. enumerable: !0,
  3189. configurable: !0
  3190. });
  3191. a.prototype._render = function(e) {
  3192. var b = this._texture;
  3193. b ? (this._texture_to_render = b, a._drawBitmap(e, this._hasWidthSet ? this._explicitWidth: b._textureWidth, this._hasHeightSet ? this._explicitHeight: b._textureHeight, this)) : this._texture_to_render = null
  3194. };
  3195. a._drawBitmap = function(e, b, d, c) {
  3196. var g = c._texture_to_render;
  3197. if (g) {
  3198. var f = g._textureWidth,
  3199. l = g._textureHeight;
  3200. if ("scale" == c.fillMode) {
  3201. var n = c.scale9Grid || g.scale9Grid;
  3202. if (n && f - n.width < b && l - n.height < d) a.drawScale9GridImage(e, c, n, b, d);
  3203. else {
  3204. var n = g._offsetX,
  3205. p = g._offsetY,
  3206. q = g._bitmapWidth || f,
  3207. r = g._bitmapHeight || l;
  3208. b /= f;
  3209. n = Math.round(n * b);
  3210. b = Math.round(q * b);
  3211. d /= l;
  3212. p = Math.round(p * d);
  3213. d = Math.round(r * d);
  3214. a.renderFilter.drawImage(e, c, g._bitmapX, g._bitmapY, q, r, n, p, b, d)
  3215. }
  3216. } else a.drawRepeatImage(e, c, b, d, c.fillMode)
  3217. }
  3218. };
  3219. a.drawRepeatImage = function(e, a, d, c, g) {
  3220. var f = a._texture_to_render;
  3221. if (f) {
  3222. var l = f._textureWidth,
  3223. n = f._textureHeight,
  3224. p = f._bitmapX,
  3225. q = f._bitmapY,
  3226. l = f._bitmapWidth || l,
  3227. n = f._bitmapHeight || n,
  3228. r = f._offsetX,
  3229. f = f._offsetY;
  3230. b.RenderFilter.getInstance().drawImage(e, a, p, q, l, n, r, f, d, c, g)
  3231. }
  3232. };
  3233. a.drawScale9GridImage = function(e, a, d, c, g) {
  3234. var f = b.MainContext.instance.rendererContext._texture_scale_factor,
  3235. l = a._texture_to_render;
  3236. if (l && d) {
  3237. var n = l._textureWidth,
  3238. p = l._textureHeight,
  3239. q = l._bitmapX,
  3240. r = l._bitmapY,
  3241. t = l._bitmapWidth || n,
  3242. s = l._bitmapHeight || p;
  3243. c -= n - t;
  3244. g -= p - s;
  3245. if (!e.drawImageScale9(l, q, r, t, s, l._offsetX, l._offsetY, c, g, d)) {
  3246. n = l._offsetX / f;
  3247. p = l._offsetY / f;
  3248. l = b.RenderFilter.getInstance();
  3249. d = b.Rectangle.identity.initialize(d.x - Math.round(n), d.y - Math.round(n), d.width, d.height);
  3250. n = Math.round(n);
  3251. p = Math.round(p);
  3252. d.y == d.bottom && (d.bottom < s ? d.bottom++:d.y--);
  3253. d.x == d.right && (d.right < t ? d.right++:d.x--);
  3254. var u = q + d.x / f,
  3255. w = q + d.right / f,
  3256. v = t - d.right,
  3257. y = r + d.y / f,
  3258. f = r + d.bottom / f,
  3259. x = s - d.bottom,
  3260. z = n + d.x,
  3261. A = p + d.y,
  3262. s = g - (s - d.bottom),
  3263. t = c - (t - d.right);
  3264. l.drawImage(e, a, q, r, d.x, d.y, n, p, d.x, d.y);
  3265. l.drawImage(e, a, u, r, d.width, d.y, z, p, t - d.x, d.y);
  3266. l.drawImage(e, a, w, r, v, d.y, n + t, p, c - t, d.y);
  3267. l.drawImage(e, a, q, y, d.x, d.height, n, A, d.x, s - d.y);
  3268. l.drawImage(e, a, u, y, d.width, d.height, z, A, t - d.x, s - d.y);
  3269. l.drawImage(e, a, w, y, v, d.height, n + t, A, c - t, s - d.y);
  3270. l.drawImage(e, a, q, f, d.x, x, n, p + s, d.x, g - s);
  3271. l.drawImage(e, a, u, f, d.width, x, z, p + s, t - d.x, g - s);
  3272. l.drawImage(e, a, w, f, v, x, n + t, p + s, c - t, g - s)
  3273. }
  3274. }
  3275. };
  3276. a.prototype._measureBounds = function() {
  3277. var a = this._texture;
  3278. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : d.prototype._measureBounds.call(this)
  3279. };
  3280. a.debug = !1;
  3281. a.renderFilter = b.RenderFilter.getInstance();
  3282. return a
  3283. } (b.DisplayObject);
  3284. b.Bitmap = c;
  3285. c.prototype.__class__ = "egret.Bitmap"
  3286. })(egret || (egret = {}));
  3287. __extends = this.__extends ||
  3288. function(b, c) {
  3289. function d() {
  3290. this.constructor = b
  3291. }
  3292. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3293. d.prototype = c.prototype;
  3294. b.prototype = new d
  3295. }; (function(b) {
  3296. var c = function(d) {
  3297. function a() {
  3298. d.call(this);
  3299. this._text = "";
  3300. this._textChanged = !1;
  3301. this._font = null;
  3302. this._fontChanged = !1;
  3303. this._textOffsetY = this._textOffsetX = this._textHeight = this._textWidth = 0;
  3304. this.textLinesChange = !0;
  3305. this._lineHeights = [];
  3306. this.cacheAsBitmap = !0
  3307. }
  3308. __extends(a, d);
  3309. Object.defineProperty(a.prototype, "text", {
  3310. get: function() {
  3311. return this._text
  3312. },
  3313. set: function(a) {
  3314. this._text != a && (this._textChanged = !0, this._text = a, this._setSizeDirty())
  3315. },
  3316. enumerable: !0,
  3317. configurable: !0
  3318. });
  3319. Object.defineProperty(a.prototype, "font", {
  3320. get: function() {
  3321. return this._font
  3322. },
  3323. set: function(a) {
  3324. this._font != a && (this._font = a, this._fontChanged = !0, this._setSizeDirty())
  3325. },
  3326. enumerable: !0,
  3327. configurable: !0
  3328. });
  3329. Object.defineProperty(a.prototype, "spriteSheet", {
  3330. get: function() {
  3331. return this._font
  3332. },
  3333. set: function(a) {
  3334. this.font = a
  3335. },
  3336. enumerable: !0,
  3337. configurable: !0
  3338. });
  3339. a.prototype._setSizeDirty = function() {
  3340. d.prototype._setSizeDirty.call(this);
  3341. this.textLinesChange = !0
  3342. };
  3343. a.prototype._render = function(e) {
  3344. var k = this.getTextLines(),
  3345. d = k.length;
  3346. if (0 != d) {
  3347. for (var c = this._font,
  3348. g = c._getFirstCharHeight(), g = Math.ceil(g * a.EMPTY_FACTOR), f = 0, l = this._hasHeightSet ? this._explicitHeight: Number.POSITIVE_INFINITY, n = this._lineHeights, p = 0; p < d; p++) {
  3349. var q = n[p];
  3350. if (0 < p && f + q > l) break;
  3351. for (var r = k[p], t = r.length, s = 0, u = 0; u < t; u++) {
  3352. var w = r.charAt(u),
  3353. v = c.getTexture(w);
  3354. if (v) {
  3355. var w = v._bitmapWidth || v._textureWidth,
  3356. y = v._bitmapHeight || v._textureHeight;
  3357. this._texture_to_render = v;
  3358. b.RenderFilter.getInstance().drawImage(e, this, v._bitmapX, v._bitmapY, w, y, s + v._offsetX, f + v._offsetY, w, y);
  3359. s += v._textureWidth
  3360. } else " " == w ? s += g: b.Logger.warningWithErrorId(1011, w)
  3361. }
  3362. f += q
  3363. }
  3364. this._texture_to_render = null
  3365. }
  3366. };
  3367. a.prototype._measureBounds = function() {
  3368. return 0 == this.getTextLines().length ? b.Rectangle.identity.initialize(0, 0, 0, 0) : b.Rectangle.identity.initialize(this._textOffsetX, this._textOffsetY, this._textWidth - this._textOffsetX, this._textHeight - this._textOffsetY)
  3369. };
  3370. a.prototype.getTextLines = function() {
  3371. if (!this.textLinesChange) return this._textLines;
  3372. var e = [];
  3373. this._textLines = e;
  3374. this.textLinesChange = !1;
  3375. var k = [];
  3376. this._lineHeights = k;
  3377. if (!this._text || !this._font) return e;
  3378. for (var d = 0,
  3379. c = 0,
  3380. g = 0,
  3381. f = 0,
  3382. l = this._hasWidthSet,
  3383. n = this._hasWidthSet ? this._explicitWidth: Number.POSITIVE_INFINITY, p = this._font, q = p._getFirstCharHeight(), r = Math.ceil(q * a.EMPTY_FACTOR), t = this._text.split(/(?:\r\n|\r|\n)/), s = t.length, u = !0, w = 0; w < s; w++) {
  3384. for (var v = t[w], y = v.length, x = 0, z = 0, A = !0, C = 0; C < y; C++) {
  3385. var B = v.charAt(C),
  3386. E,
  3387. F = 0,
  3388. G = 0,
  3389. D = p.getTexture(B);
  3390. if (D) B = D._textureWidth,
  3391. E = D._textureHeight,
  3392. F = D._offsetX,
  3393. G = D._offsetY;
  3394. else if (" " == B) B = r,
  3395. E = q;
  3396. else {
  3397. b.Logger.warningWithErrorId(1011, B);
  3398. A && (A = !1);
  3399. continue
  3400. }
  3401. A && (A = !1, g = Math.min(F, g));
  3402. u && (f = Math.min(G, f));
  3403. l && 0 < C && z + B > n ? (e.push(v.substring(0, C)), k.push(x), c += x, d = Math.max(z, d), v = v.substring(C), y = v.length, C = 0, z = B, x = E) : (z += B, x = Math.max(E, x))
  3404. }
  3405. u && (u = !1);
  3406. e.push(v);
  3407. k.push(x);
  3408. c += x;
  3409. d = Math.max(z, d)
  3410. }
  3411. this._textWidth = d;
  3412. this._textHeight = c;
  3413. this._textOffsetX = g;
  3414. this._textOffsetY = f;
  3415. return e
  3416. };
  3417. a.EMPTY_FACTOR = 0.33;
  3418. return a
  3419. } (b.DisplayObject);
  3420. b.BitmapText = c;
  3421. c.prototype.__class__ = "egret.BitmapText"
  3422. })(egret || (egret = {})); (function(b) {
  3423. var c = function() {
  3424. function d() {
  3425. this.fillStyleColor = this.strokeStyleColor = this.renderContext = this.commandQueue = this.canvasContext = null;
  3426. this._dirty = !1;
  3427. this._lastY = this._lastX = this._maxY = this._maxX = this._minY = this._minX = 0;
  3428. this.commandQueue = []
  3429. }
  3430. d.prototype.beginFill = function(a, e) {};
  3431. d.prototype._setStyle = function(a) {};
  3432. d.prototype.drawRect = function(a, e, b, d) {
  3433. this.checkRect(a, e, b, d)
  3434. };
  3435. d.prototype.drawCircle = function(a, e, b) {
  3436. this.checkRect(a - b, e - b, 2 * b, 2 * b)
  3437. };
  3438. d.prototype.drawRoundRect = function(a, e, b, d, c, g) {
  3439. this.checkRect(a, e, b, d)
  3440. };
  3441. d.prototype.drawEllipse = function(a, e, b, d) {
  3442. this.checkRect(a - b, e - d, 2 * b, 2 * d)
  3443. };
  3444. d.prototype.lineStyle = function(a, e, b, d, c, g, f, l) {};
  3445. d.prototype.lineTo = function(a, e) {
  3446. this.checkPoint(a, e)
  3447. };
  3448. d.prototype.curveTo = function(a, e, b, d) {
  3449. this.checkPoint(a, e);
  3450. this.checkPoint(b, d)
  3451. };
  3452. d.prototype.moveTo = function(a, e) {
  3453. this.checkPoint(a, e)
  3454. };
  3455. d.prototype.clear = function() {
  3456. this._maxY = this._maxX = this._minY = this._minX = 0
  3457. };
  3458. d.prototype.endFill = function() {};
  3459. d.prototype._draw = function(a) {};
  3460. d.prototype.checkRect = function(a, e, b, d) {
  3461. this._minX = Math.min(this._minX, a);
  3462. this._minY = Math.min(this._minY, e);
  3463. this._maxX = Math.max(this._maxX, a + b);
  3464. this._maxY = Math.max(this._maxY, e + d)
  3465. };
  3466. d.prototype.checkPoint = function(a, e) {
  3467. this._minX = Math.min(this._minX, a);
  3468. this._minY = Math.min(this._minY, e);
  3469. this._maxX = Math.max(this._maxX, a);
  3470. this._maxY = Math.max(this._maxY, e);
  3471. this._lastX = a;
  3472. this._lastY = e
  3473. };
  3474. d.prototype._measureBounds = function() {
  3475. return b.Rectangle.identity.initialize(this._minX, this._minY, this._maxX - this._minX, this._maxY - this._minY)
  3476. };
  3477. return d
  3478. } ();
  3479. b.Graphics = c;
  3480. c.prototype.__class__ = "egret.Graphics"; (function() {
  3481. return function(b, a, e) {
  3482. this.method = b;
  3483. this.thisObject = a;
  3484. this.args = e
  3485. }
  3486. })().prototype.__class__ = "egret.Command"
  3487. })(egret || (egret = {}));
  3488. __extends = this.__extends ||
  3489. function(b, c) {
  3490. function d() {
  3491. this.constructor = b
  3492. }
  3493. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3494. d.prototype = c.prototype;
  3495. b.prototype = new d
  3496. }; (function(b) {
  3497. var c = function(d) {
  3498. function a() {
  3499. d.call(this);
  3500. this._graphics = null
  3501. }
  3502. __extends(a, d);
  3503. Object.defineProperty(a.prototype, "graphics", {
  3504. get: function() {
  3505. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3506. return this._graphics
  3507. },
  3508. enumerable: !0,
  3509. configurable: !0
  3510. });
  3511. a.prototype._render = function(a) {
  3512. this._graphics && this._graphics._draw(a)
  3513. };
  3514. a.prototype._measureBounds = function() {
  3515. var a = this._graphics;
  3516. return a ? a._measureBounds() : d.prototype._measureBounds.call(this)
  3517. };
  3518. return a
  3519. } (b.DisplayObject);
  3520. b.Shape = c;
  3521. c.prototype.__class__ = "egret.Shape"
  3522. })(egret || (egret = {}));
  3523. __extends = this.__extends ||
  3524. function(b, c) {
  3525. function d() {
  3526. this.constructor = b
  3527. }
  3528. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3529. d.prototype = c.prototype;
  3530. b.prototype = new d
  3531. }; (function(b) {
  3532. var c = function(d) {
  3533. function a() {
  3534. d.call(this);
  3535. this._graphics = null
  3536. }
  3537. __extends(a, d);
  3538. Object.defineProperty(a.prototype, "graphics", {
  3539. get: function() {
  3540. this._graphics || (this._graphics = new b.Graphics, this.needDraw = !0);
  3541. return this._graphics
  3542. },
  3543. enumerable: !0,
  3544. configurable: !0
  3545. });
  3546. a.prototype._render = function(a) {
  3547. this._graphics && this._graphics._draw(a);
  3548. d.prototype._render.call(this, a)
  3549. };
  3550. a.prototype._measureBounds = function() {
  3551. for (var a = 0,
  3552. d = 0,
  3553. c = 0,
  3554. h = 0,
  3555. g = this._children.length,
  3556. f = 0; f < g; f++) {
  3557. var l = this._children[f];
  3558. if (l._visible) {
  3559. var n = l.getBounds(b.Rectangle.identity, !1),
  3560. p = n.x,
  3561. q = n.y,
  3562. r = n.width,
  3563. n = n.height,
  3564. l = l._getMatrix(),
  3565. l = b.DisplayObject.getTransformBounds(b.Rectangle.identity.initialize(p, q, r, n), l),
  3566. p = l.x,
  3567. q = l.y,
  3568. r = l.width + l.x,
  3569. l = l.height + l.y;
  3570. if (p < a || 0 == f) a = p;
  3571. if (r > d || 0 == f) d = r;
  3572. if (q < c || 0 == f) c = q;
  3573. if (l > h || 0 == f) h = l
  3574. }
  3575. }
  3576. if (this._graphics) {
  3577. g = this._graphics._measureBounds();
  3578. p = g.x;
  3579. q = g.y;
  3580. r = g.width + g.x;
  3581. l = g.height + g.y;
  3582. if (p < a || 0 == f) a = p;
  3583. if (r > d || 0 == f) d = r;
  3584. if (q < c || 0 == f) c = q;
  3585. if (l > h || 0 == f) h = l
  3586. }
  3587. return b.Rectangle.identity.initialize(a, c, d - a, h - c)
  3588. };
  3589. return a
  3590. } (b.DisplayObjectContainer);
  3591. b.Sprite = c;
  3592. c.prototype.__class__ = "egret.Sprite"
  3593. })(egret || (egret = {}));
  3594. __extends = this.__extends ||
  3595. function(b, c) {
  3596. function d() {
  3597. this.constructor = b
  3598. }
  3599. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  3600. d.prototype = c.prototype;
  3601. b.prototype = new d
  3602. }; (function(b) {
  3603. var c = function(d) {
  3604. function a() {
  3605. d.call(this);
  3606. this._inputEnabled = !1;
  3607. this._type = "";
  3608. this._inputUtils = null;
  3609. this._text = "";
  3610. this._displayAsPassword = !1;
  3611. this._fontFamily = a.default_fontFamily;
  3612. this._size = 30;
  3613. this._bold = this._italic = !1;
  3614. this._textColorString = "#FFFFFF";
  3615. this._textColor = 16777215;
  3616. this._strokeColorString = "#000000";
  3617. this._stroke = this._strokeColor = 0;
  3618. this._textAlign = "left";
  3619. this._verticalAlign = "top";
  3620. this._maxChars = 0;
  3621. this._scrollV = -1;
  3622. this._numLines = this._lineSpacing = this._maxScrollV = 0;
  3623. this._isFlow = this._multiline = !1;
  3624. this._textArr = [];
  3625. this._isArrayChanged = !1;
  3626. this._textMaxHeight = this._textMaxWidth = 0;
  3627. this._linesArr = [];
  3628. this.needDraw = !0
  3629. }
  3630. __extends(a, d);
  3631. a.prototype.isInput = function() {
  3632. return this._type == b.TextFieldType.INPUT
  3633. };
  3634. a.prototype._setTouchEnabled = function(a) {
  3635. d.prototype._setTouchEnabled.call(this, a);
  3636. this.isInput() && (this._inputEnabled = !0)
  3637. };
  3638. Object.defineProperty(a.prototype, "type", {
  3639. get: function() {
  3640. return this._type
  3641. },
  3642. set: function(a) {
  3643. this._setType(a)
  3644. },
  3645. enumerable: !0,
  3646. configurable: !0
  3647. });
  3648. a.prototype._setType = function(a) {
  3649. this._type != a && (this._type = a, this._type == b.TextFieldType.INPUT ? (this._hasWidthSet || this._setWidth(100), this._hasHeightSet || this._setHeight(30), null == this._inputUtils && (this._inputUtils = new b.InputController), this._inputUtils.init(this), this._setDirty(), this._stage && this._inputUtils._addStageText()) : this._inputUtils && (this._inputUtils._removeStageText(), this._inputUtils = null))
  3650. };
  3651. Object.defineProperty(a.prototype, "text", {
  3652. get: function() {
  3653. return this._getText()
  3654. },
  3655. set: function(a) {
  3656. this._setText(a)
  3657. },
  3658. enumerable: !0,
  3659. configurable: !0
  3660. });
  3661. a.prototype._getText = function() {
  3662. return this._type == b.TextFieldType.INPUT ? this._inputUtils._getText() : this._text
  3663. };
  3664. a.prototype._setSizeDirty = function() {
  3665. d.prototype._setSizeDirty.call(this);
  3666. this._isArrayChanged = !0
  3667. };
  3668. a.prototype._setTextDirty = function() {
  3669. this._setSizeDirty()
  3670. };
  3671. a.prototype._setBaseText = function(a) {
  3672. null == a && (a = "");
  3673. this._isFlow = !1;
  3674. this._text != a && (this._setTextDirty(), this._text = a, a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3675. text: a
  3676. }]))
  3677. };
  3678. a.prototype._setText = function(a) {
  3679. null == a && (a = "");
  3680. this._setBaseText(a);
  3681. this._inputUtils && this._inputUtils._setText(this._text)
  3682. };
  3683. Object.defineProperty(a.prototype, "displayAsPassword", {
  3684. get: function() {
  3685. return this._displayAsPassword
  3686. },
  3687. set: function(a) {
  3688. this._setDisplayAsPassword(a)
  3689. },
  3690. enumerable: !0,
  3691. configurable: !0
  3692. });
  3693. a.prototype._setDisplayAsPassword = function(a) {
  3694. this._displayAsPassword != a && (this._displayAsPassword = a, this._setTextDirty(), a = "", a = this._displayAsPassword ? this.changeToPassText(this._text) : this._text, this.setMiddleStyle([{
  3695. text: a
  3696. }]))
  3697. };
  3698. Object.defineProperty(a.prototype, "fontFamily", {
  3699. get: function() {
  3700. return this._fontFamily
  3701. },
  3702. set: function(a) {
  3703. this._setFontFamily(a)
  3704. },
  3705. enumerable: !0,
  3706. configurable: !0
  3707. });
  3708. a.prototype._setFontFamily = function(a) {
  3709. this._fontFamily != a && (this._setTextDirty(), this._fontFamily = a)
  3710. };
  3711. Object.defineProperty(a.prototype, "size", {
  3712. get: function() {
  3713. return this._size
  3714. },
  3715. set: function(a) {
  3716. this._setSize(a)
  3717. },
  3718. enumerable: !0,
  3719. configurable: !0
  3720. });
  3721. a.prototype._setSize = function(a) {
  3722. this._size != a && (this._setTextDirty(), this._size = a)
  3723. };
  3724. Object.defineProperty(a.prototype, "italic", {
  3725. get: function() {
  3726. return this._italic
  3727. },
  3728. set: function(a) {
  3729. this._setItalic(a)
  3730. },
  3731. enumerable: !0,
  3732. configurable: !0
  3733. });
  3734. a.prototype._setItalic = function(a) {
  3735. this._italic != a && (this._setTextDirty(), this._italic = a)
  3736. };
  3737. Object.defineProperty(a.prototype, "bold", {
  3738. get: function() {
  3739. return this._bold
  3740. },
  3741. set: function(a) {
  3742. this._setBold(a)
  3743. },
  3744. enumerable: !0,
  3745. configurable: !0
  3746. });
  3747. a.prototype._setBold = function(a) {
  3748. this._bold != a && (this._setTextDirty(), this._bold = a)
  3749. };
  3750. Object.defineProperty(a.prototype, "textColor", {
  3751. get: function() {
  3752. return this._textColor
  3753. },
  3754. set: function(a) {
  3755. this._setTextColor(a)
  3756. },
  3757. enumerable: !0,
  3758. configurable: !0
  3759. });
  3760. a.prototype._setTextColor = function(a) {
  3761. this._textColor != a && (this._setTextDirty(), this._textColor = a, this._textColorString = b.toColorString(a))
  3762. };
  3763. Object.defineProperty(a.prototype, "strokeColor", {
  3764. get: function() {
  3765. return this._strokeColor
  3766. },
  3767. set: function(a) {
  3768. this._setStrokeColor(a)
  3769. },
  3770. enumerable: !0,
  3771. configurable: !0
  3772. });
  3773. a.prototype._setStrokeColor = function(a) {
  3774. this._strokeColor != a && (this._setTextDirty(), this._strokeColor = a, this._strokeColorString = b.toColorString(a))
  3775. };
  3776. Object.defineProperty(a.prototype, "stroke", {
  3777. get: function() {
  3778. return this._stroke
  3779. },
  3780. set: function(a) {
  3781. this._setStroke(a)
  3782. },
  3783. enumerable: !0,
  3784. configurable: !0
  3785. });
  3786. a.prototype._setStroke = function(a) {
  3787. this._stroke != a && (this._setTextDirty(), this._stroke = a)
  3788. };
  3789. Object.defineProperty(a.prototype, "textAlign", {
  3790. get: function() {
  3791. return this._textAlign
  3792. },
  3793. set: function(a) {
  3794. this._setTextAlign(a)
  3795. },
  3796. enumerable: !0,
  3797. configurable: !0
  3798. });
  3799. a.prototype._setTextAlign = function(a) {
  3800. this._textAlign != a && (this._setTextDirty(), this._textAlign = a)
  3801. };
  3802. Object.defineProperty(a.prototype, "verticalAlign", {
  3803. get: function() {
  3804. return this._verticalAlign
  3805. },
  3806. set: function(a) {
  3807. this._setVerticalAlign(a)
  3808. },
  3809. enumerable: !0,
  3810. configurable: !0
  3811. });
  3812. a.prototype._setVerticalAlign = function(a) {
  3813. this._verticalAlign != a && (this._setTextDirty(), this._verticalAlign = a)
  3814. };
  3815. Object.defineProperty(a.prototype, "maxChars", {
  3816. get: function() {
  3817. return this._maxChars
  3818. },
  3819. set: function(a) {
  3820. this._setMaxChars(a)
  3821. },
  3822. enumerable: !0,
  3823. configurable: !0
  3824. });
  3825. a.prototype._setMaxChars = function(a) {
  3826. this._maxChars != a && (this._maxChars = a)
  3827. };
  3828. Object.defineProperty(a.prototype, "scrollV", {
  3829. set: function(a) {
  3830. this._scrollV = a;
  3831. this._setDirty()
  3832. },
  3833. enumerable: !0,
  3834. configurable: !0
  3835. });
  3836. Object.defineProperty(a.prototype, "maxScrollV", {
  3837. get: function() {
  3838. return this._maxScrollV
  3839. },
  3840. enumerable: !0,
  3841. configurable: !0
  3842. });
  3843. Object.defineProperty(a.prototype, "selectionBeginIndex", {
  3844. get: function() {
  3845. return 0
  3846. },
  3847. enumerable: !0,
  3848. configurable: !0
  3849. });
  3850. Object.defineProperty(a.prototype, "selectionEndIndex", {
  3851. get: function() {
  3852. return 0
  3853. },
  3854. enumerable: !0,
  3855. configurable: !0
  3856. });
  3857. Object.defineProperty(a.prototype, "caretIndex", {
  3858. get: function() {
  3859. return 0
  3860. },
  3861. enumerable: !0,
  3862. configurable: !0
  3863. });
  3864. a.prototype._setSelection = function(a, b) {};
  3865. Object.defineProperty(a.prototype, "lineSpacing", {
  3866. get: function() {
  3867. return this._lineSpacing
  3868. },
  3869. set: function(a) {
  3870. this._setLineSpacing(a)
  3871. },
  3872. enumerable: !0,
  3873. configurable: !0
  3874. });
  3875. a.prototype._setLineSpacing = function(a) {
  3876. this._lineSpacing != a && (this._setTextDirty(), this._lineSpacing = a)
  3877. };
  3878. a.prototype._getLineHeight = function() {
  3879. return this._lineSpacing + this._size
  3880. };
  3881. Object.defineProperty(a.prototype, "numLines", {
  3882. get: function() {
  3883. return this._numLines
  3884. },
  3885. enumerable: !0,
  3886. configurable: !0
  3887. });
  3888. Object.defineProperty(a.prototype, "multiline", {
  3889. get: function() {
  3890. return this._multiline
  3891. },
  3892. set: function(a) {
  3893. this._setMultiline(a)
  3894. },
  3895. enumerable: !0,
  3896. configurable: !0
  3897. });
  3898. a.prototype._setMultiline = function(a) {
  3899. this._multiline = a;
  3900. this._setDirty()
  3901. };
  3902. a.prototype.setFocus = function() {
  3903. b.Logger.warningWithErrorId(1013)
  3904. };
  3905. a.prototype._onRemoveFromStage = function() {
  3906. d.prototype._onRemoveFromStage.call(this);
  3907. this._type == b.TextFieldType.INPUT && this._inputUtils._removeStageText()
  3908. };
  3909. a.prototype._onAddToStage = function() {
  3910. d.prototype._onAddToStage.call(this);
  3911. this._type == b.TextFieldType.INPUT && this._inputUtils._addStageText()
  3912. };
  3913. a.prototype._updateBaseTransform = function() {
  3914. d.prototype._updateTransform.call(this)
  3915. };
  3916. a.prototype._updateTransform = function() {
  3917. this._type == b.TextFieldType.INPUT ? this._normalDirty ? this._inputUtils._updateProperties() : this._inputUtils._updateTransform() : this._updateBaseTransform()
  3918. };
  3919. a.prototype._render = function(a) {
  3920. this.drawText(a);
  3921. this._clearDirty()
  3922. };
  3923. a.prototype._measureBounds = function() {
  3924. return this._getLinesArr() ? b.Rectangle.identity.initialize(0, 0, this._textMaxWidth, this._textMaxHeight + (this._numLines - 1) * this._lineSpacing) : b.Rectangle.identity.initialize(0, 0, 0, 0)
  3925. };
  3926. Object.defineProperty(a.prototype, "textFlow", {
  3927. get: function() {
  3928. return this._textArr
  3929. },
  3930. set: function(a) {
  3931. this._isFlow = !0;
  3932. var b = "";
  3933. null == a && (a = []);
  3934. for (var d = 0; d < a.length; d++) b += a[d].text;
  3935. this._displayAsPassword ? this._setBaseText(b) : (this._text = b, this.setMiddleStyle(a))
  3936. },
  3937. enumerable: !0,
  3938. configurable: !0
  3939. });
  3940. a.prototype.changeToPassText = function(a) {
  3941. if (this._displayAsPassword) {
  3942. for (var b = "",
  3943. d = 0,
  3944. c = a.length; d < c; d++) switch (a.charAt(d)) {
  3945. case "\n":
  3946. b += "\n";
  3947. break;
  3948. case "\r":
  3949. break;
  3950. default:
  3951. b += "*"
  3952. }
  3953. return b
  3954. }
  3955. return a
  3956. };
  3957. a.prototype.setMiddleStyle = function(a) {
  3958. this._isArrayChanged = !0;
  3959. this._textArr = a;
  3960. this._setSizeDirty()
  3961. };
  3962. Object.defineProperty(a.prototype, "textWidth", {
  3963. get: function() {
  3964. return this._textMaxWidth
  3965. },
  3966. enumerable: !0,
  3967. configurable: !0
  3968. });
  3969. Object.defineProperty(a.prototype, "textHeight", {
  3970. get: function() {
  3971. return this._textMaxHeight
  3972. },
  3973. enumerable: !0,
  3974. configurable: !0
  3975. });
  3976. a.prototype.appendText = function(a) {
  3977. this.appendElement({
  3978. text: a
  3979. })
  3980. };
  3981. a.prototype.appendElement = function(a) {
  3982. this._textArr.push(a);
  3983. this.setMiddleStyle(this._textArr)
  3984. };
  3985. a.prototype._getLinesArr = function() {
  3986. if (!this._isArrayChanged) return this._linesArr;
  3987. this._isArrayChanged = !1;
  3988. var a = this._textArr,
  3989. d = b.MainContext.instance.rendererContext;
  3990. this._linesArr = [];
  3991. this._textMaxWidth = this._textMaxHeight = 0;
  3992. if (this._hasWidthSet && 0 == this._explicitWidth) return this._numLines = 0,
  3993. [{
  3994. width: 0,
  3995. height: 0,
  3996. elements: []
  3997. }];
  3998. var c = this._linesArr,
  3999. h = 0,
  4000. g = 0,
  4001. f = 0,
  4002. l;
  4003. this._isFlow || d.setupFont(this);
  4004. for (var n = 0; n < a.length; n++) {
  4005. var p = a[n];
  4006. p.style = p.style || {};
  4007. for (var q = p.text.toString().split(/(?:\r\n|\r|\n)/), r = 0; r < q.length; r++) {
  4008. null == c[f] && (l = {
  4009. width: 0,
  4010. height: 0,
  4011. elements: []
  4012. },
  4013. c[f] = l, g = h = 0);
  4014. g = this._type == b.TextFieldType.INPUT ? this._size: Math.max(g, p.style.size || this._size);
  4015. if ("" != q[r]) {
  4016. this._isFlow && d.setupFont(this, p.style);
  4017. var t = d.measureText(q[r]);
  4018. if (this._hasWidthSet) if (h + t <= this._explicitWidth) l.elements.push({
  4019. width: t,
  4020. text: q[r],
  4021. style: p.style
  4022. }),
  4023. h += t;
  4024. else {
  4025. for (var s = 0,
  4026. u = 0,
  4027. w = q[r], v = w.length; s < v; s++) {
  4028. t = d.measureText(w.charAt(s));
  4029. if (h + t > this._explicitWidth && 0 != h + s) break;
  4030. u += t;
  4031. h += t
  4032. }
  4033. 0 < s && (l.elements.push({
  4034. width: u,
  4035. text: w.substring(0, s),
  4036. style: p.style
  4037. }), q[r] = w.substring(s));
  4038. r--
  4039. } else h += t,
  4040. l.elements.push({
  4041. width: t,
  4042. text: q[r],
  4043. style: p.style
  4044. })
  4045. }
  4046. if (r < q.length - 1) {
  4047. l.width = h;
  4048. l.height = g;
  4049. this._textMaxWidth = Math.max(this._textMaxWidth, h);
  4050. this._textMaxHeight += g;
  4051. if (this._type == b.TextFieldType.INPUT && !this._multiline) return this._numLines = c.length,
  4052. c;
  4053. f++
  4054. }
  4055. }
  4056. n == a.length - 1 && l && (l.width = h, l.height = g, this._textMaxWidth = Math.max(this._textMaxWidth, h), this._textMaxHeight += g)
  4057. }
  4058. this._numLines = c.length;
  4059. return c
  4060. };
  4061. a.prototype.drawText = function(a) {
  4062. var d = this._getLinesArr();
  4063. if (d) {
  4064. this._isFlow || a.setupFont(this);
  4065. var c = this._hasWidthSet ? this._explicitWidth: this._textMaxWidth,
  4066. h = this._textMaxHeight + (this._numLines - 1) * this._lineSpacing,
  4067. g = 0,
  4068. f = 0;
  4069. if (this._hasHeightSet) if (h < this._explicitHeight) {
  4070. var l = 0;
  4071. this._verticalAlign == b.VerticalAlign.MIDDLE ? l = 0.5 : this._verticalAlign == b.VerticalAlign.BOTTOM && (l = 1);
  4072. g += l * (this._explicitHeight - h)
  4073. } else h > this._explicitHeight && (f = Math.max(this._scrollV - 1, 0), f = Math.min(this._numLines - 1, f));
  4074. g = Math.round(g);
  4075. h = 0;
  4076. this._textAlign == b.HorizontalAlign.CENTER ? h = 0.5 : this._textAlign == b.HorizontalAlign.RIGHT && (h = 1);
  4077. for (l = 0; f < this._numLines; f++) {
  4078. var n = d[f],
  4079. p = n.height,
  4080. g = g + p / 2;
  4081. if (0 != f && this._hasHeightSet && g > this._explicitHeight) break;
  4082. for (var l = Math.round((c - n.width) * h), q = 0; q < n.elements.length; q++) {
  4083. var r = n.elements[q],
  4084. t = r.style.size || this._size;
  4085. this._type == b.TextFieldType.INPUT ? a.drawText(this, r.text, l, g + (p - t) / 2, r.width) : (this._isFlow && a.setupFont(this, r.style), a.drawText(this, r.text, l, g + (p - t) / 2, r.width, r.style));
  4086. l += r.width
  4087. }
  4088. g += p / 2 + this._lineSpacing
  4089. }
  4090. }
  4091. };
  4092. a.default_fontFamily = "Arial";
  4093. return a
  4094. } (b.DisplayObject);
  4095. b.TextField = c;
  4096. c.prototype.__class__ = "egret.TextField"
  4097. })(egret || (egret = {})); (function(b) {
  4098. var c = function() {
  4099. function b() {
  4100. this.resutlArr = []
  4101. }
  4102. b.prototype.parser = function(a) {
  4103. this.stackArray = [];
  4104. this.resutlArr = [];
  4105. for (var e = 0,
  4106. b = a.length; e < b;) {
  4107. var d = a.indexOf("<", e);
  4108. 0 > d ? (this.addToResultArr(a.substring(e)), e = b) : (this.addToResultArr(a.substring(e, d)), e = a.indexOf(">", d), "/" == a.charAt(d + 1) ? this.stackArray.pop() : this.addToArray(a.substring(d + 1, e)), e += 1)
  4109. }
  4110. return this.resutlArr
  4111. };
  4112. b.prototype.addToResultArr = function(a) {
  4113. if ("" != a) {
  4114. var e = [];
  4115. e.push(["&lt;", "<"]);
  4116. e.push(["&gt;", ">"]);
  4117. e.push(["&amp;", "&"]);
  4118. e.push(["&quot;", '"']);
  4119. e.push(["&apos;;", "'"]);
  4120. for (var b = 0; b < e.length; b++) a.replace(new RegExp(e[b][0], "g"), e[b][1]);
  4121. 0 < this.stackArray.length ? this.resutlArr.push({
  4122. text: a,
  4123. style: this.stackArray[this.stackArray.length - 1]
  4124. }) : this.resutlArr.push({
  4125. text: a
  4126. })
  4127. }
  4128. };
  4129. b.prototype.changeStringToObject = function(a) {
  4130. var e = {};
  4131. a = a.replace(/( )+/g, " ").split(" ");
  4132. for (var b = 0; b < a.length; b++) this.addProperty(e, a[b]);
  4133. return e
  4134. };
  4135. b.prototype.addProperty = function(a, e) {
  4136. var b = e.replace(/( )*=( )*/g, "=").split("=");
  4137. b[1] && (b[1] = b[1].replace(/(\"|\')/g, ""));
  4138. switch (b[0].toLowerCase()) {
  4139. case "color":
  4140. a.textColor = parseInt(b[1]);
  4141. break;
  4142. case "b":
  4143. a.bold = "true" == (b[1] || "true");
  4144. break;
  4145. case "i":
  4146. a.italic = "true" == (b[1] || "true");
  4147. break;
  4148. case "size":
  4149. a.size = parseInt(b[1]);
  4150. break;
  4151. case "fontFamily":
  4152. a.fontFamily = b[1]
  4153. }
  4154. };
  4155. b.prototype.addToArray = function(a) {
  4156. a = this.changeStringToObject(a);
  4157. if (0 != this.stackArray.length) {
  4158. var e = this.stackArray[this.stackArray.length - 1],
  4159. b;
  4160. for (b in e) null == a[b] && (a[b] = e[b])
  4161. }
  4162. this.stackArray.push(a)
  4163. };
  4164. return b
  4165. } ();
  4166. b.HtmlTextParser = c;
  4167. c.prototype.__class__ = "egret.HtmlTextParser"
  4168. })(egret || (egret = {})); (function(b) {
  4169. var c = function() {
  4170. function b() {}
  4171. b.DYNAMIC = "dynamic";
  4172. b.INPUT = "input";
  4173. return b
  4174. } ();
  4175. b.TextFieldType = c;
  4176. c.prototype.__class__ = "egret.TextFieldType"
  4177. })(egret || (egret = {}));
  4178. __extends = this.__extends ||
  4179. function(b, c) {
  4180. function d() {
  4181. this.constructor = b
  4182. }
  4183. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4184. d.prototype = c.prototype;
  4185. b.prototype = new d
  4186. }; (function(b) {
  4187. var c = function(d) {
  4188. function a(a) {
  4189. d.call(this);
  4190. this.bitmapData = this._bitmapY = this._bitmapX = this._sourceHeight = this._sourceWidth = 0;
  4191. this._textureMap = {};
  4192. var b = a.bitmapData;
  4193. this.bitmapData = b;
  4194. this._sourceWidth = b.width;
  4195. this._sourceHeight = b.height;
  4196. this._bitmapX = a._bitmapX - a._offsetX;
  4197. this._bitmapY = a._bitmapY - a._offsetY
  4198. }
  4199. __extends(a, d);
  4200. a.prototype.getTexture = function(a) {
  4201. return this._textureMap[a]
  4202. };
  4203. a.prototype.createTexture = function(a, d, c, h, g, f, l, n, p) {
  4204. void 0 === f && (f = 0);
  4205. void 0 === l && (l = 0);
  4206. "undefined" === typeof n && (n = f + h);
  4207. "undefined" === typeof p && (p = l + g);
  4208. var q = new b.Texture,
  4209. r = b.MainContext.instance.rendererContext._texture_scale_factor;
  4210. q._bitmapData = this.bitmapData;
  4211. q._bitmapX = this._bitmapX + d;
  4212. q._bitmapY = this._bitmapY + c;
  4213. q._bitmapWidth = h * r;
  4214. q._bitmapHeight = g * r;
  4215. q._offsetX = f;
  4216. q._offsetY = l;
  4217. q._textureWidth = n * r;
  4218. q._textureHeight = p * r;
  4219. q._sourceWidth = this._sourceWidth;
  4220. q._sourceHeight = this._sourceHeight;
  4221. return this._textureMap[a] = q
  4222. };
  4223. return a
  4224. } (b.HashObject);
  4225. b.SpriteSheet = c;
  4226. c.prototype.__class__ = "egret.SpriteSheet"
  4227. })(egret || (egret = {}));
  4228. __extends = this.__extends ||
  4229. function(b, c) {
  4230. function d() {
  4231. this.constructor = b
  4232. }
  4233. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4234. d.prototype = c.prototype;
  4235. b.prototype = new d
  4236. }; (function(b) {
  4237. var c = function(d) {
  4238. function a() {
  4239. d.call(this);
  4240. this._isFocus = !1;
  4241. this._text = null;
  4242. this._isFirst = this._isFirst = !0
  4243. }
  4244. __extends(a, d);
  4245. a.prototype.init = function(a) {
  4246. this._text = a;
  4247. this.stageText = b.StageText.create();
  4248. a = this._text.localToGlobal();
  4249. this.stageText._open(a.x, a.y, this._text._explicitWidth, this._text._explicitHeight)
  4250. };
  4251. a.prototype._addStageText = function() {
  4252. this._text._inputEnabled || (this._text._touchEnabled = !0);
  4253. this.stageText._add();
  4254. this.stageText._addListeners();
  4255. this.stageText.addEventListener("blur", this.onBlurHandler, this);
  4256. this.stageText.addEventListener("focus", this.onFocusHandler, this);
  4257. this.stageText.addEventListener("updateText", this.updateTextHandler, this);
  4258. this._text.addEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4259. b.MainContext.instance.stage.addEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4260. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this)
  4261. };
  4262. a.prototype._removeStageText = function() {
  4263. this.stageText._remove();
  4264. this.stageText._removeListeners();
  4265. this._text._inputEnabled || (this._text._touchEnabled = !1);
  4266. this.stageText.removeEventListener("blur", this.onBlurHandler, this);
  4267. this.stageText.removeEventListener("focus", this.onFocusHandler, this);
  4268. this.stageText.removeEventListener("updateText", this.updateTextHandler, this);
  4269. this._text.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onMouseDownHandler, this);
  4270. b.MainContext.instance.stage.removeEventListener(b.TouchEvent.TOUCH_TAP, this.onStageDownHandler, this);
  4271. b.MainContext.instance.stage.removeEventListener(b.Event.RESIZE, this.onResize, this)
  4272. };
  4273. a.prototype.onResize = function() {
  4274. this._isFirst = !0
  4275. };
  4276. a.prototype._getText = function() {
  4277. return this.stageText._getText()
  4278. };
  4279. a.prototype._setText = function(a) {
  4280. this.stageText._setText(a)
  4281. };
  4282. a.prototype.onFocusHandler = function(a) {
  4283. this.hideText()
  4284. };
  4285. a.prototype.onBlurHandler = function(a) {
  4286. this.showText()
  4287. };
  4288. a.prototype.onMouseDownHandler = function(a) {
  4289. a.stopPropagation();
  4290. this._text._visible && this.stageText._show()
  4291. };
  4292. a.prototype.onStageDownHandler = function(a) {
  4293. this.stageText._hide();
  4294. this.showText()
  4295. };
  4296. a.prototype.showText = function() {
  4297. this._isFocus && (this._isFocus = !1, this.resetText())
  4298. };
  4299. a.prototype.hideText = function() {
  4300. this._isFocus || (this._text._setBaseText(""), this._isFocus = !0)
  4301. };
  4302. a.prototype.updateTextHandler = function(a) {
  4303. this.resetText();
  4304. this._text.dispatchEvent(new b.Event(b.Event.CHANGE))
  4305. };
  4306. a.prototype.resetText = function() {
  4307. this._text._setBaseText(this.stageText._getText())
  4308. };
  4309. a.prototype._updateTransform = function() {
  4310. var a = this._text._worldTransform.a,
  4311. d = this._text._worldTransform.b,
  4312. c = this._text._worldTransform.c,
  4313. h = this._text._worldTransform.d,
  4314. g = this._text._worldTransform.tx,
  4315. f = this._text._worldTransform.ty;
  4316. this._text._updateBaseTransform();
  4317. var l = this._text._worldTransform;
  4318. if (this._isFirst || a != l.a || d != l.b || c != l.c || h != l.d || g != l.tx || f != l.ty) {
  4319. this._isFirst = !1;
  4320. a = this._text.localToGlobal();
  4321. this.stageText.changePosition(a.x, a.y);
  4322. var n = this;
  4323. b.callLater(function() {
  4324. n.stageText._setScale(n._text._worldTransform.a, n._text._worldTransform.d)
  4325. },
  4326. this)
  4327. }
  4328. };
  4329. a.prototype._updateProperties = function() {
  4330. var a = this._text._stage;
  4331. if (null == a) this.stageText._setVisible(!1);
  4332. else {
  4333. for (var d = this._text,
  4334. c = d._visible; c;) {
  4335. d = d.parent;
  4336. if (d == a) break;
  4337. c = d._visible
  4338. }
  4339. this.stageText._setVisible(c)
  4340. }
  4341. this.stageText._setMultiline(this._text._multiline);
  4342. this.stageText._setMaxChars(this._text._maxChars);
  4343. this.stageText._setSize(this._text._size);
  4344. this.stageText._setTextColor(this._text._textColorString);
  4345. this.stageText._setTextFontFamily(this._text._fontFamily);
  4346. this.stageText._setBold(this._text._bold);
  4347. this.stageText._setItalic(this._text._italic);
  4348. this.stageText._setTextAlign(this._text._textAlign);
  4349. this.stageText._setWidth(this._text._getSize(b.Rectangle.identity).width);
  4350. this.stageText._setHeight(this._text._getSize(b.Rectangle.identity).height);
  4351. this.stageText._setTextType(this._text._displayAsPassword ? "password": "text");
  4352. this.stageText._setText(this._text._text);
  4353. this.stageText._resetStageText();
  4354. this._updateTransform()
  4355. };
  4356. return a
  4357. } (b.HashObject);
  4358. b.InputController = c;
  4359. c.prototype.__class__ = "egret.InputController"
  4360. })(egret || (egret = {}));
  4361. __extends = this.__extends ||
  4362. function(b, c) {
  4363. function d() {
  4364. this.constructor = b
  4365. }
  4366. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4367. d.prototype = c.prototype;
  4368. b.prototype = new d
  4369. }; (function(b) {
  4370. var c = function(b) {
  4371. function a(a, k) {
  4372. b.call(this, a);
  4373. this.firstCharHeight = 0;
  4374. "string" == typeof k ? this.charList = this.parseConfig(k) : k && k.hasOwnProperty("frames") ? this.charList = k.frames: this.charList = {}
  4375. }
  4376. __extends(a, b);
  4377. a.prototype.getTexture = function(a) {
  4378. var b = this._textureMap[a];
  4379. if (!b) {
  4380. b = this.charList[a];
  4381. if (!b) return null;
  4382. b = this.createTexture(a, b.x, b.y, b.w, b.h, b.offX, b.offY, b.sourceW, b.sourceH);
  4383. this._textureMap[a] = b
  4384. }
  4385. return b
  4386. };
  4387. a.prototype._getFirstCharHeight = function() {
  4388. if (0 == this.firstCharHeight) for (var a in this.charList) {
  4389. var b = this.charList[a];
  4390. if (b) {
  4391. var d = b.sourceH;
  4392. void 0 === d && (d = b.h, void 0 === d && (d = 0), b = b.offY, void 0 === b && (b = 0), d += b);
  4393. if (! (0 >= d)) {
  4394. this.firstCharHeight = d;
  4395. break
  4396. }
  4397. }
  4398. }
  4399. return this.firstCharHeight
  4400. };
  4401. a.prototype.parseConfig = function(a) {
  4402. a = a.split("\r\n").join("\n");
  4403. a = a.split("\n");
  4404. for (var b = this.getConfigByKey(a[3], "count"), d = {},
  4405. c = 4; c < 4 + b; c++) {
  4406. var g = a[c],
  4407. f = String.fromCharCode(this.getConfigByKey(g, "id")),
  4408. l = {};
  4409. d[f] = l;
  4410. l.x = this.getConfigByKey(g, "x");
  4411. l.y = this.getConfigByKey(g, "y");
  4412. l.w = this.getConfigByKey(g, "width");
  4413. l.h = this.getConfigByKey(g, "height");
  4414. l.offX = this.getConfigByKey(g, "xoffset");
  4415. l.offY = this.getConfigByKey(g, "yoffset")
  4416. }
  4417. return d
  4418. };
  4419. a.prototype.getConfigByKey = function(a, b) {
  4420. for (var d = a.split(" "), c = 0, g = d.length; c < g; c++) {
  4421. var f = d[c];
  4422. if (b == f.substring(0, b.length)) return d = f.substring(b.length + 1),
  4423. parseInt(d)
  4424. }
  4425. return 0
  4426. };
  4427. return a
  4428. } (b.SpriteSheet);
  4429. b.BitmapFont = c;
  4430. c.prototype.__class__ = "egret.BitmapFont"
  4431. })(egret || (egret = {}));
  4432. __extends = this.__extends ||
  4433. function(b, c) {
  4434. function d() {
  4435. this.constructor = b
  4436. }
  4437. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4438. d.prototype = c.prototype;
  4439. b.prototype = new d
  4440. }; (function(b) {
  4441. var c = function(d) {
  4442. function a(a, k) {
  4443. d.call(this, a, k);
  4444. b.Logger.warningWithErrorId(1012)
  4445. }
  4446. __extends(a, d);
  4447. return a
  4448. } (b.BitmapFont);
  4449. b.BitmapTextSpriteSheet = c;
  4450. c.prototype.__class__ = "egret.BitmapTextSpriteSheet"
  4451. })(egret || (egret = {}));
  4452. __extends = this.__extends ||
  4453. function(b, c) {
  4454. function d() {
  4455. this.constructor = b
  4456. }
  4457. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4458. d.prototype = c.prototype;
  4459. b.prototype = new d
  4460. }; (function(b) {
  4461. var c = function(d) {
  4462. function a(a) {
  4463. d.call(this);
  4464. this._isAddedToStage = !1;
  4465. this._frames = this._movieClipData = this._textureToRender = null;
  4466. this._totalFrames = 0;
  4467. this._frameLabels = null;
  4468. this._frameIntervalTime = 0;
  4469. this._eventPool = null;
  4470. this._isPlaying = !1;
  4471. this._isStopped = !0;
  4472. this._passedTime = this._displayedKeyFrameNum = this._nextFrameNum = this._currentFrameNum = this._playTimes = 0;
  4473. this._setMovieClipData(a);
  4474. this.needDraw = !0
  4475. }
  4476. __extends(a, d);
  4477. a.prototype._init = function() {
  4478. this._reset();
  4479. var a = this._movieClipData;
  4480. a && a._isDataValid() && (this._frames = a.frames, this._totalFrames = a.numFrames, this._frameLabels = a.labels, this._frameIntervalTime = 1E3 / a.frameRate, this._initFrame())
  4481. };
  4482. a.prototype._reset = function() {
  4483. this._frames = null;
  4484. this._playTimes = 0;
  4485. this._isPlaying = !1;
  4486. this.setIsStopped(!0);
  4487. this._currentFrameNum = 0;
  4488. this._nextFrameNum = 1;
  4489. this._passedTime = this._displayedKeyFrameNum = 0;
  4490. this._eventPool = []
  4491. };
  4492. a.prototype._initFrame = function() {
  4493. this._movieClipData._isTextureValid() && (this._advanceFrame(), this._constructFrame())
  4494. };
  4495. a.prototype._render = function(e) {
  4496. var b = this._textureToRender;
  4497. if (this._texture_to_render = b) {
  4498. var d = Math.round(b._offsetX),
  4499. c = Math.round(b._offsetY),
  4500. g = b._bitmapWidth || b._textureWidth,
  4501. f = b._bitmapHeight || b._textureHeight,
  4502. l = Math.round(g),
  4503. n = Math.round(f);
  4504. a.renderFilter.drawImage(e, this, b._bitmapX, b._bitmapY, g, f, d, c, l, n)
  4505. }
  4506. };
  4507. a.prototype._measureBounds = function() {
  4508. var a = this._textureToRender;
  4509. return a ? b.Rectangle.identity.initialize(a._offsetX, a._offsetY, a._textureWidth, a._textureHeight) : d.prototype._measureBounds.call(this)
  4510. };
  4511. a.prototype._onAddToStage = function() {
  4512. d.prototype._onAddToStage.call(this);
  4513. this._isAddedToStage = !0;
  4514. this._isPlaying && 1 < this._totalFrames && this.setIsStopped(!1)
  4515. };
  4516. a.prototype._onRemoveFromStage = function() {
  4517. d.prototype._onRemoveFromStage.call(this);
  4518. this._isAddedToStage = !1;
  4519. this.setIsStopped(!0)
  4520. };
  4521. a.prototype._getFrameLabelByName = function(a, b) {
  4522. void 0 === b && (b = !1);
  4523. b && (a = a.toLowerCase());
  4524. var d = this._frameLabels;
  4525. if (d) for (var c = null,
  4526. g = 0; g < d.length; g++) if (c = d[g], b ? c.name.toLowerCase() === a: c.name === a) return c;
  4527. return null
  4528. };
  4529. a.prototype._getFrameLabelByFrame = function(a) {
  4530. var b = this._frameLabels;
  4531. if (b) for (var d = null,
  4532. c = 0; c < b.length; c++) if (d = b[c], d.frame === a) return d;
  4533. return null
  4534. };
  4535. a.prototype._getFrameLabelForFrame = function(a) {
  4536. var b = null,
  4537. d = null,
  4538. c = this._frameLabels;
  4539. if (c) for (var g = 0; g < c.length; g++) {
  4540. d = c[g];
  4541. if (d.frame > a) break;
  4542. b = d
  4543. }
  4544. return b
  4545. };
  4546. a.prototype.play = function(a) {
  4547. void 0 === a && (a = 0);
  4548. this._isPlaying = !0;
  4549. this.setPlayTimes(a);
  4550. 1 < this._totalFrames && this._isAddedToStage && this.setIsStopped(!1)
  4551. };
  4552. a.prototype.stop = function() {
  4553. this._isPlaying = !1;
  4554. this.setIsStopped(!0)
  4555. };
  4556. a.prototype.prevFrame = function() {
  4557. this.gotoAndStop(this._currentFrameNum - 1)
  4558. };
  4559. a.prototype.nextFrame = function() {
  4560. this.gotoAndStop(this._currentFrameNum + 1)
  4561. };
  4562. a.prototype.gotoAndPlay = function(a, d) {
  4563. void 0 === d && (d = 0);
  4564. if (0 === arguments.length || 2 < arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndPlay()"));
  4565. this.play(d);
  4566. this._gotoFrame(a)
  4567. };
  4568. a.prototype.gotoAndStop = function(a) {
  4569. if (1 != arguments.length) throw Error(b.getString(1022, "MovieClip.gotoAndStop()"));
  4570. this.stop();
  4571. this._gotoFrame(a)
  4572. };
  4573. a.prototype._gotoFrame = function(a) {
  4574. var d;
  4575. if ("string" === typeof a) d = this._getFrameLabelByName(a).frame;
  4576. else if (d = parseInt(a + "", 10), d != a) throw Error(b.getString(1022, "Frame Label Not Found"));
  4577. 1 > d ? d = 1 : d > this._totalFrames && (d = this._totalFrames);
  4578. d !== this._nextFrameNum && (this._nextFrameNum = d, this._advanceFrame(), this._constructFrame(), this._handlePendingEvent())
  4579. };
  4580. a.prototype._advanceTime = function(a) {
  4581. var d = this._frameIntervalTime;
  4582. a = this._passedTime + a;
  4583. this._passedTime = a % d;
  4584. d = a / d;
  4585. if (! (1 > d)) {
  4586. for (; 1 <= d;) {
  4587. d--;
  4588. this._nextFrameNum++;
  4589. if (this._nextFrameNum > this._totalFrames) if ( - 1 == this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4590. this._nextFrameNum = 1;
  4591. else if (this._playTimes--, 0 < this._playTimes) this._eventPool.push(b.Event.LOOP_COMPLETE),
  4592. this._nextFrameNum = 1;
  4593. else {
  4594. this._nextFrameNum = this._totalFrames;
  4595. this._eventPool.push(b.Event.COMPLETE);
  4596. this.stop();
  4597. break
  4598. }
  4599. this._advanceFrame()
  4600. }
  4601. this._constructFrame();
  4602. this._handlePendingEvent()
  4603. }
  4604. };
  4605. a.prototype._advanceFrame = function() {
  4606. this._currentFrameNum = this._nextFrameNum
  4607. };
  4608. a.prototype._constructFrame = function() {
  4609. var a = this._currentFrameNum;
  4610. this._displayedKeyFrameNum != a && (this._textureToRender = this._movieClipData.getTextureByFrame(a), this._displayedKeyFrameNum = a)
  4611. };
  4612. a.prototype._handlePendingEvent = function() {
  4613. if (0 != this._eventPool.length) {
  4614. this._eventPool.reverse();
  4615. for (var a = this._eventPool,
  4616. d = a.length,
  4617. c = !1,
  4618. h = !1,
  4619. g = 0; g < d; g++) {
  4620. var f = a.pop();
  4621. f == b.Event.LOOP_COMPLETE ? h = !0 : f == b.Event.COMPLETE ? c = !0 : this.dispatchEventWith(f)
  4622. }
  4623. h && this.dispatchEventWith(b.Event.LOOP_COMPLETE);
  4624. c && this.dispatchEventWith(b.Event.COMPLETE)
  4625. }
  4626. };
  4627. Object.defineProperty(a.prototype, "totalFrames", {
  4628. get: function() {
  4629. return this._totalFrames
  4630. },
  4631. enumerable: !0,
  4632. configurable: !0
  4633. });
  4634. Object.defineProperty(a.prototype, "currentFrame", {
  4635. get: function() {
  4636. return this._currentFrameNum
  4637. },
  4638. enumerable: !0,
  4639. configurable: !0
  4640. });
  4641. Object.defineProperty(a.prototype, "currentFrameLabel", {
  4642. get: function() {
  4643. var a = this._getFrameLabelByFrame(this._currentFrameNum);
  4644. return a && a.name
  4645. },
  4646. enumerable: !0,
  4647. configurable: !0
  4648. });
  4649. Object.defineProperty(a.prototype, "currentLabel", {
  4650. get: function() {
  4651. var a = this._getFrameLabelForFrame(this._currentFrameNum);
  4652. return a ? a.name: null
  4653. },
  4654. enumerable: !0,
  4655. configurable: !0
  4656. });
  4657. Object.defineProperty(a.prototype, "frameRate", {
  4658. get: function() {
  4659. return this.movieClipData.frameRate
  4660. },
  4661. set: function(a) {
  4662. a != this._movieClipData.frameRate && (this._movieClipData.frameRate = a, this._frameIntervalTime = 1E3 / this._movieClipData.frameRate)
  4663. },
  4664. enumerable: !0,
  4665. configurable: !0
  4666. });
  4667. Object.defineProperty(a.prototype, "isPlaying", {
  4668. get: function() {
  4669. return this._isPlaying
  4670. },
  4671. enumerable: !0,
  4672. configurable: !0
  4673. });
  4674. Object.defineProperty(a.prototype, "movieClipData", {
  4675. get: function() {
  4676. return this._movieClipData
  4677. },
  4678. set: function(a) {
  4679. this._setMovieClipData(a)
  4680. },
  4681. enumerable: !0,
  4682. configurable: !0
  4683. });
  4684. a.prototype._setMovieClipData = function(a) {
  4685. this._movieClipData != a && (this._movieClipData = a, this._init())
  4686. };
  4687. a.prototype.setPlayTimes = function(a) {
  4688. if (0 > a || 1 <= a) this._playTimes = 0 > a ? -1 : Math.floor(a)
  4689. };
  4690. a.prototype.setIsStopped = function(a) {
  4691. this._isStopped != a && ((this._isStopped = a) ? (this._playTimes = 0, b.Ticker.getInstance().unregister(this._advanceTime, this)) : (this._playTimes = 0 == this._playTimes ? 1 : this._playTimes, b.Ticker.getInstance().register(this._advanceTime, this)))
  4692. };
  4693. a.renderFilter = b.RenderFilter.getInstance();
  4694. return a
  4695. } (b.DisplayObject);
  4696. b.MovieClip = c;
  4697. c.prototype.__class__ = "egret.MovieClip"
  4698. })(egret || (egret = {}));
  4699. __extends = this.__extends ||
  4700. function(b, c) {
  4701. function d() {
  4702. this.constructor = b
  4703. }
  4704. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4705. d.prototype = c.prototype;
  4706. b.prototype = new d
  4707. }; (function(b) {
  4708. var c = function(b) {
  4709. function a(a, k) {
  4710. b.call(this);
  4711. this._name = a;
  4712. this._frame = k | 0
  4713. }
  4714. __extends(a, b);
  4715. Object.defineProperty(a.prototype, "name", {
  4716. get: function() {
  4717. return this._name
  4718. },
  4719. enumerable: !0,
  4720. configurable: !0
  4721. });
  4722. Object.defineProperty(a.prototype, "frame", {
  4723. get: function() {
  4724. return this._frame
  4725. },
  4726. enumerable: !0,
  4727. configurable: !0
  4728. });
  4729. a.prototype.clone = function() {
  4730. return new a(this._name, this._frame)
  4731. };
  4732. return a
  4733. } (b.EventDispatcher);
  4734. b.FrameLabel = c;
  4735. c.prototype.__class__ = "egret.FrameLabel"
  4736. })(egret || (egret = {}));
  4737. __extends = this.__extends ||
  4738. function(b, c) {
  4739. function d() {
  4740. this.constructor = b
  4741. }
  4742. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4743. d.prototype = c.prototype;
  4744. b.prototype = new d
  4745. }; (function(b) {
  4746. var c = function(d) {
  4747. function a() {
  4748. d.call(this);
  4749. this._mcData = null;
  4750. this.numFrames = 1;
  4751. this.frames = [];
  4752. this.labels = null;
  4753. this.frameRate = 0;
  4754. this.spriteSheet = this.textureData = null
  4755. }
  4756. __extends(a, d);
  4757. a.prototype._init = function(a, b, d) {
  4758. this.textureData = b;
  4759. this.spriteSheet = d;
  4760. this._setMCData(a)
  4761. };
  4762. a.prototype.getKeyFrameData = function(a) {
  4763. a = this.frames[a - 1];
  4764. a.frame && (a = this.frames[a.frame - 1]);
  4765. return a
  4766. };
  4767. a.prototype.getTextureByFrame = function(a) {
  4768. a = this.getKeyFrameData(a);
  4769. if (a.res) {
  4770. var b = this.getTextureByResName(a.res);
  4771. b._offsetX = a.x | 0;
  4772. b._offsetY = a.y | 0;
  4773. return b
  4774. }
  4775. return null
  4776. };
  4777. a.prototype.getTextureByResName = function(a) {
  4778. var b = this.spriteSheet.getTexture(a);
  4779. b || (b = this.textureData[a], b = this.spriteSheet.createTexture(a, b.x, b.y, b.w, b.h));
  4780. return b
  4781. };
  4782. a.prototype._isDataValid = function() {
  4783. return 0 < this.frames.length
  4784. };
  4785. a.prototype._isTextureValid = function() {
  4786. return null != this.textureData && null != this.spriteSheet
  4787. };
  4788. a.prototype._fillMCData = function(a) {
  4789. this.frameRate = a.frameRate || 24;
  4790. this._fillFramesData(a.frames);
  4791. this._fillFrameLabelsData(a.labels)
  4792. };
  4793. a.prototype._fillFramesData = function(a) {
  4794. for (var b = this.frames,
  4795. d = a ? a.length: 0, c, g = 0; g < d; g++) if (c = a[g], b.push(c), c.duration) {
  4796. var f = parseInt(c.duration);
  4797. if (1 < f) {
  4798. c = b.length;
  4799. for (var l = 1; l < f; l++) b.push({
  4800. frame: c
  4801. })
  4802. }
  4803. }
  4804. this.numFrames = b.length
  4805. };
  4806. a.prototype._fillFrameLabelsData = function(a) {
  4807. if (a) {
  4808. var d = a.length;
  4809. if (0 < d) {
  4810. this.labels = [];
  4811. for (var c = 0; c < d; c++) {
  4812. var h = a[c];
  4813. this.labels.push(new b.FrameLabel(h.name, h.frame))
  4814. }
  4815. }
  4816. }
  4817. };
  4818. Object.defineProperty(a.prototype, "mcData", {
  4819. get: function() {
  4820. return this._mcData
  4821. },
  4822. set: function(a) {
  4823. this._setMCData(a)
  4824. },
  4825. enumerable: !0,
  4826. configurable: !0
  4827. });
  4828. a.prototype._setMCData = function(a) {
  4829. this._mcData != a && (this._mcData = a) && this._fillMCData(a)
  4830. };
  4831. return a
  4832. } (b.HashObject);
  4833. b.MovieClipData = c;
  4834. c.prototype.__class__ = "egret.MovieClipData"
  4835. })(egret || (egret = {}));
  4836. __extends = this.__extends ||
  4837. function(b, c) {
  4838. function d() {
  4839. this.constructor = b
  4840. }
  4841. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4842. d.prototype = c.prototype;
  4843. b.prototype = new d
  4844. }; (function(b) {
  4845. var c = function(d) {
  4846. function a(a, b) {
  4847. d.call(this);
  4848. this.enableCache = !0;
  4849. this._mcDataCache = {};
  4850. this._mcDataSet = a;
  4851. this.setTexture(b)
  4852. }
  4853. __extends(a, d);
  4854. a.prototype.clearCache = function() {
  4855. this._mcDataCache = {}
  4856. };
  4857. a.prototype.generateMovieClipData = function(a) {
  4858. void 0 === a && (a = "");
  4859. if ("" == a && this._mcDataSet) for (a in this._mcDataSet.mc) break;
  4860. if ("" == a) return null;
  4861. var d = this._findFromCache(a, this._mcDataCache);
  4862. d || (d = new b.MovieClipData, this._fillData(a, d, this._mcDataCache));
  4863. return d
  4864. };
  4865. a.prototype._findFromCache = function(a, b) {
  4866. return this.enableCache && b[a] ? b[a] : null
  4867. };
  4868. a.prototype._fillData = function(a, b, d) {
  4869. if (this._mcDataSet) {
  4870. var c = this._mcDataSet.mc[a];
  4871. c && (b._init(c, this._mcDataSet.res, this._spriteSheet), this.enableCache && (d[a] = b))
  4872. }
  4873. };
  4874. Object.defineProperty(a.prototype, "mcDataSet", {
  4875. get: function() {
  4876. return this._mcDataSet
  4877. },
  4878. set: function(a) {
  4879. this._mcDataSet = a
  4880. },
  4881. enumerable: !0,
  4882. configurable: !0
  4883. });
  4884. Object.defineProperty(a.prototype, "texture", {
  4885. set: function(a) {
  4886. this.setTexture(a)
  4887. },
  4888. enumerable: !0,
  4889. configurable: !0
  4890. });
  4891. Object.defineProperty(a.prototype, "spriteSheet", {
  4892. get: function() {
  4893. return this._spriteSheet
  4894. },
  4895. enumerable: !0,
  4896. configurable: !0
  4897. });
  4898. a.prototype.setTexture = function(a) {
  4899. this._spriteSheet = a ? new b.SpriteSheet(a) : null
  4900. };
  4901. return a
  4902. } (b.EventDispatcher);
  4903. b.MovieClipDataFactory = c;
  4904. c.prototype.__class__ = "egret.MovieClipDataFactory"
  4905. })(egret || (egret = {}));
  4906. __extends = this.__extends ||
  4907. function(b, c) {
  4908. function d() {
  4909. this.constructor = b
  4910. }
  4911. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  4912. d.prototype = c.prototype;
  4913. b.prototype = new d
  4914. }; (function(b) {
  4915. var c = function(b) {
  4916. function a() {
  4917. b.call(this);
  4918. this._scaleY = this._scaleX = 1;
  4919. this._size = 30;
  4920. this._color = "#FFFFFF";
  4921. this._fontFamily = "Arial";
  4922. this._italic = this._bold = !1;
  4923. this._textAlign = "left";
  4924. this._multiline = this._visible = !1;
  4925. this._maxChars = 0
  4926. }
  4927. __extends(a, b);
  4928. a.prototype._getText = function() {
  4929. return null
  4930. };
  4931. a.prototype._setText = function(a) {};
  4932. a.prototype._setTextType = function(a) {};
  4933. a.prototype._getTextType = function() {
  4934. return null
  4935. };
  4936. a.prototype._open = function(a, b, d, c) {};
  4937. a.prototype._show = function() {};
  4938. a.prototype._add = function() {};
  4939. a.prototype._remove = function() {};
  4940. a.prototype._hide = function() {};
  4941. a.prototype._addListeners = function() {};
  4942. a.prototype._removeListeners = function() {};
  4943. a.prototype._setScale = function(a, b) {
  4944. this._scaleX = a;
  4945. this._scaleY = b
  4946. };
  4947. a.prototype.changePosition = function(a, b) {};
  4948. a.prototype._setSize = function(a) {
  4949. this._size = a
  4950. };
  4951. a.prototype._setTextColor = function(a) {
  4952. this._color = a
  4953. };
  4954. a.prototype._setTextFontFamily = function(a) {
  4955. this._fontFamily = a
  4956. };
  4957. a.prototype._setBold = function(a) {
  4958. this._bold = a
  4959. };
  4960. a.prototype._setItalic = function(a) {
  4961. this._italic = a
  4962. };
  4963. a.prototype._setTextAlign = function(a) {
  4964. this._textAlign = a
  4965. };
  4966. a.prototype._setVisible = function(a) {
  4967. this._visible = a
  4968. };
  4969. a.prototype._setWidth = function(a) {};
  4970. a.prototype._setHeight = function(a) {};
  4971. a.prototype._setMultiline = function(a) {
  4972. this._multiline = a
  4973. };
  4974. a.prototype._setMaxChars = function(a) {
  4975. this._maxChars = a
  4976. };
  4977. a.prototype._resetStageText = function() {};
  4978. a.create = function() {
  4979. return null
  4980. };
  4981. return a
  4982. } (b.EventDispatcher);
  4983. b.StageText = c;
  4984. c.prototype.__class__ = "egret.StageText"
  4985. })(egret || (egret = {})); (function(b) {
  4986. var c = function() {
  4987. function b() {}
  4988. b.GET = "get";
  4989. b.POST = "post";
  4990. return b
  4991. } ();
  4992. b.URLRequestMethod = c;
  4993. c.prototype.__class__ = "egret.URLRequestMethod"
  4994. })(egret || (egret = {})); (function(b) {
  4995. var c = function() {
  4996. function b() {}
  4997. b.BINARY = "binary";
  4998. b.TEXT = "text";
  4999. b.VARIABLES = "variables";
  5000. b.TEXTURE = "texture";
  5001. b.SOUND = "sound";
  5002. return b
  5003. } ();
  5004. b.URLLoaderDataFormat = c;
  5005. c.prototype.__class__ = "egret.URLLoaderDataFormat"
  5006. })(egret || (egret = {}));
  5007. __extends = this.__extends ||
  5008. function(b, c) {
  5009. function d() {
  5010. this.constructor = b
  5011. }
  5012. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5013. d.prototype = c.prototype;
  5014. b.prototype = new d
  5015. }; (function(b) {
  5016. var c = function(b) {
  5017. function a(a) {
  5018. void 0 === a && (a = null);
  5019. b.call(this);
  5020. this.variables = null;
  5021. null !== a && this.decode(a)
  5022. }
  5023. __extends(a, b);
  5024. a.prototype.decode = function(a) {
  5025. this.variables || (this.variables = {});
  5026. a = a.split("+").join(" ");
  5027. for (var b, d = /[?&]?([^=]+)=([^&]*)/g; b = d.exec(a);) {
  5028. var c = decodeURIComponent(b[1]);
  5029. b = decodeURIComponent(b[2]);
  5030. if (!1 == c in this.variables) this.variables[c] = b;
  5031. else {
  5032. var g = this.variables[c];
  5033. g instanceof Array ? g.push(b) : this.variables[c] = [g, b]
  5034. }
  5035. }
  5036. };
  5037. a.prototype.toString = function() {
  5038. if (!this.variables) return "";
  5039. var a = this.variables,
  5040. b = [],
  5041. d;
  5042. for (d in a) b.push(this.encodeValue(d, a[d]));
  5043. return b.join("&")
  5044. };
  5045. a.prototype.encodeValue = function(a, b) {
  5046. return b instanceof Array ? this.encodeArray(a, b) : encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5047. };
  5048. a.prototype.encodeArray = function(a, b) {
  5049. return a ? 0 == b.length ? encodeURIComponent(a) + "=": b.map(function(b) {
  5050. return encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5051. }).join("&") : ""
  5052. };
  5053. return a
  5054. } (b.HashObject);
  5055. b.URLVariables = c;
  5056. c.prototype.__class__ = "egret.URLVariables"
  5057. })(egret || (egret = {})); (function(b) {
  5058. var c = function() {
  5059. return function(b, a) {
  5060. this.value = this.name = "";
  5061. this.name = b;
  5062. this.value = a
  5063. }
  5064. } ();
  5065. b.URLRequestHeader = c;
  5066. c.prototype.__class__ = "egret.URLRequestHeader"
  5067. })(egret || (egret = {}));
  5068. __extends = this.__extends ||
  5069. function(b, c) {
  5070. function d() {
  5071. this.constructor = b
  5072. }
  5073. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5074. d.prototype = c.prototype;
  5075. b.prototype = new d
  5076. }; (function(b) {
  5077. var c = function(d) {
  5078. function a(a) {
  5079. void 0 === a && (a = null);
  5080. d.call(this);
  5081. this.data = null;
  5082. this.method = b.URLRequestMethod.GET;
  5083. this.url = "";
  5084. this.url = a
  5085. }
  5086. __extends(a, d);
  5087. return a
  5088. } (b.HashObject);
  5089. b.URLRequest = c;
  5090. c.prototype.__class__ = "egret.URLRequest"
  5091. })(egret || (egret = {}));
  5092. __extends = this.__extends ||
  5093. function(b, c) {
  5094. function d() {
  5095. this.constructor = b
  5096. }
  5097. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5098. d.prototype = c.prototype;
  5099. b.prototype = new d
  5100. }; (function(b) {
  5101. var c = function(d) {
  5102. function a(a) {
  5103. void 0 === a && (a = null);
  5104. d.call(this);
  5105. this.dataFormat = b.URLLoaderDataFormat.TEXT;
  5106. this._request = this.data = null;
  5107. this._status = -1;
  5108. a && this.load(a)
  5109. }
  5110. __extends(a, d);
  5111. a.prototype.load = function(a) {
  5112. this._request = a;
  5113. this.data = null;
  5114. b.MainContext.instance.netContext.proceed(this)
  5115. };
  5116. return a
  5117. } (b.EventDispatcher);
  5118. b.URLLoader = c;
  5119. c.prototype.__class__ = "egret.URLLoader"
  5120. })(egret || (egret = {}));
  5121. __extends = this.__extends ||
  5122. function(b, c) {
  5123. function d() {
  5124. this.constructor = b
  5125. }
  5126. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5127. d.prototype = c.prototype;
  5128. b.prototype = new d
  5129. }; (function(b) {
  5130. var c = function(d) {
  5131. function a() {
  5132. d.call(this);
  5133. this._sourceHeight = this._sourceWidth = this._textureHeight = this._textureWidth = this._offsetY = this._offsetX = this._bitmapHeight = this._bitmapWidth = this._bitmapY = this._bitmapX = 0;
  5134. this._bitmapData = null
  5135. }
  5136. __extends(a, d);
  5137. Object.defineProperty(a.prototype, "textureWidth", {
  5138. get: function() {
  5139. return this._textureWidth
  5140. },
  5141. enumerable: !0,
  5142. configurable: !0
  5143. });
  5144. Object.defineProperty(a.prototype, "textureHeight", {
  5145. get: function() {
  5146. return this._textureHeight
  5147. },
  5148. enumerable: !0,
  5149. configurable: !0
  5150. });
  5151. Object.defineProperty(a.prototype, "bitmapData", {
  5152. get: function() {
  5153. return this._bitmapData
  5154. },
  5155. enumerable: !0,
  5156. configurable: !0
  5157. });
  5158. a.prototype._setBitmapData = function(a) {
  5159. var d = b.MainContext.instance.rendererContext._texture_scale_factor;
  5160. this._bitmapData = a;
  5161. this._sourceWidth = a.width;
  5162. this._sourceHeight = a.height;
  5163. this._textureWidth = this._sourceWidth * d;
  5164. this._textureHeight = this._sourceHeight * d;
  5165. this._bitmapWidth = this._textureWidth;
  5166. this._bitmapHeight = this._textureHeight;
  5167. this._offsetX = this._offsetY = this._bitmapX = this._bitmapY = 0
  5168. };
  5169. a.prototype.getPixel32 = function(a, b) {
  5170. return this._bitmapData.getContext("2d").getImageData(a, b, 1, 1).data
  5171. };
  5172. return a
  5173. } (b.HashObject);
  5174. b.Texture = c;
  5175. c.prototype.__class__ = "egret.Texture"
  5176. })(egret || (egret = {}));
  5177. __extends = this.__extends ||
  5178. function(b, c) {
  5179. function d() {
  5180. this.constructor = b
  5181. }
  5182. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5183. d.prototype = c.prototype;
  5184. b.prototype = new d
  5185. }; (function(b) {
  5186. var c = function(d) {
  5187. function a() {
  5188. d.call(this)
  5189. }
  5190. __extends(a, d);
  5191. a.prototype.init = function() {
  5192. this._bitmapData = document.createElement("canvas");
  5193. this.renderContext = b.RendererContext.createRendererContext(this._bitmapData)
  5194. };
  5195. a.prototype.drawToTexture = function(e, d, c) {
  5196. var h = d || e.getBounds(b.Rectangle.identity);
  5197. if (0 == h.width || 0 == h.height) return ! 1;
  5198. this._bitmapData || this.init();
  5199. var g = h.x,
  5200. f = h.y;
  5201. d = h.width;
  5202. var h = h.height,
  5203. l = b.MainContext.instance.rendererContext._texture_scale_factor,
  5204. h = h / l;
  5205. d = Math.round(d / l);
  5206. h = Math.round(h);
  5207. this.setSize(d, h);
  5208. this.begin();
  5209. e._worldTransform.identity();
  5210. e._worldTransform.a = 1 / l;
  5211. e._worldTransform.d = 1 / l;
  5212. c && (e._worldTransform.a *= c, e._worldTransform.d *= c);
  5213. c = e._anchorOffsetX;
  5214. var n = e._anchorOffsetY;
  5215. if (0 != e._anchorX || 0 != e._anchorY) c = e._anchorX * d,
  5216. n = e._anchorY * h;
  5217. this._offsetX = g + c;
  5218. this._offsetY = f + n;
  5219. e._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  5220. e.worldAlpha = 1;
  5221. if (e instanceof b.DisplayObjectContainer) for (g = e._children, f = 0, c = g.length; f < c; f++) g[f]._updateTransform();
  5222. this.renderContext.setTransform(e._worldTransform);
  5223. g = b.RenderFilter.getInstance();
  5224. f = g._drawAreaList.concat();
  5225. g._drawAreaList.length = 0;
  5226. this.renderContext.clearScreen();
  5227. this.renderContext.onRenderStart();
  5228. b.RendererContext.deleteTexture(this);
  5229. e._filter && this.renderContext.setGlobalFilter(e._filter);
  5230. e._colorTransform && this.renderContext.setGlobalColorTransform(e._colorTransform.matrix); (c = e.mask || e._scrollRect) && this.renderContext.pushMask(c);
  5231. n = b.MainContext.__use_new_draw;
  5232. b.MainContext.__use_new_draw = !1;
  5233. e._render(this.renderContext);
  5234. b.MainContext.__use_new_draw = n;
  5235. c && this.renderContext.popMask();
  5236. e._colorTransform && this.renderContext.setGlobalColorTransform(null);
  5237. e._filter && this.renderContext.setGlobalFilter(null);
  5238. a.identityRectangle.width = d;
  5239. a.identityRectangle.height = h;
  5240. g.addDrawArea(a.identityRectangle);
  5241. this.renderContext.onRenderFinish();
  5242. g._drawAreaList = f;
  5243. this._sourceWidth = d;
  5244. this._sourceHeight = h;
  5245. this._textureWidth = this._sourceWidth * l;
  5246. this._textureHeight = this._sourceHeight * l;
  5247. this.end();
  5248. return ! 0
  5249. };
  5250. a.prototype.setSize = function(a, b) {
  5251. var d = this._bitmapData;
  5252. d.width = a;
  5253. d.height = b;
  5254. d.style.width = a + "px";
  5255. d.style.height = b + "px";
  5256. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = a, this.renderContext._cacheCanvas.height = b)
  5257. };
  5258. a.prototype.begin = function() {};
  5259. a.prototype.end = function() {};
  5260. a.prototype.dispose = function() {
  5261. this._bitmapData && (this.renderContext = this._bitmapData = null)
  5262. };
  5263. a.identityRectangle = new b.Rectangle;
  5264. return a
  5265. } (b.Texture);
  5266. b.RenderTexture = c;
  5267. c.prototype.__class__ = "egret.RenderTexture"
  5268. })(egret || (egret = {}));
  5269. __extends = this.__extends ||
  5270. function(b, c) {
  5271. function d() {
  5272. this.constructor = b
  5273. }
  5274. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5275. d.prototype = c.prototype;
  5276. b.prototype = new d
  5277. }; (function(b) {
  5278. var c = function(d) {
  5279. function a() {
  5280. d.call(this);
  5281. this.renderCost = 0;
  5282. this._texture_scale_factor = 1;
  5283. this.profiler = b.Profiler.getInstance();
  5284. a.blendModesForGL || a.initBlendMode()
  5285. }
  5286. __extends(a, d);
  5287. Object.defineProperty(a.prototype, "texture_scale_factor", {
  5288. get: function() {
  5289. return this._texture_scale_factor
  5290. },
  5291. set: function(a) {
  5292. this._setTextureScaleFactor(a)
  5293. },
  5294. enumerable: !0,
  5295. configurable: !0
  5296. });
  5297. a.prototype._setTextureScaleFactor = function(a) {
  5298. this._texture_scale_factor = a
  5299. };
  5300. a.prototype.clearScreen = function() {};
  5301. a.prototype.clearRect = function(a, b, d, c) {};
  5302. a.prototype.drawImage = function(a, b, d, c, g, f, l, n, p, q) {
  5303. this.profiler.onDrawImage()
  5304. };
  5305. a.prototype.drawImageScale9 = function(a, b, d, c, g, f, l, n, p, q) {
  5306. return ! 1
  5307. };
  5308. a.prototype._addOneDraw = function() {
  5309. this.profiler.onDrawImage()
  5310. };
  5311. a.prototype.setTransform = function(a) {};
  5312. a.prototype.setAlpha = function(a, b) {};
  5313. a.prototype.setupFont = function(a, b) {};
  5314. a.prototype.measureText = function(a) {
  5315. return 0
  5316. };
  5317. a.prototype.drawText = function(a, b, d, c, g, f) {
  5318. this.profiler.onDrawImage()
  5319. };
  5320. a.prototype.strokeRect = function(a, b, d, c, g) {};
  5321. a.prototype.pushMask = function(a) {};
  5322. a.prototype.popMask = function() {};
  5323. a.prototype.onRenderStart = function() {};
  5324. a.prototype.onRenderFinish = function() {};
  5325. a.prototype.setGlobalColorTransform = function(a) {};
  5326. a.prototype.setGlobalFilter = function(a) {};
  5327. a.createRendererContext = function(a) {
  5328. return null
  5329. };
  5330. a.deleteTexture = function(a) {
  5331. var d = b.MainContext.instance.rendererContext.gl;
  5332. if (a = a._bitmapData) {
  5333. var c = a.webGLTexture;
  5334. if (c && d) for (var h in c) d.deleteTexture(c[h]);
  5335. a.webGLTexture = null
  5336. }
  5337. };
  5338. a.initBlendMode = function() {
  5339. a.blendModesForGL = {};
  5340. a.blendModesForGL[b.BlendMode.NORMAL] = [1, 771];
  5341. a.blendModesForGL[b.BlendMode.ADD] = [770, 1]
  5342. };
  5343. a.registerBlendModeForGL = function(e, d, c, h) {
  5344. a.blendModesForGL[e] && !h ? b.Logger.warningWithErrorId(1005, e) : a.blendModesForGL[e] = [d, c]
  5345. };
  5346. a.imageSmoothingEnabled = !0;
  5347. a.blendModesForGL = null;
  5348. return a
  5349. } (b.HashObject);
  5350. b.RendererContext = c;
  5351. c.prototype.__class__ = "egret.RendererContext"
  5352. })(egret || (egret = {})); (function(b) {
  5353. var c = function() {
  5354. function b() {}
  5355. b.MOUSE = "mouse";
  5356. b.TOUCH = "touch";
  5357. b.mode = "touch";
  5358. return b
  5359. } ();
  5360. b.InteractionMode = c;
  5361. c.prototype.__class__ = "egret.InteractionMode"
  5362. })(egret || (egret = {}));
  5363. __extends = this.__extends ||
  5364. function(b, c) {
  5365. function d() {
  5366. this.constructor = b
  5367. }
  5368. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5369. d.prototype = c.prototype;
  5370. b.prototype = new d
  5371. }; (function(b) {
  5372. var c = function(d) {
  5373. function a() {
  5374. d.call(this);
  5375. this._currentTouchTarget = {};
  5376. this.maxTouches = 2;
  5377. this.touchDownTarget = {};
  5378. this.touchingIdentifiers = [];
  5379. this.lastTouchY = this.lastTouchX = -1
  5380. }
  5381. __extends(a, d);
  5382. a.prototype.run = function() {};
  5383. a.prototype.getTouchData = function(a, b, d) {
  5384. var c = this._currentTouchTarget[a];
  5385. null == c && (c = {},
  5386. this._currentTouchTarget[a] = c);
  5387. c.stageX = b;
  5388. c.stageY = d;
  5389. c.identifier = a;
  5390. return c
  5391. };
  5392. a.prototype.dispatchEvent = function(a, d) {
  5393. b.TouchEvent.dispatchTouchEvent(d.target, a, d.identifier, d.stageX, d.stageY, !1, !1, !1, !0 == this.touchDownTarget[d.identifier])
  5394. };
  5395. a.prototype.onTouchBegan = function(a, d, c) {
  5396. if (this.touchingIdentifiers.length != this.maxTouches) {
  5397. var h = b.MainContext.instance.stage.hitTest(a, d);
  5398. h && (a = this.getTouchData(c, a, d), this.touchDownTarget[c] = !0, a.target = h, a.beginTarget = h, this.dispatchEvent(b.TouchEvent.TOUCH_BEGIN, a));
  5399. this.touchingIdentifiers.push(c)
  5400. }
  5401. };
  5402. a.prototype.onTouchMove = function(a, d, c) {
  5403. if ( - 1 != this.touchingIdentifiers.indexOf(c) && (a != this.lastTouchX || d != this.lastTouchY)) {
  5404. this.lastTouchX = a;
  5405. this.lastTouchY = d;
  5406. var h = b.MainContext.instance.stage.hitTest(a, d);
  5407. h && (a = this.getTouchData(c, a, d), a.target = h, this.dispatchEvent(b.TouchEvent.TOUCH_MOVE, a))
  5408. }
  5409. };
  5410. a.prototype.onTouchEnd = function(a, d, c) {
  5411. var h = this.touchingIdentifiers.indexOf(c); - 1 != h && (this.touchingIdentifiers.splice(h, 1), h = b.MainContext.instance.stage.hitTest(a, d)) && (a = this.getTouchData(c, a, d), delete this.touchDownTarget[c], c = a.beginTarget, a.target = h, this.dispatchEvent(b.TouchEvent.TOUCH_END, a), c == h ? this.dispatchEvent(b.TouchEvent.TOUCH_TAP, a) : a.beginTarget && (a.target = a.beginTarget, this.dispatchEvent(b.TouchEvent.TOUCH_RELEASE_OUTSIDE, a)), delete this._currentTouchTarget[a.identifier])
  5412. };
  5413. return a
  5414. } (b.HashObject);
  5415. b.TouchContext = c;
  5416. c.prototype.__class__ = "egret.TouchContext"
  5417. })(egret || (egret = {}));
  5418. __extends = this.__extends ||
  5419. function(b, c) {
  5420. function d() {
  5421. this.constructor = b
  5422. }
  5423. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5424. d.prototype = c.prototype;
  5425. b.prototype = new d
  5426. }; (function(b) {
  5427. var c = function(d) {
  5428. function a() {
  5429. d.call(this)
  5430. }
  5431. __extends(a, d);
  5432. a.prototype.proceed = function(a) {};
  5433. a._getUrl = function(a) {
  5434. var d = a.url; - 1 == d.indexOf("?") && a.method == b.URLRequestMethod.GET && a.data && a.data instanceof b.URLVariables && (d = d + "?" + a.data.toString());
  5435. return d
  5436. };
  5437. a.prototype.getChangeList = function() {
  5438. return []
  5439. };
  5440. return a
  5441. } (b.HashObject);
  5442. b.NetContext = c;
  5443. c.prototype.__class__ = "egret.NetContext"
  5444. })(egret || (egret = {}));
  5445. __extends = this.__extends ||
  5446. function(b, c) {
  5447. function d() {
  5448. this.constructor = b
  5449. }
  5450. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5451. d.prototype = c.prototype;
  5452. b.prototype = new d
  5453. }; (function(b) {
  5454. var c = function(b) {
  5455. function a() {
  5456. b.call(this);
  5457. this.frameRate = 60
  5458. }
  5459. __extends(a, b);
  5460. a.prototype.executeMainLoop = function(a, b) {};
  5461. return a
  5462. } (b.HashObject);
  5463. b.DeviceContext = c;
  5464. c.prototype.__class__ = "egret.DeviceContext"
  5465. })(egret || (egret = {})); (function(b) {
  5466. var c = function() {
  5467. function b() {}
  5468. b.call = function(a, e) {};
  5469. b.addCallback = function(a, e) {};
  5470. return b
  5471. } ();
  5472. b.ExternalInterface = c;
  5473. c.prototype.__class__ = "egret.ExternalInterface"
  5474. })(egret || (egret = {}));
  5475. __extends = this.__extends ||
  5476. function(b, c) {
  5477. function d() {
  5478. this.constructor = b
  5479. }
  5480. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5481. d.prototype = c.prototype;
  5482. b.prototype = new d
  5483. }; (function(b) {
  5484. var c = function(d) {
  5485. function a() {
  5486. d.call(this);
  5487. this.trans = null;
  5488. this.ua = navigator.userAgent.toLowerCase();
  5489. this.trans = this._getTrans()
  5490. }
  5491. __extends(a, d);
  5492. a.getInstance = function() {
  5493. null == a.instance && (a.instance = new a);
  5494. return a.instance
  5495. };
  5496. Object.defineProperty(a.prototype, "isMobile", {
  5497. get: function() {
  5498. b.Logger.warningWithErrorId(1E3);
  5499. return b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE
  5500. },
  5501. enumerable: !0,
  5502. configurable: !0
  5503. });
  5504. a.prototype._getHeader = function(a) {
  5505. if ("transform" in a) return "";
  5506. for (var b = ["webkit", "ms", "Moz", "O"], d = 0; d < b.length; d++) if (b[d] + "Transform" in a) return b[d];
  5507. return ""
  5508. };
  5509. a.prototype._getTrans = function() {
  5510. var a = document.createElement("div").style,
  5511. a = this._getHeader(a);
  5512. return "" == a ? "transform": a + "Transform"
  5513. };
  5514. a.prototype.$new = function(a) {
  5515. return this.$(document.createElement(a))
  5516. };
  5517. a.prototype.$ = function(e) {
  5518. var d = document;
  5519. if (e = e instanceof HTMLElement ? e: d.querySelector(e)) e.find = e.find || this.$,
  5520. e.hasClass = e.hasClass ||
  5521. function(a) {
  5522. return this.className.match(new RegExp("(\\s|^)" + a + "(\\s|$)"))
  5523. },
  5524. e.addClass = e.addClass ||
  5525. function(a) {
  5526. this.hasClass(a) || (this.className && (this.className += " "), this.className += a);
  5527. return this
  5528. },
  5529. e.removeClass = e.removeClass ||
  5530. function(a) {
  5531. this.hasClass(a) && (this.className = this.className.replace(a, ""));
  5532. return this
  5533. },
  5534. e.remove = e.remove ||
  5535. function() {},
  5536. e.appendTo = e.appendTo ||
  5537. function(a) {
  5538. a.appendChild(this);
  5539. return this
  5540. },
  5541. e.prependTo = e.prependTo ||
  5542. function(a) {
  5543. a.childNodes[0] ? a.insertBefore(this, a.childNodes[0]) : a.appendChild(this);
  5544. return this
  5545. },
  5546. e.transforms = e.transforms ||
  5547. function() {
  5548. this.style[a.getInstance().trans] = a.getInstance().translate(this.position) + a.getInstance().rotate(this.rotation) + a.getInstance().scale(this.scale) + a.getInstance().skew(this.skew);
  5549. return this
  5550. },
  5551. e.position = e.position || {
  5552. x: 0,
  5553. y: 0
  5554. },
  5555. e.rotation = e.rotation || 0,
  5556. e.scale = e.scale || {
  5557. x: 1,
  5558. y: 1
  5559. },
  5560. e.skew = e.skew || {
  5561. x: 0,
  5562. y: 0
  5563. },
  5564. e.translates = function(a, e) {
  5565. this.position.x = a;
  5566. this.position.y = e - b.MainContext.instance.stage.stageHeight;
  5567. this.transforms();
  5568. return this
  5569. },
  5570. e.rotate = function(a) {
  5571. this.rotation = a;
  5572. this.transforms();
  5573. return this
  5574. },
  5575. e.resize = function(a, e) {
  5576. this.scale.x = a;
  5577. this.scale.y = e;
  5578. this.transforms();
  5579. return this
  5580. },
  5581. e.setSkew = function(a, e) {
  5582. this.skew.x = a;
  5583. this.skew.y = e;
  5584. this.transforms();
  5585. return this
  5586. };
  5587. return e
  5588. };
  5589. a.prototype.translate = function(a) {
  5590. return "translate(" + a.x + "px, " + a.y + "px) "
  5591. };
  5592. a.prototype.rotate = function(a) {
  5593. return "rotate(" + a + "deg) "
  5594. };
  5595. a.prototype.scale = function(a) {
  5596. return "scale(" + a.x + ", " + a.y + ") "
  5597. };
  5598. a.prototype.skew = function(a) {
  5599. return "skewX(" + -a.x + "deg) skewY(" + a.y + "deg)"
  5600. };
  5601. return a
  5602. } (b.HashObject);
  5603. b.Browser = c;
  5604. c.prototype.__class__ = "egret.Browser"
  5605. })(egret || (egret = {})); (function(b) { (function(b) {
  5606. b.getItem = function(b) {
  5607. return null
  5608. };
  5609. b.setItem = function(b, a) {
  5610. return ! 1
  5611. };
  5612. b.removeItem = function(b) {};
  5613. b.clear = function() {}
  5614. })(b.localStorage || (b.localStorage = {}))
  5615. })(egret || (egret = {})); (function(b) {
  5616. var c = function() {
  5617. function d() {}
  5618. d.parse = function(a) {
  5619. a = b.SAXParser.getInstance().parserXML(a);
  5620. if (!a || !a.childNodes) return null;
  5621. for (var e = a.childNodes.length,
  5622. c = !1,
  5623. m = 0; m < e; m++) {
  5624. var h = a.childNodes[m];
  5625. if (1 == h.nodeType) {
  5626. c = !0;
  5627. break
  5628. }
  5629. }
  5630. return c ? d.parseNode(h) : null
  5631. };
  5632. d.parseNode = function(a) {
  5633. if (!a || 1 != a.nodeType) return null;
  5634. var e = {};
  5635. e.localName = a.localName;
  5636. e.name = a.nodeName;
  5637. a.namespaceURI && (e.namespace = a.namespaceURI);
  5638. a.prefix && (e.prefix = a.prefix);
  5639. for (var b = a.attributes,
  5640. c = b.length,
  5641. h = 0; h < c; h++) {
  5642. var g = b[h],
  5643. f = g.name;
  5644. 0 != f.indexOf("xmlns:") && (e["$" + f] = g.value)
  5645. }
  5646. b = a.childNodes;
  5647. c = b.length;
  5648. for (h = 0; h < c; h++) if (g = d.parseNode(b[h])) e.children || (e.children = []),
  5649. g.parent = e,
  5650. e.children.push(g); ! e.children && (a = a.textContent.trim()) && (e.text = a);
  5651. return e
  5652. };
  5653. d.findChildren = function(a, e, b) {
  5654. b ? b.length = 0 : b = [];
  5655. d.findByPath(a, e, b);
  5656. return b
  5657. };
  5658. d.findByPath = function(a, e, b) {
  5659. var c = e.indexOf("."),
  5660. h; - 1 == c ? (h = e, c = !0) : (h = e.substring(0, c), e = e.substring(c + 1), c = !1);
  5661. if (a = a.children) for (var g = a.length,
  5662. f = 0; f < g; f++) {
  5663. var l = a[f];
  5664. l.localName == h && (c ? b.push(l) : d.findByPath(l, e, b))
  5665. }
  5666. };
  5667. d.getAttributes = function(a, e) {
  5668. e ? e.length = 0 : e = [];
  5669. for (var b in a)"$" == b.charAt(0) && e.push(b.substring(1));
  5670. return e
  5671. };
  5672. return d
  5673. } ();
  5674. b.XML = c;
  5675. c.prototype.__class__ = "egret.XML"
  5676. })(egret || (egret = {})); (function(b) {
  5677. var c = function() {
  5678. function a() {}
  5679. a.LITTLE_ENDIAN = "LITTLE_ENDIAN";
  5680. a.BIG_ENDIAN = "BIG_ENDIAN";
  5681. return a
  5682. } ();
  5683. b.Endian = c;
  5684. c.prototype.__class__ = "egret.Endian";
  5685. var d = function() {
  5686. function a(a) {
  5687. this.BUFFER_EXT_SIZE = 0;
  5688. this.EOF_code_point = this.EOF_byte = -1;
  5689. this._setArrayBuffer(a || new ArrayBuffer(this.BUFFER_EXT_SIZE));
  5690. this.endian = c.BIG_ENDIAN
  5691. }
  5692. a.prototype._setArrayBuffer = function(a) {
  5693. this.write_position = a.byteLength;
  5694. this.data = new DataView(a, 0, a.byteLength);
  5695. this._position = 0
  5696. };
  5697. a.prototype.setArrayBuffer = function(a) {};
  5698. Object.defineProperty(a.prototype, "buffer", {
  5699. get: function() {
  5700. return this.data.buffer
  5701. },
  5702. set: function(a) {
  5703. this.data = new DataView(a)
  5704. },
  5705. enumerable: !0,
  5706. configurable: !0
  5707. });
  5708. Object.defineProperty(a.prototype, "dataView", {
  5709. get: function() {
  5710. return this.data
  5711. },
  5712. set: function(a) {
  5713. this.data = a;
  5714. this.write_position = a.byteLength
  5715. },
  5716. enumerable: !0,
  5717. configurable: !0
  5718. });
  5719. Object.defineProperty(a.prototype, "bufferOffset", {
  5720. get: function() {
  5721. return this.data.byteOffset
  5722. },
  5723. enumerable: !0,
  5724. configurable: !0
  5725. });
  5726. Object.defineProperty(a.prototype, "position", {
  5727. get: function() {
  5728. return this._position
  5729. },
  5730. set: function(a) {
  5731. this._position < a && !this.validate(this._position - a) || (this._position = a, this.write_position = a > this.write_position ? a: this.write_position)
  5732. },
  5733. enumerable: !0,
  5734. configurable: !0
  5735. });
  5736. Object.defineProperty(a.prototype, "length", {
  5737. get: function() {
  5738. return this.write_position
  5739. },
  5740. set: function(a) {
  5741. this.validateBuffer(a)
  5742. },
  5743. enumerable: !0,
  5744. configurable: !0
  5745. });
  5746. Object.defineProperty(a.prototype, "bytesAvailable", {
  5747. get: function() {
  5748. return this.data.byteLength - this._position
  5749. },
  5750. enumerable: !0,
  5751. configurable: !0
  5752. });
  5753. a.prototype.clear = function() {
  5754. this._setArrayBuffer(new ArrayBuffer(this.BUFFER_EXT_SIZE))
  5755. };
  5756. a.prototype.readBoolean = function() {
  5757. return this.validate(a.SIZE_OF_BOOLEAN) ? 0 != this.data.getUint8(this.position++) : null
  5758. };
  5759. a.prototype.readByte = function() {
  5760. return this.validate(a.SIZE_OF_INT8) ? this.data.getInt8(this.position++) : null
  5761. };
  5762. a.prototype.readBytes = function(a, b, d) {
  5763. void 0 === d && (d = 0);
  5764. if (0 == d) d = this.bytesAvailable;
  5765. else if (!this.validate(d)) return null;
  5766. a.dataView = new DataView(this.data.buffer, this.bufferOffset + this.position, d);
  5767. this.position += d
  5768. };
  5769. a.prototype.readDouble = function() {
  5770. if (!this.validate(a.SIZE_OF_FLOAT64)) return null;
  5771. var e = this.data.getFloat64(this.position, this.endian == c.LITTLE_ENDIAN);
  5772. this.position += a.SIZE_OF_FLOAT64;
  5773. return e
  5774. };
  5775. a.prototype.readFloat = function() {
  5776. if (!this.validate(a.SIZE_OF_FLOAT32)) return null;
  5777. var e = this.data.getFloat32(this.position, this.endian == c.LITTLE_ENDIAN);
  5778. this.position += a.SIZE_OF_FLOAT32;
  5779. return e
  5780. };
  5781. a.prototype.readInt = function() {
  5782. if (!this.validate(a.SIZE_OF_INT32)) return null;
  5783. var e = this.data.getInt32(this.position, this.endian == c.LITTLE_ENDIAN);
  5784. this.position += a.SIZE_OF_INT32;
  5785. return e
  5786. };
  5787. a.prototype.readMultiByte = function(a, b) {
  5788. return this.validate(a) ? "": null
  5789. };
  5790. a.prototype.readShort = function() {
  5791. if (!this.validate(a.SIZE_OF_INT16)) return null;
  5792. var e = this.data.getInt16(this.position, this.endian == c.LITTLE_ENDIAN);
  5793. this.position += a.SIZE_OF_INT16;
  5794. return e
  5795. };
  5796. a.prototype.readUnsignedByte = function() {
  5797. return this.validate(a.SIZE_OF_UINT8) ? this.data.getUint8(this.position++) : null
  5798. };
  5799. a.prototype.readUnsignedInt = function() {
  5800. if (!this.validate(a.SIZE_OF_UINT32)) return null;
  5801. var e = this.data.getUint32(this.position, this.endian == c.LITTLE_ENDIAN);
  5802. this.position += a.SIZE_OF_UINT32;
  5803. return e
  5804. };
  5805. a.prototype.readUnsignedShort = function() {
  5806. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5807. var e = this.data.getUint16(this.position, this.endian == c.LITTLE_ENDIAN);
  5808. this.position += a.SIZE_OF_UINT16;
  5809. return e
  5810. };
  5811. a.prototype.readUTF = function() {
  5812. if (!this.validate(a.SIZE_OF_UINT16)) return null;
  5813. var e = this.data.getUint16(this.position, this.endian == c.LITTLE_ENDIAN);
  5814. this.position += a.SIZE_OF_UINT16;
  5815. return 0 < e ? this.readUTFBytes(e) : ""
  5816. };
  5817. a.prototype.readUTFBytes = function(a) {
  5818. if (!this.validate(a)) return null;
  5819. var b = new Uint8Array(this.buffer, this.bufferOffset + this.position, a);
  5820. this.position += a;
  5821. return this.decodeUTF8(b)
  5822. };
  5823. a.prototype.writeBoolean = function(e) {
  5824. this.validateBuffer(a.SIZE_OF_BOOLEAN);
  5825. this.data.setUint8(this.position++, e ? 1 : 0)
  5826. };
  5827. a.prototype.writeByte = function(e) {
  5828. this.validateBuffer(a.SIZE_OF_INT8);
  5829. this.data.setInt8(this.position++, e)
  5830. };
  5831. a.prototype.writeBytes = function(a, b, d) {
  5832. void 0 === d && (d = 0);
  5833. this.validateBuffer(d);
  5834. b = new DataView(a.buffer);
  5835. for (d = 0; d < a.length; d++) this.data.setUint8(this.position++, b.getUint8(d))
  5836. };
  5837. a.prototype.writeDouble = function(e) {
  5838. this.validateBuffer(a.SIZE_OF_FLOAT64);
  5839. this.data.setFloat64(this.position, e, this.endian == c.LITTLE_ENDIAN);
  5840. this.position += a.SIZE_OF_FLOAT64
  5841. };
  5842. a.prototype.writeFloat = function(e) {
  5843. this.validateBuffer(a.SIZE_OF_FLOAT32);
  5844. this.data.setFloat32(this.position, e, this.endian == c.LITTLE_ENDIAN);
  5845. this.position += a.SIZE_OF_FLOAT32
  5846. };
  5847. a.prototype.writeInt = function(e) {
  5848. this.validateBuffer(a.SIZE_OF_INT32);
  5849. this.data.setInt32(this.position, e, this.endian == c.LITTLE_ENDIAN);
  5850. this.position += a.SIZE_OF_INT32
  5851. };
  5852. a.prototype.writeShort = function(e) {
  5853. this.validateBuffer(a.SIZE_OF_INT16);
  5854. this.data.setInt16(this.position, e, this.endian == c.LITTLE_ENDIAN);
  5855. this.position += a.SIZE_OF_INT16
  5856. };
  5857. a.prototype.writeUnsignedInt = function(e) {
  5858. this.validateBuffer(a.SIZE_OF_UINT32);
  5859. this.data.setUint32(this.position, e, this.endian == c.LITTLE_ENDIAN);
  5860. this.position += a.SIZE_OF_UINT32
  5861. };
  5862. a.prototype.writeUTF = function(e) {
  5863. e = this.encodeUTF8(e);
  5864. var b = e.length;
  5865. this.validateBuffer(a.SIZE_OF_UINT16 + b);
  5866. this.data.setUint16(this.position, b, this.endian === c.LITTLE_ENDIAN);
  5867. this.position += a.SIZE_OF_UINT16;
  5868. this._writeUint8Array(e)
  5869. };
  5870. a.prototype.writeUTFBytes = function(a) {
  5871. this._writeUint8Array(this.encodeUTF8(a))
  5872. };
  5873. a.prototype.toString = function() {
  5874. return "[ByteArray] length:" + this.length + ", bytesAvailable:" + this.bytesAvailable
  5875. };
  5876. a.prototype._writeUint8Array = function(a) {
  5877. this.validateBuffer(this.position + a.length);
  5878. for (var b = 0; b < a.length; b++) this.data.setUint8(this.position++, a[b])
  5879. };
  5880. a.prototype.validate = function(a) {
  5881. if (0 < this.data.byteLength && this._position + a <= this.data.byteLength) return ! 0;
  5882. throw b.getString(1025);
  5883. };
  5884. a.prototype.validateBuffer = function(a) {
  5885. this.write_position = a > this.write_position ? a: this.write_position;
  5886. a += this._position;
  5887. this.data.byteLength < a && (a = new Uint8Array(new ArrayBuffer(a + this.BUFFER_EXT_SIZE)), a.set(new Uint8Array(this.data.buffer)), this.buffer = a.buffer)
  5888. };
  5889. a.prototype.encodeUTF8 = function(a) {
  5890. var b = 0;
  5891. a = this.stringToCodePoints(a);
  5892. for (var d = []; a.length > b;) {
  5893. var c = a[b++];
  5894. if (this.inRange(c, 55296, 57343)) this.encoderError(c);
  5895. else if (this.inRange(c, 0, 127)) d.push(c);
  5896. else {
  5897. var g, f;
  5898. this.inRange(c, 128, 2047) ? (g = 1, f = 192) : this.inRange(c, 2048, 65535) ? (g = 2, f = 224) : this.inRange(c, 65536, 1114111) && (g = 3, f = 240);
  5899. for (d.push(this.div(c, Math.pow(64, g)) + f); 0 < g;) {
  5900. var l = this.div(c, Math.pow(64, g - 1));
  5901. d.push(128 + l % 64);
  5902. g -= 1
  5903. }
  5904. }
  5905. }
  5906. return new Uint8Array(d)
  5907. };
  5908. a.prototype.decodeUTF8 = function(a) {
  5909. for (var b = 0,
  5910. d = "",
  5911. c, g = 0,
  5912. f = 0,
  5913. l = 0,
  5914. n = 0; a.length > b;) {
  5915. c = a[b++];
  5916. if (c === this.EOF_byte) c = 0 !== f ? this.decoderError(!1) : this.EOF_code_point;
  5917. else if (0 === f) this.inRange(c, 0, 127) || (this.inRange(c, 194, 223) ? (f = 1, n = 128, g = c - 192) : this.inRange(c, 224, 239) ? (f = 2, n = 2048, g = c - 224) : this.inRange(c, 240, 244) ? (f = 3, n = 65536, g = c - 240) : this.decoderError(!1), g *= Math.pow(64, f), c = null);
  5918. else if (this.inRange(c, 128, 191)) if (l += 1, g += (c - 128) * Math.pow(64, f - l), l !== f) c = null;
  5919. else {
  5920. var p = g,
  5921. q = n,
  5922. n = l = f = g = 0;
  5923. c = this.inRange(p, q, 1114111) && !this.inRange(p, 55296, 57343) ? p: this.decoderError(!1, c)
  5924. } else n = l = f = g = 0,
  5925. b--,
  5926. c = this.decoderError(!1, c);
  5927. null !== c && c !== this.EOF_code_point && (65535 >= c ? 0 < c && (d += String.fromCharCode(c)) : (c -= 65536, d += String.fromCharCode(55296 + (c >> 10 & 1023)), d += String.fromCharCode(56320 + (c & 1023))))
  5928. }
  5929. return d
  5930. };
  5931. a.prototype.encoderError = function(a) {
  5932. throw b.getString(1026, a);
  5933. };
  5934. a.prototype.decoderError = function(a, d) {
  5935. if (a) throw b.getString(1027);
  5936. return d || 65533
  5937. };
  5938. a.prototype.inRange = function(a, b, d) {
  5939. return b <= a && a <= d
  5940. };
  5941. a.prototype.div = function(a, b) {
  5942. return Math.floor(a / b)
  5943. };
  5944. a.prototype.stringToCodePoints = function(a) {
  5945. for (var b = [], d = 0, c = a.length; d < a.length;) {
  5946. var g = a.charCodeAt(d);
  5947. if (this.inRange(g, 55296, 57343)) if (this.inRange(g, 56320, 57343)) b.push(65533);
  5948. else if (d === c - 1) b.push(65533);
  5949. else {
  5950. var f = a.charCodeAt(d + 1);
  5951. this.inRange(f, 56320, 57343) ? (g &= 1023, f &= 1023, d += 1, b.push(65536 + (g << 10) + f)) : b.push(65533)
  5952. } else b.push(g);
  5953. d += 1
  5954. }
  5955. return b
  5956. };
  5957. a.SIZE_OF_BOOLEAN = 1;
  5958. a.SIZE_OF_INT8 = 1;
  5959. a.SIZE_OF_INT16 = 2;
  5960. a.SIZE_OF_INT32 = 4;
  5961. a.SIZE_OF_UINT8 = 1;
  5962. a.SIZE_OF_UINT16 = 2;
  5963. a.SIZE_OF_UINT32 = 4;
  5964. a.SIZE_OF_FLOAT32 = 4;
  5965. a.SIZE_OF_FLOAT64 = 8;
  5966. return a
  5967. } ();
  5968. b.ByteArray = d;
  5969. d.prototype.__class__ = "egret.ByteArray"
  5970. })(egret || (egret = {}));
  5971. __extends = this.__extends ||
  5972. function(b, c) {
  5973. function d() {
  5974. this.constructor = b
  5975. }
  5976. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  5977. d.prototype = c.prototype;
  5978. b.prototype = new d
  5979. }; (function(b) {
  5980. var c = function(d) {
  5981. function a(a, b, c) {
  5982. d.call(this);
  5983. this._target = null;
  5984. this.loop = this.ignoreGlobalPause = this._useTicks = !1;
  5985. this._actions = this._steps = this.pluginData = null;
  5986. this.paused = !1;
  5987. this.duration = 0;
  5988. this._prevPos = -1;
  5989. this.position = null;
  5990. this._stepPosition = this._prevPosition = 0;
  5991. this.passive = !1;
  5992. this.initialize(a, b, c)
  5993. }
  5994. __extends(a, d);
  5995. a.get = function(e, b, d, c) {
  5996. void 0 === b && (b = null);
  5997. void 0 === d && (d = null);
  5998. void 0 === c && (c = !1);
  5999. c && a.removeTweens(e);
  6000. return new a(e, b, d)
  6001. };
  6002. a.removeTweens = function(e) {
  6003. if (e.tween_count) {
  6004. for (var b = a._tweens,
  6005. d = b.length - 1; 0 <= d; d--) b[d]._target == e && (b[d].paused = !0, b.splice(d, 1));
  6006. e.tween_count = 0
  6007. }
  6008. };
  6009. a.pauseTweens = function(a) {
  6010. if (a.tween_count) for (var d = b.Tween._tweens,
  6011. c = d.length - 1; 0 <= c; c--) d[c]._target == a && (d[c].paused = !0)
  6012. };
  6013. a.resumeTweens = function(a) {
  6014. if (a.tween_count) for (var d = b.Tween._tweens,
  6015. c = d.length - 1; 0 <= c; c--) d[c]._target == a && (d[c].paused = !1)
  6016. };
  6017. a.tick = function(e, b) {
  6018. void 0 === b && (b = !1);
  6019. for (var d = a._tweens.concat(), c = d.length - 1; 0 <= c; c--) {
  6020. var g = d[c];
  6021. b && !g.ignoreGlobalPause || g.paused || g.tick(g._useTicks ? 1 : e)
  6022. }
  6023. };
  6024. a._register = function(e, d) {
  6025. var c = e._target,
  6026. h = a._tweens;
  6027. if (d) c && (c.tween_count = 0 < c.tween_count ? c.tween_count + 1 : 1),
  6028. h.push(e),
  6029. a._inited || (b.Ticker.getInstance().register(a.tick, null), a._inited = !0);
  6030. else for (c && c.tween_count--, c = h.length; c--;) if (h[c] == e) {
  6031. h.splice(c, 1);
  6032. break
  6033. }
  6034. };
  6035. a.removeAllTweens = function() {
  6036. for (var e = a._tweens,
  6037. b = 0,
  6038. d = e.length; b < d; b++) {
  6039. var c = e[b];
  6040. c.paused = !0;
  6041. c._target.tweenjs_count = 0
  6042. }
  6043. e.length = 0
  6044. };
  6045. a.prototype.initialize = function(e, b, d) {
  6046. this._target = e;
  6047. b && (this._useTicks = b.useTicks, this.ignoreGlobalPause = b.ignoreGlobalPause, this.loop = b.loop, b.onChange && this.addEventListener("change", b.onChange, b.onChangeObj), b.override && a.removeTweens(e));
  6048. this.pluginData = d || {};
  6049. this._curQueueProps = {};
  6050. this._initQueueProps = {};
  6051. this._steps = [];
  6052. this._actions = [];
  6053. b && b.paused ? this.paused = !0 : a._register(this, !0);
  6054. b && null != b.position && this.setPosition(b.position, a.NONE)
  6055. };
  6056. a.prototype.setPosition = function(a, b) {
  6057. void 0 === b && (b = 1);
  6058. 0 > a && (a = 0);
  6059. var d = a,
  6060. c = !1;
  6061. d >= this.duration && (this.loop ? d %= this.duration: (d = this.duration, c = !0));
  6062. if (d == this._prevPos) return c;
  6063. var g = this._prevPos;
  6064. this.position = this._prevPos = d;
  6065. this._prevPosition = a;
  6066. if (this._target) if (c) this._updateTargetProps(null, 1);
  6067. else if (0 < this._steps.length) {
  6068. for (var f = 0,
  6069. l = this._steps.length; f < l && !(this._steps[f].t > d); f++);
  6070. f = this._steps[f - 1];
  6071. this._updateTargetProps(f, (this._stepPosition = d - f.t) / f.d)
  6072. }
  6073. 0 != b && 0 < this._actions.length && (this._useTicks ? this._runActions(d, d) : 1 == b && d < g ? (g != this.duration && this._runActions(g, this.duration), this._runActions(0, d, !0)) : this._runActions(g, d));
  6074. c && this.setPaused(!0);
  6075. this.dispatchEventWith("change");
  6076. return c
  6077. };
  6078. a.prototype._runActions = function(a, b, d) {
  6079. void 0 === d && (d = !1);
  6080. var c = a,
  6081. g = b,
  6082. f = -1,
  6083. l = this._actions.length,
  6084. n = 1;
  6085. a > b && (c = b, g = a, f = l, l = n = -1);
  6086. for (; (f += n) != l;) {
  6087. b = this._actions[f];
  6088. var p = b.t; (p == g || p > c && p < g || d && p == a) && b.f.apply(b.o, b.p)
  6089. }
  6090. };
  6091. a.prototype._updateTargetProps = function(b, d) {
  6092. var c, h, g, f;
  6093. if (b || 1 != d) {
  6094. if (this.passive = !!b.v) return;
  6095. b.e && (d = b.e(d, 0, 1, 1));
  6096. c = b.p0;
  6097. h = b.p1
  6098. } else this.passive = !1,
  6099. c = h = this._curQueueProps;
  6100. for (var l in this._initQueueProps) {
  6101. null == (g = c[l]) && (c[l] = g = this._initQueueProps[l]);
  6102. null == (f = h[l]) && (h[l] = f = g);
  6103. g = g == f || 0 == d || 1 == d || "number" != typeof g ? 1 == d ? f: g: g + (f - g) * d;
  6104. var n = !1;
  6105. if (f = a._plugins[l]) for (var p = 0,
  6106. q = f.length; p < q; p++) {
  6107. var r = f[p].tween(this, l, g, c, h, d, !!b && c == h, !b);
  6108. r == a.IGNORE ? n = !0 : g = r
  6109. }
  6110. n || (this._target[l] = g)
  6111. }
  6112. };
  6113. a.prototype.setPaused = function(b) {
  6114. this.paused = b;
  6115. a._register(this, !b);
  6116. return this
  6117. };
  6118. a.prototype._cloneProps = function(a) {
  6119. var b = {},
  6120. d;
  6121. for (d in a) b[d] = a[d];
  6122. return b
  6123. };
  6124. a.prototype._addStep = function(a) {
  6125. 0 < a.d && (this._steps.push(a), a.t = this.duration, this.duration += a.d);
  6126. return this
  6127. };
  6128. a.prototype._appendQueueProps = function(b) {
  6129. var d, c, h, g, f, l;
  6130. for (l in b) if (void 0 === this._initQueueProps[l]) {
  6131. c = this._target[l];
  6132. if (d = a._plugins[l]) for (h = 0, g = d.length; h < g; h++) c = d[h].init(this, l, c);
  6133. this._initQueueProps[l] = this._curQueueProps[l] = void 0 === c ? null: c
  6134. }
  6135. for (l in b) {
  6136. c = this._curQueueProps[l];
  6137. if (d = a._plugins[l]) for (f = f || {},
  6138. h = 0, g = d.length; h < g; h++) d[h].step && d[h].step(this, l, c, b[l], f);
  6139. this._curQueueProps[l] = b[l]
  6140. }
  6141. f && this._appendQueueProps(f);
  6142. return this._curQueueProps
  6143. };
  6144. a.prototype._addAction = function(a) {
  6145. a.t = this.duration;
  6146. this._actions.push(a);
  6147. return this
  6148. };
  6149. a.prototype._set = function(a, b) {
  6150. for (var d in a) b[d] = a[d]
  6151. };
  6152. a.prototype.wait = function(a, b) {
  6153. if (null == a || 0 >= a) return this;
  6154. var d = this._cloneProps(this._curQueueProps);
  6155. return this._addStep({
  6156. d: a,
  6157. p0: d,
  6158. p1: d,
  6159. v: b
  6160. })
  6161. };
  6162. a.prototype.to = function(a, b, d) {
  6163. void 0 === d && (d = void 0);
  6164. if (isNaN(b) || 0 > b) b = 0;
  6165. return this._addStep({
  6166. d: b || 0,
  6167. p0: this._cloneProps(this._curQueueProps),
  6168. e: d,
  6169. p1: this._cloneProps(this._appendQueueProps(a))
  6170. })
  6171. };
  6172. a.prototype.call = function(a, b, d) {
  6173. void 0 === b && (b = void 0);
  6174. void 0 === d && (d = void 0);
  6175. return this._addAction({
  6176. f: a,
  6177. p: d ? d: [],
  6178. o: b ? b: this._target
  6179. })
  6180. };
  6181. a.prototype.set = function(a, b) {
  6182. void 0 === b && (b = null);
  6183. return this._addAction({
  6184. f: this._set,
  6185. o: this,
  6186. p: [a, b ? b: this._target]
  6187. })
  6188. };
  6189. a.prototype.play = function(a) {
  6190. a || (a = this);
  6191. return this.call(a.setPaused, a, [!1])
  6192. };
  6193. a.prototype.pause = function(a) {
  6194. a || (a = this);
  6195. return this.call(a.setPaused, a, [!0])
  6196. };
  6197. a.prototype.tick = function(a) {
  6198. this.paused || this.setPosition(this._prevPosition + a)
  6199. };
  6200. a.NONE = 0;
  6201. a.LOOP = 1;
  6202. a.REVERSE = 2;
  6203. a._tweens = [];
  6204. a.IGNORE = {};
  6205. a._plugins = {};
  6206. a._inited = !1;
  6207. return a
  6208. } (b.EventDispatcher);
  6209. b.Tween = c;
  6210. c.prototype.__class__ = "egret.Tween"
  6211. })(egret || (egret = {})); (function(b) {
  6212. var c = function() {
  6213. function d() {
  6214. b.Logger.fatalWithErrorId(1014)
  6215. }
  6216. d.get = function(a) { - 1 > a && (a = -1);
  6217. 1 < a && (a = 1);
  6218. return function(b) {
  6219. return 0 == a ? b: 0 > a ? b * (b * -a + 1 + a) : b * ((2 - b) * a + (1 - a))
  6220. }
  6221. };
  6222. d.getPowIn = function(a) {
  6223. return function(b) {
  6224. return Math.pow(b, a)
  6225. }
  6226. };
  6227. d.getPowOut = function(a) {
  6228. return function(b) {
  6229. return 1 - Math.pow(1 - b, a)
  6230. }
  6231. };
  6232. d.getPowInOut = function(a) {
  6233. return function(b) {
  6234. return 1 > (b *= 2) ? 0.5 * Math.pow(b, a) : 1 - 0.5 * Math.abs(Math.pow(2 - b, a))
  6235. }
  6236. };
  6237. d.sineIn = function(a) {
  6238. return 1 - Math.cos(a * Math.PI / 2)
  6239. };
  6240. d.sineOut = function(a) {
  6241. return Math.sin(a * Math.PI / 2)
  6242. };
  6243. d.sineInOut = function(a) {
  6244. return - 0.5 * (Math.cos(Math.PI * a) - 1)
  6245. };
  6246. d.getBackIn = function(a) {
  6247. return function(b) {
  6248. return b * b * ((a + 1) * b - a)
  6249. }
  6250. };
  6251. d.getBackOut = function(a) {
  6252. return function(b) {
  6253. return--b * b * ((a + 1) * b + a) + 1
  6254. }
  6255. };
  6256. d.getBackInOut = function(a) {
  6257. a *= 1.525;
  6258. return function(b) {
  6259. return 1 > (b *= 2) ? 0.5 * b * b * ((a + 1) * b - a) : 0.5 * ((b -= 2) * b * ((a + 1) * b + a) + 2)
  6260. }
  6261. };
  6262. d.circIn = function(a) {
  6263. return - (Math.sqrt(1 - a * a) - 1)
  6264. };
  6265. d.circOut = function(a) {
  6266. return Math.sqrt(1 - --a * a)
  6267. };
  6268. d.circInOut = function(a) {
  6269. return 1 > (a *= 2) ? -0.5 * (Math.sqrt(1 - a * a) - 1) : 0.5 * (Math.sqrt(1 - (a -= 2) * a) + 1)
  6270. };
  6271. d.bounceIn = function(a) {
  6272. return 1 - d.bounceOut(1 - a)
  6273. };
  6274. d.bounceOut = function(a) {
  6275. return a < 1 / 2.75 ? 7.5625 * a * a: a < 2 / 2.75 ? 7.5625 * (a -= 1.5 / 2.75) * a + 0.75 : a < 2.5 / 2.75 ? 7.5625 * (a -= 2.25 / 2.75) * a + 0.9375 : 7.5625 * (a -= 2.625 / 2.75) * a + 0.984375
  6276. };
  6277. d.bounceInOut = function(a) {
  6278. return 0.5 > a ? 0.5 * d.bounceIn(2 * a) : 0.5 * d.bounceOut(2 * a - 1) + 0.5
  6279. };
  6280. d.getElasticIn = function(a, b) {
  6281. var d = 2 * Math.PI;
  6282. return function(c) {
  6283. if (0 == c || 1 == c) return c;
  6284. var h = b / d * Math.asin(1 / a);
  6285. return - (a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - h) * d / b))
  6286. }
  6287. };
  6288. d.getElasticOut = function(a, b) {
  6289. var d = 2 * Math.PI;
  6290. return function(c) {
  6291. if (0 == c || 1 == c) return c;
  6292. var h = b / d * Math.asin(1 / a);
  6293. return a * Math.pow(2, -10 * c) * Math.sin((c - h) * d / b) + 1
  6294. }
  6295. };
  6296. d.getElasticInOut = function(a, b) {
  6297. var d = 2 * Math.PI;
  6298. return function(c) {
  6299. var h = b / d * Math.asin(1 / a);
  6300. return 1 > (c *= 2) ? -0.5 * a * Math.pow(2, 10 * (c -= 1)) * Math.sin((c - h) * d / b) : a * Math.pow(2, -10 * (c -= 1)) * Math.sin((c - h) * d / b) * 0.5 + 1
  6301. }
  6302. };
  6303. d.quadIn = d.getPowIn(2);
  6304. d.quadOut = d.getPowOut(2);
  6305. d.quadInOut = d.getPowInOut(2);
  6306. d.cubicIn = d.getPowIn(3);
  6307. d.cubicOut = d.getPowOut(3);
  6308. d.cubicInOut = d.getPowInOut(3);
  6309. d.quartIn = d.getPowIn(4);
  6310. d.quartOut = d.getPowOut(4);
  6311. d.quartInOut = d.getPowInOut(4);
  6312. d.quintIn = d.getPowIn(5);
  6313. d.quintOut = d.getPowOut(5);
  6314. d.quintInOut = d.getPowInOut(5);
  6315. d.backIn = d.getBackIn(1.7);
  6316. d.backOut = d.getBackOut(1.7);
  6317. d.backInOut = d.getBackInOut(1.7);
  6318. d.elasticIn = d.getElasticIn(1, 0.3);
  6319. d.elasticOut = d.getElasticOut(1, 0.3);
  6320. d.elasticInOut = d.getElasticInOut(1, 0.3 * 1.5);
  6321. return d
  6322. } ();
  6323. b.Ease = c;
  6324. c.prototype.__class__ = "egret.Ease"
  6325. })(egret || (egret = {})); (function(b) {
  6326. var c = function() {
  6327. function b() {
  6328. this.path = "";
  6329. this.audio = null;
  6330. this.type = b.EFFECT
  6331. }
  6332. b.prototype.play = function(a) {
  6333. void 0 === a && (a = !1);
  6334. var b = this.audio;
  6335. b && (isNaN(b.duration) || (b.currentTime = 0), b.loop = a, b.play())
  6336. };
  6337. b.prototype.pause = function() {
  6338. var a = this.audio;
  6339. a && a.pause()
  6340. };
  6341. b.prototype.load = function() {
  6342. var a = this.audio;
  6343. a && a.load()
  6344. };
  6345. b.prototype.addEventListener = function(a, b) {
  6346. this.audio && this.audio.addEventListener(a, b, !1)
  6347. };
  6348. b.prototype.removeEventListener = function(a, b) {
  6349. this.audio && this.audio.removeEventListener(a, b, !1)
  6350. };
  6351. b.prototype.setVolume = function(a) {
  6352. var b = this.audio;
  6353. b && (b.volume = a)
  6354. };
  6355. b.prototype.getVolume = function() {
  6356. return this.audio ? this.audio.volume: 0
  6357. };
  6358. b.prototype.preload = function(a) {
  6359. this.type = a
  6360. };
  6361. b.prototype._setAudio = function(a) {
  6362. this.audio = a
  6363. };
  6364. b.MUSIC = "music";
  6365. b.EFFECT = "effect";
  6366. return b
  6367. } ();
  6368. b.Sound = c;
  6369. c.prototype.__class__ = "egret.Sound"
  6370. })(egret || (egret = {})); (function(b) {
  6371. var c = function() {
  6372. function b() {}
  6373. b.isNumber = function(a) {
  6374. return "number" === typeof a && !isNaN(a)
  6375. };
  6376. b.sin = function(a) {
  6377. a = Math.round(a);
  6378. a %= 360;
  6379. 0 > a && (a += 360);
  6380. return 90 > a ? egret_sin_map[a] : 180 > a ? egret_cos_map[a - 90] : 270 > a ? -egret_sin_map[a - 180] : -egret_cos_map[a - 270]
  6381. };
  6382. b.cos = function(a) {
  6383. a = Math.round(a);
  6384. a %= 360;
  6385. 0 > a && (a += 360);
  6386. return 90 > a ? egret_cos_map[a] : 180 > a ? -egret_sin_map[a - 90] : 270 > a ? -egret_cos_map[a - 180] : egret_sin_map[a - 270]
  6387. };
  6388. return b
  6389. } ();
  6390. b.NumberUtils = c;
  6391. c.prototype.__class__ = "egret.NumberUtils"
  6392. })(egret || (egret = {}));
  6393. for (var egret_sin_map = {},
  6394. egret_cos_map = {},
  6395. i = 0; 90 >= i; i++) egret_sin_map[i] = Math.sin(i * egret.Matrix.DEG_TO_RAD),
  6396. egret_cos_map[i] = Math.cos(i * egret.Matrix.DEG_TO_RAD);
  6397. Function.prototype.bind || (Function.prototype.bind = function(b) {
  6398. if ("function" !== typeof this) throw new TypeError(egret.getString(1029));
  6399. var c = Array.prototype.slice.call(arguments, 1),
  6400. d = this,
  6401. a = function() {},
  6402. e = function() {
  6403. return d.apply(this instanceof a && b ? this: b, c.concat(Array.prototype.slice.call(arguments)))
  6404. };
  6405. a.prototype = this.prototype;
  6406. e.prototype = new a;
  6407. return e
  6408. });
  6409. var __extends = this.__extends ||
  6410. function(b, c) {
  6411. function d() {
  6412. this.constructor = b
  6413. }
  6414. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6415. d.prototype = c.prototype;
  6416. b.prototype = new d
  6417. },
  6418. RES; (function(b) {
  6419. var c = function(b) {
  6420. function a(a, c, m) {
  6421. void 0 === c && (c = !1);
  6422. void 0 === m && (m = !1);
  6423. b.call(this, a, c, m);
  6424. this.itemsTotal = this.itemsLoaded = 0;
  6425. this.groupName = "";
  6426. this.resItem = null
  6427. }
  6428. __extends(a, b);
  6429. a.dispatchResourceEvent = function(b, d, c, h, g, f) {
  6430. void 0 === c && (c = "");
  6431. void 0 === h && (h = null);
  6432. void 0 === g && (g = 0);
  6433. void 0 === f && (f = 0);
  6434. var l = egret.Event._getPropertyData(a);
  6435. l.groupName = c;
  6436. l.resItem = h;
  6437. l.itemsLoaded = g;
  6438. l.itemsTotal = f;
  6439. egret.Event._dispatchByTarget(a, b, d, l)
  6440. };
  6441. a.ITEM_LOAD_ERROR = "itemLoadError";
  6442. a.CONFIG_COMPLETE = "configComplete";
  6443. a.CONFIG_LOAD_ERROR = "configLoadError";
  6444. a.GROUP_PROGRESS = "groupProgress";
  6445. a.GROUP_COMPLETE = "groupComplete";
  6446. a.GROUP_LOAD_ERROR = "groupLoadError";
  6447. return a
  6448. } (egret.Event);
  6449. b.ResourceEvent = c;
  6450. c.prototype.__class__ = "RES.ResourceEvent"
  6451. })(RES || (RES = {})); (function(b) {
  6452. var c = function() {
  6453. function b(a, e, d) {
  6454. this.groupName = "";
  6455. this.data = null;
  6456. this._loaded = !1;
  6457. this.name = a;
  6458. this.url = e;
  6459. this.type = d
  6460. }
  6461. Object.defineProperty(b.prototype, "loaded", {
  6462. get: function() {
  6463. return this.data ? this.data.loaded: this._loaded
  6464. },
  6465. set: function(a) {
  6466. this.data && (this.data.loaded = a);
  6467. this._loaded = a
  6468. },
  6469. enumerable: !0,
  6470. configurable: !0
  6471. });
  6472. b.prototype.toString = function() {
  6473. return '[ResourceItem name="' + this.name + '" url="' + this.url + '" type="' + this.type + '"]'
  6474. };
  6475. b.TYPE_XML = "xml";
  6476. b.TYPE_IMAGE = "image";
  6477. b.TYPE_BIN = "bin";
  6478. b.TYPE_TEXT = "text";
  6479. b.TYPE_JSON = "json";
  6480. b.TYPE_SHEET = "sheet";
  6481. b.TYPE_FONT = "font";
  6482. b.TYPE_SOUND = "sound";
  6483. return b
  6484. } ();
  6485. b.ResourceItem = c;
  6486. c.prototype.__class__ = "RES.ResourceItem"
  6487. })(RES || (RES = {})); (function(b) {
  6488. var c = function() {
  6489. function d() {
  6490. this.keyMap = {};
  6491. this.groupDic = {};
  6492. b.configInstance = this
  6493. }
  6494. d.prototype.getGroupByName = function(a) {
  6495. var b = [];
  6496. if (!this.groupDic[a]) return b;
  6497. a = this.groupDic[a];
  6498. for (var d = a.length,
  6499. c = 0; c < d; c++) b.push(this.parseResourceItem(a[c]));
  6500. return b
  6501. };
  6502. d.prototype.getRawGroupByName = function(a) {
  6503. return this.groupDic[a] ? this.groupDic[a] : []
  6504. };
  6505. d.prototype.createGroup = function(a, b, d) {
  6506. void 0 === d && (d = !1);
  6507. if (!d && this.groupDic[a] || !b || 0 == b.length) return ! 1;
  6508. d = this.groupDic;
  6509. for (var c = [], h = b.length, g = 0; g < h; g++) {
  6510. var f = b[g],
  6511. l = d[f];
  6512. if (l) for (var f = l.length,
  6513. n = 0; n < f; n++) {
  6514. var p = l[n]; - 1 == c.indexOf(p) && c.push(p)
  6515. } else(p = this.keyMap[f]) ? -1 == c.indexOf(p) && c.push(p) : egret.Logger.warningWithErrorId(2E3, f)
  6516. }
  6517. if (0 == c.length) return ! 1;
  6518. this.groupDic[a] = c;
  6519. return ! 0
  6520. };
  6521. d.prototype.parseConfig = function(a, b) {
  6522. if (a) {
  6523. var d = a.resources;
  6524. if (d) for (var c = d.length,
  6525. h = 0; h < c; h++) {
  6526. var g = d[h],
  6527. f = g.url;
  6528. f && -1 == f.indexOf("://") && (g.url = b + f);
  6529. this.addItemToKeyMap(g)
  6530. }
  6531. if (d = a.groups) for (c = d.length, h = 0; h < c; h++) {
  6532. for (var f = d[h], l = [], n = f.keys.split(","), p = n.length, q = 0; q < p; q++) g = n[q].trim(),
  6533. (g = this.keyMap[g]) && -1 == l.indexOf(g) && l.push(g);
  6534. this.groupDic[f.name] = l
  6535. }
  6536. }
  6537. };
  6538. d.prototype.addSubkey = function(a, b) {
  6539. var d = this.keyMap[b];
  6540. d && !this.keyMap[a] && (this.keyMap[a] = d)
  6541. };
  6542. d.prototype.addItemToKeyMap = function(a) {
  6543. this.keyMap[a.name] || (this.keyMap[a.name] = a);
  6544. if (a.hasOwnProperty("subkeys")) {
  6545. var b = a.subkeys.split(",");
  6546. a.subkeys = b;
  6547. for (var d = b.length,
  6548. c = 0; c < d; c++) {
  6549. var h = b[c];
  6550. null == this.keyMap[h] && (this.keyMap[h] = a)
  6551. }
  6552. }
  6553. };
  6554. d.prototype.getName = function(a) {
  6555. return (a = this.keyMap[a]) ? a.name: ""
  6556. };
  6557. d.prototype.getType = function(a) {
  6558. return (a = this.keyMap[a]) ? a.type: ""
  6559. };
  6560. d.prototype.getRawResourceItem = function(a) {
  6561. return this.keyMap[a]
  6562. };
  6563. d.prototype.getResourceItem = function(a) {
  6564. return (a = this.keyMap[a]) ? this.parseResourceItem(a) : null
  6565. };
  6566. d.prototype.parseResourceItem = function(a) {
  6567. var e = new b.ResourceItem(a.name, a.url, a.type);
  6568. e.data = a;
  6569. return e
  6570. };
  6571. return d
  6572. } ();
  6573. b.ResourceConfig = c;
  6574. c.prototype.__class__ = "RES.ResourceConfig"
  6575. })(RES || (RES = {}));
  6576. __extends = this.__extends ||
  6577. function(b, c) {
  6578. function d() {
  6579. this.constructor = b
  6580. }
  6581. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6582. d.prototype = c.prototype;
  6583. b.prototype = new d
  6584. }; (function(b) {
  6585. var c = function(d) {
  6586. function a() {
  6587. d.call(this);
  6588. this.thread = 2;
  6589. this.loadingCount = 0;
  6590. this.resInstance = this.callBack = null;
  6591. this.groupTotalDic = {};
  6592. this.numLoadedDic = {};
  6593. this.itemListDic = {};
  6594. this.groupErrorDic = {};
  6595. this.retryTimesDic = {};
  6596. this.maxRetryTimes = 3;
  6597. this.failedList = [];
  6598. this.priorityQueue = {};
  6599. this.lazyLoadList = [];
  6600. this.analyzerDic = {};
  6601. this.queueIndex = 0
  6602. }
  6603. __extends(a, d);
  6604. a.prototype.isGroupInLoading = function(a) {
  6605. return void 0 !== this.itemListDic[a]
  6606. };
  6607. a.prototype.loadGroup = function(a, d, c) {
  6608. void 0 === c && (c = 0);
  6609. if (!this.itemListDic[d] && d) if (a && 0 != a.length) {
  6610. this.priorityQueue[c] ? this.priorityQueue[c].push(d) : this.priorityQueue[c] = [d];
  6611. this.itemListDic[d] = a;
  6612. c = a.length;
  6613. for (var h = 0; h < c; h++) a[h].groupName = d;
  6614. this.groupTotalDic[d] = a.length;
  6615. this.numLoadedDic[d] = 0;
  6616. this.next()
  6617. } else egret.Logger.warningWithErrorId(2001, d),
  6618. a = new b.ResourceEvent(b.ResourceEvent.GROUP_LOAD_ERROR),
  6619. a.groupName = d,
  6620. this.dispatchEvent(a)
  6621. };
  6622. a.prototype.loadItem = function(a) {
  6623. this.lazyLoadList.push(a);
  6624. a.groupName = "";
  6625. this.next()
  6626. };
  6627. a.prototype.next = function() {
  6628. for (; this.loadingCount < this.thread;) {
  6629. var a = this.getOneResourceItem();
  6630. if (!a) break;
  6631. this.loadingCount++;
  6632. if (a.loaded) this.onItemComplete(a);
  6633. else {
  6634. var d = this.analyzerDic[a.type];
  6635. d || (d = this.analyzerDic[a.type] = egret.Injector.getInstance(b.AnalyzerBase, a.type));
  6636. d.loadFile(a, this.onItemComplete, this)
  6637. }
  6638. }
  6639. };
  6640. a.prototype.getOneResourceItem = function() {
  6641. if (0 < this.failedList.length) return this.failedList.shift();
  6642. var a = Number.NEGATIVE_INFINITY,
  6643. b;
  6644. for (b in this.priorityQueue) a = Math.max(a, b);
  6645. a = this.priorityQueue[a];
  6646. if (!a || 0 == a.length) return 0 == this.lazyLoadList.length ? null: this.lazyLoadList.pop();
  6647. b = a.length;
  6648. for (var d, c = 0; c < b; c++) {
  6649. this.queueIndex >= b && (this.queueIndex = 0);
  6650. d = this.itemListDic[a[this.queueIndex]];
  6651. if (0 < d.length) break;
  6652. this.queueIndex++
  6653. }
  6654. return 0 == d.length ? null: d.shift()
  6655. };
  6656. a.prototype.onItemComplete = function(a) {
  6657. this.loadingCount--;
  6658. var d = a.groupName;
  6659. if (!a.loaded) {
  6660. var c = this.retryTimesDic[a.name] || 1;
  6661. if (c > this.maxRetryTimes) delete this.retryTimesDic[a.name],
  6662. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.ITEM_LOAD_ERROR, d, a);
  6663. else {
  6664. this.retryTimesDic[a.name] = c + 1;
  6665. this.failedList.push(a);
  6666. this.next();
  6667. return
  6668. }
  6669. }
  6670. if (d) {
  6671. this.numLoadedDic[d]++;
  6672. var c = this.numLoadedDic[d],
  6673. h = this.groupTotalDic[d];
  6674. a.loaded || (this.groupErrorDic[d] = !0);
  6675. b.ResourceEvent.dispatchResourceEvent(this.resInstance, b.ResourceEvent.GROUP_PROGRESS, d, a, c, h);
  6676. c == h && (a = this.groupErrorDic[d], this.removeGroupName(d), delete this.groupTotalDic[d], delete this.numLoadedDic[d], delete this.itemListDic[d], delete this.groupErrorDic[d], a ? b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_LOAD_ERROR, d) : b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, d))
  6677. } else this.callBack.call(this.resInstance, a);
  6678. this.next()
  6679. };
  6680. a.prototype.removeGroupName = function(a) {
  6681. for (var b in this.priorityQueue) {
  6682. for (var d = this.priorityQueue[b], c = d.length, g = 0, f = !1, c = d.length, l = 0; l < c; l++) {
  6683. if (d[l] == a) {
  6684. d.splice(g, 1);
  6685. f = !0;
  6686. break
  6687. }
  6688. g++
  6689. }
  6690. if (f) {
  6691. 0 == d.length && delete this.priorityQueue[b];
  6692. break
  6693. }
  6694. }
  6695. };
  6696. return a
  6697. } (egret.EventDispatcher);
  6698. b.ResourceLoader = c;
  6699. c.prototype.__class__ = "RES.ResourceLoader"
  6700. })(RES || (RES = {}));
  6701. __extends = this.__extends ||
  6702. function(b, c) {
  6703. function d() {
  6704. this.constructor = b
  6705. }
  6706. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6707. d.prototype = c.prototype;
  6708. b.prototype = new d
  6709. }; (function(b) {
  6710. var c = function(d) {
  6711. function a() {
  6712. d.call(this);
  6713. this.resourceConfig = null;
  6714. this.resourceConfig = b.configInstance
  6715. }
  6716. __extends(a, d);
  6717. a.prototype.addSubkey = function(a, b) {
  6718. this.resourceConfig.addSubkey(a, b)
  6719. };
  6720. a.prototype.loadFile = function(a, b, d) {};
  6721. a.prototype.getRes = function(a) {};
  6722. a.prototype.destroyRes = function(a) {
  6723. return ! 1
  6724. };
  6725. a.getStringPrefix = function(a) {
  6726. if (!a) return "";
  6727. var b = a.indexOf(".");
  6728. return - 1 != b ? a.substring(0, b) : ""
  6729. };
  6730. a.getStringTail = function(a) {
  6731. if (!a) return "";
  6732. var b = a.indexOf(".");
  6733. return - 1 != b ? a.substring(b + 1) : ""
  6734. };
  6735. return a
  6736. } (egret.HashObject);
  6737. b.AnalyzerBase = c;
  6738. c.prototype.__class__ = "RES.AnalyzerBase"
  6739. })(RES || (RES = {}));
  6740. __extends = this.__extends ||
  6741. function(b, c) {
  6742. function d() {
  6743. this.constructor = b
  6744. }
  6745. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6746. d.prototype = c.prototype;
  6747. b.prototype = new d
  6748. }; (function(b) {
  6749. var c = function(b) {
  6750. function a() {
  6751. b.call(this);
  6752. this.fileDic = {};
  6753. this.resItemDic = [];
  6754. this._dataFormat = egret.URLLoaderDataFormat.BINARY;
  6755. this.recycler = new egret.Recycler
  6756. }
  6757. __extends(a, b);
  6758. a.prototype.loadFile = function(a, b, d) {
  6759. if (this.fileDic[a.name]) b.call(d, a);
  6760. else {
  6761. var c = this.getLoader();
  6762. this.resItemDic[c.hashCode] = {
  6763. item: a,
  6764. func: b,
  6765. thisObject: d
  6766. };
  6767. c.load(new egret.URLRequest(a.url))
  6768. }
  6769. };
  6770. a.prototype.getLoader = function() {
  6771. var a = this.recycler.pop();
  6772. a || (a = new egret.URLLoader, a.addEventListener(egret.Event.COMPLETE, this.onLoadFinish, this), a.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onLoadFinish, this));
  6773. a.dataFormat = this._dataFormat;
  6774. return a
  6775. };
  6776. a.prototype.onLoadFinish = function(a) {
  6777. var b = a.target,
  6778. d = this.resItemDic[b.hashCode];
  6779. delete this.resItemDic[b.hashCode];
  6780. this.recycler.push(b);
  6781. var c = d.item,
  6782. g = d.func;
  6783. c.loaded = a.type == egret.Event.COMPLETE;
  6784. c.loaded && this.analyzeData(c, b.data);
  6785. g.call(d.thisObject, c)
  6786. };
  6787. a.prototype.analyzeData = function(a, b) {
  6788. var d = a.name; ! this.fileDic[d] && b && (this.fileDic[d] = b)
  6789. };
  6790. a.prototype.getRes = function(a) {
  6791. return this.fileDic[a]
  6792. };
  6793. a.prototype.hasRes = function(a) {
  6794. return null != this.getRes(a)
  6795. };
  6796. a.prototype.destroyRes = function(a) {
  6797. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  6798. };
  6799. return a
  6800. } (b.AnalyzerBase);
  6801. b.BinAnalyzer = c;
  6802. c.prototype.__class__ = "RES.BinAnalyzer"
  6803. })(RES || (RES = {}));
  6804. __extends = this.__extends ||
  6805. function(b, c) {
  6806. function d() {
  6807. this.constructor = b
  6808. }
  6809. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6810. d.prototype = c.prototype;
  6811. b.prototype = new d
  6812. }; (function(b) {
  6813. var c = function(b) {
  6814. function a() {
  6815. b.call(this);
  6816. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE
  6817. }
  6818. __extends(a, b);
  6819. a.prototype.analyzeData = function(a, b) {
  6820. var d = a.name; ! this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.scale9grid && (d = d.scale9grid.split(","), b.scale9Grid = new egret.Rectangle(parseInt(d[0]), parseInt(d[1]), parseInt(d[2]), parseInt(d[3]))))
  6821. };
  6822. return a
  6823. } (b.BinAnalyzer);
  6824. b.ImageAnalyzer = c;
  6825. c.prototype.__class__ = "RES.ImageAnalyzer"
  6826. })(RES || (RES = {}));
  6827. __extends = this.__extends ||
  6828. function(b, c) {
  6829. function d() {
  6830. this.constructor = b
  6831. }
  6832. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6833. d.prototype = c.prototype;
  6834. b.prototype = new d
  6835. }; (function(b) {
  6836. var c = function(b) {
  6837. function a() {
  6838. b.call(this);
  6839. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6840. }
  6841. __extends(a, b);
  6842. a.prototype.analyzeData = function(a, b) {
  6843. var d = a.name;
  6844. if (!this.fileDic[d] && b) try {
  6845. this.fileDic[d] = JSON.parse(b)
  6846. } catch(c) {
  6847. egret.Logger.warningWithErrorId(1017, a.url, b)
  6848. }
  6849. };
  6850. return a
  6851. } (b.BinAnalyzer);
  6852. b.JsonAnalyzer = c;
  6853. c.prototype.__class__ = "RES.JsonAnalyzer"
  6854. })(RES || (RES = {}));
  6855. __extends = this.__extends ||
  6856. function(b, c) {
  6857. function d() {
  6858. this.constructor = b
  6859. }
  6860. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6861. d.prototype = c.prototype;
  6862. b.prototype = new d
  6863. }; (function(b) {
  6864. var c = function(b) {
  6865. function a() {
  6866. b.call(this);
  6867. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6868. }
  6869. __extends(a, b);
  6870. return a
  6871. } (b.BinAnalyzer);
  6872. b.TextAnalyzer = c;
  6873. c.prototype.__class__ = "RES.TextAnalyzer"
  6874. })(RES || (RES = {}));
  6875. __extends = this.__extends ||
  6876. function(b, c) {
  6877. function d() {
  6878. this.constructor = b
  6879. }
  6880. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6881. d.prototype = c.prototype;
  6882. b.prototype = new d
  6883. }; (function(b) {
  6884. var c = function(d) {
  6885. function a() {
  6886. d.call(this);
  6887. this.sheetMap = {};
  6888. this.textureMap = {};
  6889. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  6890. }
  6891. __extends(a, d);
  6892. a.prototype.getRes = function(a) {
  6893. var d = this.fileDic[a];
  6894. d || (d = this.textureMap[a]); ! d && (d = b.AnalyzerBase.getStringPrefix(a), d = this.fileDic[d]) && (a = b.AnalyzerBase.getStringTail(a), d = d.getTexture(a));
  6895. return d
  6896. };
  6897. a.prototype.onLoadFinish = function(a) {
  6898. var b = a.target,
  6899. d = this.resItemDic[b.hashCode];
  6900. delete this.resItemDic[b.hashCode];
  6901. this.recycler.push(b);
  6902. var c = d.item,
  6903. g = d.func;
  6904. c.loaded = a.type == egret.Event.COMPLETE;
  6905. if (c.loaded) if ("string" == typeof b.data) {
  6906. if (c.loaded = !1, a = this.analyzeConfig(c, b.data)) {
  6907. c.url = a;
  6908. this._dataFormat = egret.URLLoaderDataFormat.TEXTURE;
  6909. this.loadFile(c, g, d.thisObject);
  6910. this._dataFormat = egret.URLLoaderDataFormat.TEXT;
  6911. return
  6912. }
  6913. } else this.analyzeBitmap(c, b.data);
  6914. c.url = c.data.url;
  6915. g.call(d.thisObject, c)
  6916. };
  6917. a.prototype.analyzeConfig = function(a, b) {
  6918. var d = a.name,
  6919. c, g = "";
  6920. try {
  6921. c = JSON.parse(b)
  6922. } catch(f) {
  6923. egret.Logger.warningWithErrorId(1017, a.url, b)
  6924. }
  6925. c && (this.sheetMap[d] = c, g = this.getRelativePath(a.url, c.file));
  6926. return g
  6927. };
  6928. a.prototype.analyzeBitmap = function(a, b) {
  6929. var d = a.name;
  6930. if (!this.fileDic[d] && b) {
  6931. var c = this.sheetMap[d];
  6932. delete this.sheetMap[d];
  6933. c = this.parseSpriteSheet(b, c, a.data && a.data.subkeys ? "": d);
  6934. this.fileDic[d] = c
  6935. }
  6936. };
  6937. a.prototype.getRelativePath = function(a, b) {
  6938. a = a.split("\\").join("/");
  6939. var d = a.lastIndexOf("/");
  6940. return a = -1 != d ? a.substring(0, d + 1) + b: b
  6941. };
  6942. a.prototype.parseSpriteSheet = function(a, b, d) {
  6943. b = b.frames;
  6944. if (!b) return null;
  6945. var c = new egret.SpriteSheet(a),
  6946. g = this.textureMap,
  6947. f;
  6948. for (f in b) {
  6949. var l = b[f];
  6950. a = c.createTexture(f, l.x, l.y, l.w, l.h, l.offX, l.offY, l.sourceW, l.sourceH);
  6951. l.scale9grid && (l = l.scale9grid.split(","), a.scale9Grid = new egret.Rectangle(parseInt(l[0]), parseInt(l[1]), parseInt(l[2]), parseInt(l[3])));
  6952. null == g[f] && (g[f] = a, d && this.addSubkey(f, d))
  6953. }
  6954. return c
  6955. };
  6956. a.prototype.destroyRes = function(a) {
  6957. var b = this.fileDic[a];
  6958. if (b) {
  6959. delete this.fileDic[a];
  6960. for (var d in b._textureMap) this.textureMap[d] && delete this.textureMap[d];
  6961. return ! 0
  6962. }
  6963. return ! 1
  6964. };
  6965. return a
  6966. } (b.BinAnalyzer);
  6967. b.SheetAnalyzer = c;
  6968. c.prototype.__class__ = "RES.SheetAnalyzer"
  6969. })(RES || (RES = {}));
  6970. __extends = this.__extends ||
  6971. function(b, c) {
  6972. function d() {
  6973. this.constructor = b
  6974. }
  6975. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  6976. d.prototype = c.prototype;
  6977. b.prototype = new d
  6978. }; (function(b) {
  6979. var c = function(b) {
  6980. function a() {
  6981. b.call(this)
  6982. }
  6983. __extends(a, b);
  6984. a.prototype.analyzeConfig = function(a, b) {
  6985. var d = a.name,
  6986. c, g = "";
  6987. try {
  6988. c = JSON.parse(b)
  6989. } catch(f) {}
  6990. c ? g = this.getRelativePath(a.url, c.file) : (c = b, g = this.getTexturePath(a.url, c));
  6991. this.sheetMap[d] = c;
  6992. return g
  6993. };
  6994. a.prototype.analyzeBitmap = function(a, b) {
  6995. var d = a.name;
  6996. if (!this.fileDic[d] && b) {
  6997. var c = this.sheetMap[d];
  6998. delete this.sheetMap[d];
  6999. c = new egret.BitmapFont(b, c);
  7000. this.fileDic[d] = c
  7001. }
  7002. };
  7003. a.prototype.getTexturePath = function(a, b) {
  7004. var d = "",
  7005. c = b.split("\n")[2],
  7006. g = c.indexOf('file="'); - 1 != g && (c = c.substring(g + 6), g = c.indexOf('"'), d = c.substring(0, g));
  7007. a = a.split("\\").join("/");
  7008. g = a.lastIndexOf("/");
  7009. return a = -1 != g ? a.substring(0, g + 1) + d: d
  7010. };
  7011. a.prototype.destroyRes = function(a) {
  7012. return this.fileDic[a] ? (delete this.fileDic[a], !0) : !1
  7013. };
  7014. return a
  7015. } (b.SheetAnalyzer);
  7016. b.FontAnalyzer = c;
  7017. c.prototype.__class__ = "RES.FontAnalyzer"
  7018. })(RES || (RES = {}));
  7019. __extends = this.__extends ||
  7020. function(b, c) {
  7021. function d() {
  7022. this.constructor = b
  7023. }
  7024. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7025. d.prototype = c.prototype;
  7026. b.prototype = new d
  7027. }; (function(b) {
  7028. var c = function(b) {
  7029. function a() {
  7030. b.call(this);
  7031. this._dataFormat = egret.URLLoaderDataFormat.SOUND
  7032. }
  7033. __extends(a, b);
  7034. a.prototype.analyzeData = function(a, b) {
  7035. var d = a.name; ! this.fileDic[d] && b && (this.fileDic[d] = b, (d = a.data) && d.soundType ? b.preload(d.soundType) : b.preload(egret.Sound.EFFECT))
  7036. };
  7037. return a
  7038. } (b.BinAnalyzer);
  7039. b.SoundAnalyzer = c;
  7040. c.prototype.__class__ = "RES.SoundAnalyzer"
  7041. })(RES || (RES = {}));
  7042. __extends = this.__extends ||
  7043. function(b, c) {
  7044. function d() {
  7045. this.constructor = b
  7046. }
  7047. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7048. d.prototype = c.prototype;
  7049. b.prototype = new d
  7050. }; (function(b) {
  7051. var c = function(b) {
  7052. function a() {
  7053. b.call(this);
  7054. this._dataFormat = egret.URLLoaderDataFormat.TEXT
  7055. }
  7056. __extends(a, b);
  7057. a.prototype.analyzeData = function(a, b) {
  7058. var d = a.name;
  7059. if (!this.fileDic[d] && b) try {
  7060. var c = egret.XML.parse(b);
  7061. this.fileDic[d] = c
  7062. } catch(g) {}
  7063. };
  7064. return a
  7065. } (b.BinAnalyzer);
  7066. b.XMLAnalyzer = c;
  7067. c.prototype.__class__ = "RES.XMLAnalyzer"
  7068. })(RES || (RES = {}));
  7069. __extends = this.__extends ||
  7070. function(b, c) {
  7071. function d() {
  7072. this.constructor = b
  7073. }
  7074. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7075. d.prototype = c.prototype;
  7076. b.prototype = new d
  7077. }; (function(b) {
  7078. b.loadConfig = function(a, b, c) {
  7079. void 0 === b && (b = "");
  7080. void 0 === c && (c = "json");
  7081. d.loadConfig(a, b, c)
  7082. };
  7083. b.loadGroup = function(a, b) {
  7084. void 0 === b && (b = 0);
  7085. d.loadGroup(a, b)
  7086. };
  7087. b.isGroupLoaded = function(a) {
  7088. return d.isGroupLoaded(a)
  7089. };
  7090. b.getGroupByName = function(a) {
  7091. return d.getGroupByName(a)
  7092. };
  7093. b.createGroup = function(a, b, c) {
  7094. void 0 === c && (c = !1);
  7095. return d.createGroup(a, b, c)
  7096. };
  7097. b.hasRes = function(a) {
  7098. return d.hasRes(a)
  7099. };
  7100. b.parseConfig = function(a, b) {
  7101. void 0 === b && (b = "");
  7102. d.parseConfig(a, b)
  7103. };
  7104. b.getRes = function(a) {
  7105. return d.getRes(a)
  7106. };
  7107. b.getResAsync = function(a, b, c) {
  7108. d.getResAsync(a, b, c)
  7109. };
  7110. b.getResByUrl = function(a, b, c, m) {
  7111. void 0 === m && (m = "");
  7112. d.getResByUrl(a, b, c, m)
  7113. };
  7114. b.destroyRes = function(a) {
  7115. return d.destroyRes(a)
  7116. };
  7117. b.setMaxLoadingThread = function(a) {
  7118. d.setMaxLoadingThread(a)
  7119. };
  7120. b.addEventListener = function(a, b, c, m, h) {
  7121. void 0 === m && (m = !1);
  7122. void 0 === h && (h = 0);
  7123. d.addEventListener(a, b, c, m, h)
  7124. };
  7125. b.removeEventListener = function(a, b, c, m) {
  7126. void 0 === m && (m = !1);
  7127. d.removeEventListener(a, b, c, m)
  7128. };
  7129. var c = function(a) {
  7130. function e() {
  7131. a.call(this);
  7132. this.analyzerDic = {};
  7133. this.configItemList = [];
  7134. this.configComplete = this.callLaterFlag = !1;
  7135. this.loadedGroups = [];
  7136. this.groupNameList = [];
  7137. this.asyncDic = {};
  7138. this.init()
  7139. }
  7140. __extends(e, a);
  7141. e.prototype.getAnalyzerByType = function(a) {
  7142. var e = this.analyzerDic[a];
  7143. e || (e = this.analyzerDic[a] = egret.Injector.getInstance(b.AnalyzerBase, a));
  7144. return e
  7145. };
  7146. e.prototype.init = function() {
  7147. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_BIN) || egret.Injector.mapClass(b.AnalyzerBase, b.BinAnalyzer, b.ResourceItem.TYPE_BIN);
  7148. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_IMAGE) || egret.Injector.mapClass(b.AnalyzerBase, b.ImageAnalyzer, b.ResourceItem.TYPE_IMAGE);
  7149. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_TEXT) || egret.Injector.mapClass(b.AnalyzerBase, b.TextAnalyzer, b.ResourceItem.TYPE_TEXT);
  7150. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_JSON) || egret.Injector.mapClass(b.AnalyzerBase, b.JsonAnalyzer, b.ResourceItem.TYPE_JSON);
  7151. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SHEET) || egret.Injector.mapClass(b.AnalyzerBase, b.SheetAnalyzer, b.ResourceItem.TYPE_SHEET);
  7152. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_FONT) || egret.Injector.mapClass(b.AnalyzerBase, b.FontAnalyzer, b.ResourceItem.TYPE_FONT);
  7153. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_SOUND) || egret.Injector.mapClass(b.AnalyzerBase, b.SoundAnalyzer, b.ResourceItem.TYPE_SOUND);
  7154. egret.Injector.hasMapRule(b.AnalyzerBase, b.ResourceItem.TYPE_XML) || egret.Injector.mapClass(b.AnalyzerBase, b.XMLAnalyzer, b.ResourceItem.TYPE_XML);
  7155. this.resConfig = new b.ResourceConfig;
  7156. this.resLoader = new b.ResourceLoader;
  7157. this.resLoader.callBack = this.onResourceItemComp;
  7158. this.resLoader.resInstance = this;
  7159. this.resLoader.addEventListener(b.ResourceEvent.GROUP_COMPLETE, this.onGroupComp, this);
  7160. this.resLoader.addEventListener(b.ResourceEvent.GROUP_LOAD_ERROR, this.onGroupError, this)
  7161. };
  7162. e.prototype.loadConfig = function(a, b, e) {
  7163. void 0 === e && (e = "json");
  7164. this.configItemList.push({
  7165. url: a,
  7166. resourceRoot: b,
  7167. type: e
  7168. });
  7169. this.callLaterFlag || (egret.callLater(this.startLoadConfig, this), this.callLaterFlag = !0)
  7170. };
  7171. e.prototype.startLoadConfig = function() {
  7172. this.callLaterFlag = !1;
  7173. var a = this.configItemList;
  7174. this.configItemList = [];
  7175. this.loadingConfigList = a;
  7176. for (var d = a.length,
  7177. c = [], g = 0; g < d; g++) {
  7178. var f = a[g],
  7179. f = new b.ResourceItem(f.url, f.url, f.type);
  7180. c.push(f)
  7181. }
  7182. this.resLoader.loadGroup(c, e.GROUP_CONFIG, Number.MAX_VALUE)
  7183. };
  7184. e.prototype.isGroupLoaded = function(a) {
  7185. return - 1 != this.loadedGroups.indexOf(a)
  7186. };
  7187. e.prototype.getGroupByName = function(a) {
  7188. return this.resConfig.getGroupByName(a)
  7189. };
  7190. e.prototype.loadGroup = function(a, e) {
  7191. void 0 === e && (e = 0);
  7192. if ( - 1 != this.loadedGroups.indexOf(a)) b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.GROUP_COMPLETE, a);
  7193. else if (!this.resLoader.isGroupInLoading(a)) if (this.configComplete) {
  7194. var d = this.resConfig.getGroupByName(a);
  7195. this.resLoader.loadGroup(d, a, e)
  7196. } else this.groupNameList.push({
  7197. name: a,
  7198. priority: e
  7199. })
  7200. };
  7201. e.prototype.createGroup = function(a, b, e) {
  7202. void 0 === e && (e = !1);
  7203. if (e) {
  7204. var d = this.loadedGroups.indexOf(a); - 1 != d && this.loadedGroups.splice(d, 1)
  7205. }
  7206. return this.resConfig.createGroup(a, b, e)
  7207. };
  7208. e.prototype.onGroupComp = function(a) {
  7209. if (a.groupName == e.GROUP_CONFIG) {
  7210. a = this.loadingConfigList.length;
  7211. for (var d = 0; d < a; d++) {
  7212. var c = this.loadingConfigList[d],
  7213. g = this.getAnalyzerByType(c.type),
  7214. f = g.getRes(c.url);
  7215. g.destroyRes(c.url);
  7216. this.resConfig.parseConfig(f, c.resourceRoot)
  7217. }
  7218. this.configComplete = !0;
  7219. this.loadingConfigList = null;
  7220. b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_COMPLETE);
  7221. this.loadDelayGroups()
  7222. } else this.loadedGroups.push(a.groupName),
  7223. this.dispatchEvent(a)
  7224. };
  7225. e.prototype.loadDelayGroups = function() {
  7226. var a = this.groupNameList;
  7227. this.groupNameList = [];
  7228. for (var b = a.length,
  7229. e = 0; e < b; e++) {
  7230. var d = a[e];
  7231. this.loadGroup(d.name, d.priority)
  7232. }
  7233. };
  7234. e.prototype.onGroupError = function(a) {
  7235. a.groupName == e.GROUP_CONFIG ? (this.loadingConfigList = null, b.ResourceEvent.dispatchResourceEvent(this, b.ResourceEvent.CONFIG_LOAD_ERROR)) : this.dispatchEvent(a)
  7236. };
  7237. e.prototype.hasRes = function(a) {
  7238. var e = this.resConfig.getType(a);
  7239. return "" == e && (a = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(a), "" == e) ? !1 : !0
  7240. };
  7241. e.prototype.parseConfig = function(a, b) {
  7242. this.resConfig.parseConfig(a, b);
  7243. this.configComplete || this.loadingConfigList || (this.configComplete = !0, this.loadDelayGroups())
  7244. };
  7245. e.prototype.getRes = function(a) {
  7246. var e = this.resConfig.getType(a);
  7247. return "" == e && (e = b.AnalyzerBase.getStringPrefix(a), e = this.resConfig.getType(e), "" == e) ? null: this.getAnalyzerByType(e).getRes(a)
  7248. };
  7249. e.prototype.getResAsync = function(a, e, d) {
  7250. var c = this.resConfig.getType(a),
  7251. f = this.resConfig.getName(a);
  7252. if ("" == c && (f = b.AnalyzerBase.getStringPrefix(a), c = this.resConfig.getType(f), "" == c)) {
  7253. e.call(d, null);
  7254. return
  7255. } (c = this.getAnalyzerByType(c).getRes(a)) ? e.call(d, c) : (a = {
  7256. key: a,
  7257. compFunc: e,
  7258. thisObject: d
  7259. },
  7260. this.asyncDic[f] ? this.asyncDic[f].push(a) : (this.asyncDic[f] = [a], f = this.resConfig.getResourceItem(f), this.resLoader.loadItem(f)))
  7261. };
  7262. e.prototype.getResByUrl = function(a, e, d, c) {
  7263. void 0 === c && (c = "");
  7264. if (a) {
  7265. c || (c = this.getTypeByUrl(a));
  7266. var f = this.getAnalyzerByType(c).getRes(a);
  7267. f ? e.call(d, f) : (e = {
  7268. key: a,
  7269. compFunc: e,
  7270. thisObject: d
  7271. },
  7272. this.asyncDic[a] ? this.asyncDic[a].push(e) : (this.asyncDic[a] = [e], a = new b.ResourceItem(a, a, c), this.resLoader.loadItem(a)))
  7273. } else e.call(d, null)
  7274. };
  7275. e.prototype.getTypeByUrl = function(a) { (a = a.substr(a.lastIndexOf(".") + 1)) && (a = a.toLowerCase());
  7276. switch (a) {
  7277. case b.ResourceItem.TYPE_XML:
  7278. case b.ResourceItem.TYPE_JSON:
  7279. case b.ResourceItem.TYPE_SHEET:
  7280. break;
  7281. case "png":
  7282. case "jpg":
  7283. case "gif":
  7284. case "jpeg":
  7285. case "bmp":
  7286. a = b.ResourceItem.TYPE_IMAGE;
  7287. break;
  7288. case "fnt":
  7289. a = b.ResourceItem.TYPE_FONT;
  7290. break;
  7291. case "txt":
  7292. a = b.ResourceItem.TYPE_TEXT;
  7293. break;
  7294. case "mp3":
  7295. case "ogg":
  7296. case "mpeg":
  7297. case "wav":
  7298. case "m4a":
  7299. case "mp4":
  7300. case "aiff":
  7301. case "wma":
  7302. case "mid":
  7303. a = b.ResourceItem.TYPE_SOUND;
  7304. break;
  7305. default:
  7306. a = b.ResourceItem.TYPE_BIN
  7307. }
  7308. return a
  7309. };
  7310. e.prototype.onResourceItemComp = function(a) {
  7311. var b = this.asyncDic[a.name];
  7312. delete this.asyncDic[a.name];
  7313. a = this.getAnalyzerByType(a.type);
  7314. for (var e = b.length,
  7315. d = 0; d < e; d++) {
  7316. var c = b[d],
  7317. l = a.getRes(c.key);
  7318. c.compFunc.call(c.thisObject, l, c.key)
  7319. }
  7320. };
  7321. e.prototype.destroyRes = function(a) {
  7322. var b = this.resConfig.getRawGroupByName(a);
  7323. if (b) {
  7324. var e = this.loadedGroups.indexOf(a); - 1 != e && this.loadedGroups.splice(e, 1);
  7325. a = b.length;
  7326. for (var d = 0; d < a; d++) {
  7327. e = b[d];
  7328. e.loaded = !1;
  7329. var c = this.getAnalyzerByType(e.type);
  7330. c.destroyRes(e.name)
  7331. }
  7332. return ! 0
  7333. }
  7334. b = this.resConfig.getType(a);
  7335. if ("" == b) return ! 1;
  7336. e = this.resConfig.getRawResourceItem(a);
  7337. e.loaded = !1;
  7338. c = this.getAnalyzerByType(b);
  7339. return c.destroyRes(a)
  7340. };
  7341. e.prototype.setMaxLoadingThread = function(a) {
  7342. 1 > a && (a = 1);
  7343. this.resLoader.thread = a
  7344. };
  7345. e.GROUP_CONFIG = "RES__CONFIG";
  7346. return e
  7347. } (egret.EventDispatcher);
  7348. c.prototype.__class__ = "RES.Resource";
  7349. var d = new c
  7350. })(RES || (RES = {}));
  7351. __extends = this.__extends ||
  7352. function(b, c) {
  7353. function d() {
  7354. this.constructor = b
  7355. }
  7356. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7357. d.prototype = c.prototype;
  7358. b.prototype = new d
  7359. }; (function(b) {
  7360. var c = function(d) {
  7361. function a(b) {
  7362. void 0 === b && (b = 60);
  7363. d.call(this);
  7364. this.frameRate = b;
  7365. this._time = 0;
  7366. this._requestAnimationId = NaN;
  7367. this._isActivate = !0;
  7368. 60 == b && (a.requestAnimationFrame = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame, a.cancelAnimationFrame = window.cancelAnimationFrame || window.msCancelAnimationFrame || window.mozCancelAnimationFrame || window.webkitCancelAnimationFrame || window.oCancelAnimationFrame || window.cancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.webkitCancelRequestAnimationFrame);
  7369. a.requestAnimationFrame || (a.requestAnimationFrame = function(a) {
  7370. return window.setTimeout(a, 1E3 / b)
  7371. });
  7372. a.cancelAnimationFrame || (a.cancelAnimationFrame = function(a) {
  7373. return window.clearTimeout(a)
  7374. });
  7375. a.instance = this;
  7376. this.registerListener()
  7377. }
  7378. __extends(a, d);
  7379. a.prototype.enterFrame = function() {
  7380. var e = a.instance,
  7381. d = a._thisObject,
  7382. c = a._callback,
  7383. h = b.getTimer(),
  7384. g = h - e._time;
  7385. e._requestAnimationId = a.requestAnimationFrame.call(window, a.prototype.enterFrame);
  7386. c.call(d, g);
  7387. e._time = h
  7388. };
  7389. a.prototype.executeMainLoop = function(b, d) {
  7390. a._callback = b;
  7391. a._thisObject = d;
  7392. this.enterFrame()
  7393. };
  7394. a.prototype.reset = function() {
  7395. var e = a.instance;
  7396. e._requestAnimationId && (e._time = b.getTimer(), a.cancelAnimationFrame.call(window, e._requestAnimationId), e.enterFrame())
  7397. };
  7398. a.prototype.registerListener = function() {
  7399. var e = this,
  7400. d = function() {
  7401. e._isActivate && (e._isActivate = !1, b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.DEACTIVATE)))
  7402. },
  7403. c = function() {
  7404. e._isActivate || (e._isActivate = !0, a.instance.reset(), b.MainContext.instance.stage.dispatchEvent(new b.Event(b.Event.ACTIVATE)))
  7405. },
  7406. h = function() {
  7407. document[g] ? d() : c()
  7408. };
  7409. window.addEventListener("focus", c, !1);
  7410. window.addEventListener("blur", d, !1);
  7411. var g, f;
  7412. "undefined" !== typeof document.hidden ? (g = "hidden", f = "visibilitychange") : "undefined" !== typeof document.mozHidden ? (g = "mozHidden", f = "mozvisibilitychange") : "undefined" !== typeof document.msHidden ? (g = "msHidden", f = "msvisibilitychange") : "undefined" !== typeof document.webkitHidden ? (g = "webkitHidden", f = "webkitvisibilitychange") : "undefined" !== typeof document.oHidden && (g = "oHidden", f = "ovisibilitychange");
  7413. "onpageshow" in window && "onpagehide" in window && (window.addEventListener("pageshow", c, !1), window.addEventListener("pagehide", d, !1));
  7414. g && f && document.addEventListener(f, h, !1)
  7415. };
  7416. a.instance = null;
  7417. a.requestAnimationFrame = null;
  7418. a.cancelAnimationFrame = null;
  7419. a._thisObject = null;
  7420. a._callback = null;
  7421. return a
  7422. } (b.DeviceContext);
  7423. b.HTML5DeviceContext = c;
  7424. c.prototype.__class__ = "egret.HTML5DeviceContext"
  7425. })(egret || (egret = {}));
  7426. var egret_html5_localStorage; (function(b) {
  7427. b.getItem = function(b) {
  7428. return window.localStorage.getItem(b)
  7429. };
  7430. b.setItem = function(b, d) {
  7431. try {
  7432. return window.localStorage.setItem(b, d),
  7433. !0
  7434. } catch(a) {
  7435. return egret.Logger.infoWithErrorId(1018, b, d),
  7436. !1
  7437. }
  7438. };
  7439. b.removeItem = function(b) {
  7440. window.localStorage.removeItem(b)
  7441. };
  7442. b.clear = function() {
  7443. window.localStorage.clear()
  7444. };
  7445. b.init = function() {
  7446. for (var c in b) egret.localStorage[c] = b[c]
  7447. }
  7448. })(egret_html5_localStorage || (egret_html5_localStorage = {}));
  7449. egret_html5_localStorage.init();
  7450. __extends = this.__extends ||
  7451. function(b, c) {
  7452. function d() {
  7453. this.constructor = b
  7454. }
  7455. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7456. d.prototype = c.prototype;
  7457. b.prototype = new d
  7458. }; (function(b) {
  7459. var c = function(d) {
  7460. function a(a, b) {
  7461. void 0 === b && (b = !0);
  7462. d.call(this);
  7463. this.globalAlpha = 1;
  7464. this.useCacheCanvas = b;
  7465. this.canvas = a || this.createCanvas();
  7466. this.canvasContext = this.canvas.getContext("2d");
  7467. b ? (this._cacheCanvas = document.createElement("canvas"), this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height, this.drawCanvasContext = this._cacheCanvasContext = this._cacheCanvas.getContext("2d")) : this.drawCanvasContext = this.canvasContext;
  7468. this.onResize();
  7469. var c = this.drawCanvasContext.setTransform,
  7470. h = this;
  7471. this.drawCanvasContext.setTransform = function(a, b, e, d, k, q) {
  7472. h._matrixA = a;
  7473. h._matrixB = b;
  7474. h._matrixC = e;
  7475. h._matrixD = d;
  7476. h._matrixTx = k;
  7477. h._matrixTy = q;
  7478. c.call(h.drawCanvasContext, a, b, e, d, k, q)
  7479. };
  7480. this._matrixA = 1;
  7481. this._matrixC = this._matrixB = 0;
  7482. this._matrixD = 1;
  7483. this._transformTy = this._transformTx = this._matrixTy = this._matrixTx = 0;
  7484. this.initBlendMode()
  7485. }
  7486. __extends(a, d);
  7487. a.prototype.createCanvas = function() {
  7488. var a = b.Browser.getInstance().$("#egretCanvas");
  7489. if (!a) {
  7490. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  7491. a = b.Browser.getInstance().$new("canvas");
  7492. a.id = "egretCanvas";
  7493. d.appendChild(a)
  7494. }
  7495. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  7496. return a
  7497. };
  7498. a.prototype.onResize = function() {
  7499. if (this.canvas) {
  7500. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  7501. this.canvas.width = b.MainContext.instance.stage.stageWidth;
  7502. this.canvas.height = b.MainContext.instance.stage.stageHeight;
  7503. this.canvas.style.width = a.style.width;
  7504. this.canvas.style.height = a.style.height;
  7505. this.useCacheCanvas && (this._cacheCanvas.width = this.canvas.width, this._cacheCanvas.height = this.canvas.height);
  7506. this.drawCanvasContext.imageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  7507. this.drawCanvasContext.webkitImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  7508. this.drawCanvasContext.mozImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled;
  7509. this.drawCanvasContext.msImageSmoothingEnabled = b.RendererContext.imageSmoothingEnabled
  7510. }
  7511. };
  7512. a.prototype.clearScreen = function() {
  7513. for (var a = b.RenderFilter.getInstance().getDrawAreaList(), d = 0, c = a.length; d < c; d++) {
  7514. var h = a[d];
  7515. this.clearRect(h.x, h.y, h.width, h.height)
  7516. }
  7517. a = b.MainContext.instance.stage;
  7518. this.useCacheCanvas && this._cacheCanvasContext.clearRect(0, 0, a.stageWidth, a.stageHeight);
  7519. this.renderCost = 0
  7520. };
  7521. a.prototype.clearRect = function(a, b, d, c) {
  7522. this.canvasContext.clearRect(a, b, d, c)
  7523. };
  7524. a.prototype.drawImage = function(a, c, m, h, g, f, l, n, p, q) {
  7525. void 0 === q && (q = void 0);
  7526. var r = a._bitmapData;
  7527. f += this._transformTx;
  7528. l += this._transformTy;
  7529. var t = b.getTimer();
  7530. void 0 === q ? this.drawCanvasContext.drawImage(r, c, m, h, g, f, l, n, p) : this.drawRepeatImage(a, c, m, h, g, f, l, n, p, q);
  7531. d.prototype.drawImage.call(this, a, c, m, h, g, f, l, n, p, q);
  7532. this.renderCost += b.getTimer() - t
  7533. };
  7534. a.prototype.drawRepeatImage = function(a, d, c, h, g, f, l, n, p, q) {
  7535. if (void 0 === a.pattern) {
  7536. var r = b.MainContext.instance.rendererContext._texture_scale_factor,
  7537. t = a._bitmapData,
  7538. s = t;
  7539. if (t.width != h || t.height != g || 1 != r) s = document.createElement("canvas"),
  7540. s.width = h * r,
  7541. s.height = g * r,
  7542. s.getContext("2d").drawImage(t, d, c, h, g, 0, 0, h * r, g * r);
  7543. d = this.drawCanvasContext.createPattern(s, q);
  7544. a.pattern = d
  7545. }
  7546. this.drawCanvasContext.fillStyle = a.pattern;
  7547. this.drawCanvasContext.translate(f, l);
  7548. this.drawCanvasContext.fillRect(0, 0, n, p);
  7549. this.drawCanvasContext.translate( - f, -l)
  7550. };
  7551. a.prototype.setTransform = function(a) {
  7552. 1 == a.a && 0 == a.b && 0 == a.c && 1 == a.d && 1 == this._matrixA && 0 == this._matrixB && 0 == this._matrixC && 1 == this._matrixD ? (this._transformTx = a.tx - this._matrixTx, this._transformTy = a.ty - this._matrixTy) : (this._transformTx = this._transformTy = 0, this._matrixA == a.a && this._matrixB == a.b && this._matrixC == a.c && this._matrixD == a.d && this._matrixTx == a.tx && this._matrixTy == a.ty || this.drawCanvasContext.setTransform(a.a, a.b, a.c, a.d, a.tx, a.ty))
  7553. };
  7554. a.prototype.setAlpha = function(a, d) {
  7555. a != this.globalAlpha && (this.drawCanvasContext.globalAlpha = this.globalAlpha = a);
  7556. d ? (this.blendValue = this.blendModes[d], this.drawCanvasContext.globalCompositeOperation = this.blendValue) : this.blendValue != b.BlendMode.NORMAL && (this.blendValue = this.blendModes[b.BlendMode.NORMAL], this.drawCanvasContext.globalCompositeOperation = this.blendValue)
  7557. };
  7558. a.prototype.initBlendMode = function() {
  7559. this.blendModes = {};
  7560. this.blendModes[b.BlendMode.NORMAL] = "source-over";
  7561. this.blendModes[b.BlendMode.ADD] = "lighter"
  7562. };
  7563. a.prototype.setupFont = function(a, b) {
  7564. void 0 === b && (b = null);
  7565. b = b || {};
  7566. var d = null == b.size ? a._size: b.size,
  7567. c = null == b.fontFamily ? a._fontFamily: b.fontFamily,
  7568. g = this.drawCanvasContext,
  7569. f = (null == b.italic ? a._italic: b.italic) ? "italic ": "normal ",
  7570. f = f + ((null == b.bold ? a._bold: b.bold) ? "bold ": "normal ");
  7571. g.font = f + (d + "px " + c);
  7572. g.textAlign = "left";
  7573. g.textBaseline = "middle"
  7574. };
  7575. a.prototype.measureText = function(a) {
  7576. return this.drawCanvasContext.measureText(a).width
  7577. };
  7578. a.prototype.drawText = function(a, c, m, h, g, f) {
  7579. void 0 === f && (f = null);
  7580. this.setupFont(a, f);
  7581. f = f || {};
  7582. var l;
  7583. l = null != f.textColor ? b.toColorString(f.textColor) : a._textColorString;
  7584. var n;
  7585. n = null != f.strokeColor ? b.toColorString(f.strokeColor) : a._strokeColorString;
  7586. var p;
  7587. p = null != f.stroke ? f.stroke: a._stroke;
  7588. var q = this.drawCanvasContext;
  7589. q.fillStyle = l;
  7590. q.strokeStyle = n;
  7591. p && (q.lineWidth = 2 * p, q.strokeText(c, m + this._transformTx, h + this._transformTy, g || 65535));
  7592. q.fillText(c, m + this._transformTx, h + this._transformTy, g || 65535);
  7593. d.prototype.drawText.call(this, a, c, m, h, g, f)
  7594. };
  7595. a.prototype.strokeRect = function(a, b, d, c, g) {
  7596. this.drawCanvasContext.strokeStyle = g;
  7597. this.drawCanvasContext.strokeRect(a, b, d, c)
  7598. };
  7599. a.prototype.pushMask = function(a) {
  7600. this.drawCanvasContext.save();
  7601. this.drawCanvasContext.beginPath();
  7602. this.drawCanvasContext.rect(a.x + this._transformTx, a.y + this._transformTy, a.width, a.height);
  7603. this.drawCanvasContext.clip();
  7604. this.drawCanvasContext.closePath()
  7605. };
  7606. a.prototype.popMask = function() {
  7607. this.drawCanvasContext.restore();
  7608. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0)
  7609. };
  7610. a.prototype.onRenderStart = function() {
  7611. this.drawCanvasContext.save()
  7612. };
  7613. a.prototype.onRenderFinish = function() {
  7614. this.drawCanvasContext.restore();
  7615. this.drawCanvasContext.setTransform(1, 0, 0, 1, 0, 0);
  7616. if (this.useCacheCanvas) for (var a = this._cacheCanvas.width,
  7617. d = this._cacheCanvas.height,
  7618. c = b.RenderFilter.getInstance().getDrawAreaList(), h = 0, g = c.length; h < g; h++) {
  7619. var f = c[h],
  7620. l = f.x,
  7621. n = f.y,
  7622. p = f.width,
  7623. f = f.height;
  7624. l + p > a && (p = a - l);
  7625. n + f > d && (f = d - n);
  7626. 0 < p && 0 < f && this.canvasContext.drawImage(this._cacheCanvas, l, n, p, f, l, n, p, f)
  7627. }
  7628. };
  7629. return a
  7630. } (b.RendererContext);
  7631. b.HTML5CanvasRenderer = c;
  7632. c.prototype.__class__ = "egret.HTML5CanvasRenderer"
  7633. })(egret || (egret = {}));
  7634. var egret_h5_graphics; (function(b) {
  7635. b.beginFill = function(b, a) {
  7636. void 0 === a && (a = 1);
  7637. var e = "rgba(" + (b >> 16) + "," + ((b & 65280) >> 8) + "," + (b & 255) + "," + a + ")";
  7638. this.fillStyleColor = e;
  7639. this._pushCommand(new c(this._setStyle, this, [e]))
  7640. };
  7641. b.drawRect = function(b, a, e, k) {
  7642. this._pushCommand(new c(function(a, b, e, d) {
  7643. var c = this.renderContext;
  7644. this.canvasContext.beginPath();
  7645. this.canvasContext.rect(c._transformTx + a, c._transformTy + b, e, d);
  7646. this.canvasContext.closePath()
  7647. },
  7648. this, [b, a, e, k]));
  7649. this._fill();
  7650. this.checkRect(b, a, e, k)
  7651. };
  7652. b.drawCircle = function(b, a, e) {
  7653. this._pushCommand(new c(function(a, b, e) {
  7654. var d = this.renderContext;
  7655. this.canvasContext.beginPath();
  7656. this.canvasContext.arc(d._transformTx + a, d._transformTy + b, e, 0, 2 * Math.PI);
  7657. this.canvasContext.closePath()
  7658. },
  7659. this, [b, a, e]));
  7660. this._fill();
  7661. this.checkRect(b - e, a - e, 2 * e, 2 * e)
  7662. };
  7663. b.drawRoundRect = function(b, a, e, k, m, h) {
  7664. this._pushCommand(new c(function(a, b, e, d, c, k) {
  7665. var m = this.renderContext;
  7666. a = m._transformTx + a;
  7667. b = m._transformTy + b;
  7668. c /= 2;
  7669. k = k ? k / 2 : c;
  7670. e = a + e;
  7671. d = b + d;
  7672. m = d - k;
  7673. this.canvasContext.beginPath();
  7674. this.canvasContext.moveTo(e, m);
  7675. this.canvasContext.quadraticCurveTo(e, d, e - c, d);
  7676. this.canvasContext.lineTo(a + c, d);
  7677. this.canvasContext.quadraticCurveTo(a, d, a, d - k);
  7678. this.canvasContext.lineTo(a, b + k);
  7679. this.canvasContext.quadraticCurveTo(a, b, a + c, b);
  7680. this.canvasContext.lineTo(e - c, b);
  7681. this.canvasContext.quadraticCurveTo(e, b, e, b + k);
  7682. this.canvasContext.lineTo(e, m);
  7683. this.canvasContext.closePath()
  7684. },
  7685. this, [b, a, e, k, m, h]));
  7686. this._fill();
  7687. this.checkRect(b, a, e, k)
  7688. };
  7689. b.drawEllipse = function(b, a, e, k) {
  7690. this._pushCommand(new c(function(a, b, e, d) {
  7691. var c = this.renderContext;
  7692. this.canvasContext.save();
  7693. a = c._transformTx + a;
  7694. b = c._transformTy + b;
  7695. var c = e > d ? e: d,
  7696. k = e / c;
  7697. d /= c;
  7698. this.canvasContext.scale(k, d);
  7699. this.canvasContext.beginPath();
  7700. this.canvasContext.moveTo((a + e) / k, b / d);
  7701. this.canvasContext.arc(a / k, b / d, c, 0, 2 * Math.PI);
  7702. this.canvasContext.closePath();
  7703. this.canvasContext.restore();
  7704. this.canvasContext.stroke()
  7705. },
  7706. this, [b, a, e, k]));
  7707. this._fill();
  7708. this.checkRect(b - e, a - k, 2 * e, 2 * k)
  7709. };
  7710. b.lineStyle = function(b, a, e, k, m, h, g, f) {
  7711. void 0 === b && (b = NaN);
  7712. void 0 === a && (a = 0);
  7713. void 0 === e && (e = 1);
  7714. void 0 === k && (k = !1);
  7715. void 0 === m && (m = "normal");
  7716. void 0 === h && (h = null);
  7717. void 0 === g && (g = null);
  7718. void 0 === f && (f = 3);
  7719. this.strokeStyleColor && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand));
  7720. this.strokeStyleColor = a = "rgba(" + (a >> 16) + "," + ((a & 65280) >> 8) + "," + (a & 255) + "," + e + ")";
  7721. this._pushCommand(new c(function(a, b) {
  7722. this.canvasContext.lineWidth = a;
  7723. this.canvasContext.strokeStyle = b;
  7724. this.canvasContext.beginPath()
  7725. },
  7726. this, [b, a]));
  7727. "undefined" === typeof this.lineX && (this.lineY = this.lineX = 0);
  7728. this.moveTo(this.lineX, this.lineY)
  7729. };
  7730. b.lineTo = function(b, a) {
  7731. this._pushCommand(new c(function(a, b) {
  7732. var d = this.renderContext;
  7733. this.canvasContext.lineTo(d._transformTx + a, d._transformTy + b)
  7734. },
  7735. this, [b, a]));
  7736. this.lineX = b;
  7737. this.lineY = a;
  7738. this.checkPoint(b, a)
  7739. };
  7740. b.curveTo = function(b, a, e, k) {
  7741. this._pushCommand(new c(function(a, b, e, d) {
  7742. var c = this.renderContext;
  7743. this.canvasContext.quadraticCurveTo(c._transformTx + a, c._transformTy + b, c._transformTx + e, c._transformTy + d)
  7744. },
  7745. this, [b, a, e, k]));
  7746. this.lineX = e;
  7747. this.lineY = k;
  7748. this.checkPoint(b, a);
  7749. this.checkPoint(e, k)
  7750. };
  7751. b.moveTo = function(b, a) {
  7752. this._pushCommand(new c(function(a, b) {
  7753. var d = this.renderContext;
  7754. this.canvasContext.moveTo(d._transformTx + a, d._transformTy + b)
  7755. },
  7756. this, [b, a]));
  7757. this.checkPoint(b, a)
  7758. };
  7759. b.clear = function() {
  7760. this.lineY = this.lineX = this.commandQueue.length = 0;
  7761. this.fillStyleColor = this.strokeStyleColor = null;
  7762. this._dirty = !1;
  7763. this._maxY = this._maxX = this._minY = this._minX = 0
  7764. };
  7765. b.createEndFillCommand = function() {
  7766. this.endFillCommand || (this.endFillCommand = new c(function() {
  7767. this.canvasContext.fill();
  7768. this.canvasContext.closePath()
  7769. },
  7770. this, null))
  7771. };
  7772. b.endFill = function() {
  7773. null != this.fillStyleColor && this._fill()
  7774. };
  7775. b._fill = function() {
  7776. this.fillStyleColor && (this.createEndFillCommand(), this._pushCommand(this.endFillCommand), this.fillStyleColor = null)
  7777. };
  7778. b.createEndLineCommand = function() {
  7779. this.endLineCommand || (this.endLineCommand = new c(function() {
  7780. this.canvasContext.stroke();
  7781. this.canvasContext.closePath()
  7782. },
  7783. this, null))
  7784. };
  7785. b._pushCommand = function(b) {
  7786. this.commandQueue.push(b);
  7787. this._dirty = !0
  7788. };
  7789. b._draw = function(b) {
  7790. var a = this.commandQueue.length;
  7791. if (0 != a) {
  7792. this.renderContext = b;
  7793. b = this.canvasContext = this.renderContext.drawCanvasContext;
  7794. b.save();
  7795. this.strokeStyleColor && 0 < a && this.commandQueue[a - 1] != this.endLineCommand && (this.createEndLineCommand(), this._pushCommand(this.endLineCommand), a = this.commandQueue.length);
  7796. for (var e = 0; e < a; e++) {
  7797. var c = this.commandQueue[e];
  7798. c.method.apply(c.thisObject, c.args)
  7799. }
  7800. b.restore();
  7801. this._dirty = !1
  7802. }
  7803. };
  7804. var c = function() {
  7805. return function(b, a, e) {
  7806. this.method = b;
  7807. this.thisObject = a;
  7808. this.args = e
  7809. }
  7810. } ();
  7811. c.prototype.__class__ = "egret_h5_graphics.Command";
  7812. b._setStyle = function(b) {
  7813. this.canvasContext.fillStyle = b;
  7814. this.canvasContext.beginPath()
  7815. };
  7816. b.init = function() {
  7817. for (var d in b) egret.Graphics.prototype[d] = b[d];
  7818. egret.RendererContext.createRendererContext = function(a) {
  7819. return new egret.HTML5CanvasRenderer(a, !1)
  7820. }
  7821. }
  7822. })(egret_h5_graphics || (egret_h5_graphics = {}));
  7823. egret_h5_graphics.init();
  7824. __extends = this.__extends ||
  7825. function(b, c) {
  7826. function d() {
  7827. this.constructor = b
  7828. }
  7829. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  7830. d.prototype = c.prototype;
  7831. b.prototype = new d
  7832. }; (function(b) {
  7833. var c = function(d) {
  7834. function a(a) {
  7835. d.call(this);
  7836. this.glID = this.gl = this.canvas = null;
  7837. this.size = 2E3;
  7838. this.vertices = null;
  7839. this.vertSize = 5;
  7840. this.indices = null;
  7841. this.projectionY = this.projectionX = NaN;
  7842. this.shaderManager = null;
  7843. this.contextLost = !1;
  7844. this.glContextId = 0;
  7845. this.currentBlendMode = "";
  7846. this.currentBaseTexture = null;
  7847. this.currentBatchSize = 0;
  7848. this.worldTransform = null;
  7849. this.worldAlpha = 1;
  7850. this.maskList = [];
  7851. this.maskDataFreeList = [];
  7852. this.graphicsIndexBuffer = this.graphicsBuffer = this.graphicsIndices = this.graphicsPoints = this.filterType = this.colorTransformMatrix = null;
  7853. this.graphicsStyle = {};
  7854. this.canvas = a || this.createCanvas();
  7855. this.canvas.addEventListener("webglcontextlost", this.handleContextLost.bind(this), !1);
  7856. this.canvas.addEventListener("webglcontextrestored", this.handleContextRestored.bind(this), !1);
  7857. this.html5Canvas = document.createElement("canvas");
  7858. this.canvasContext = new b.HTML5CanvasRenderer(this.html5Canvas);
  7859. this.onResize();
  7860. this.projectionX = this.canvas.width / 2;
  7861. this.projectionY = -this.canvas.height / 2;
  7862. a = 6 * this.size;
  7863. this.vertices = new Float32Array(4 * this.size * this.vertSize);
  7864. this.indices = new Uint16Array(a);
  7865. for (var c = 0,
  7866. m = 0; c < a; c += 6, m += 4) this.indices[c + 0] = m + 0,
  7867. this.indices[c + 1] = m + 1,
  7868. this.indices[c + 2] = m + 2,
  7869. this.indices[c + 3] = m + 0,
  7870. this.indices[c + 4] = m + 2,
  7871. this.indices[c + 5] = m + 3;
  7872. this.initWebGL();
  7873. this.shaderManager = new b.WebGLShaderManager(this.gl);
  7874. this.worldTransform = new b.Matrix;
  7875. this.initAll()
  7876. }
  7877. __extends(a, d);
  7878. a.prototype.onRenderFinish = function() {
  7879. this._draw()
  7880. };
  7881. a.prototype.initAll = function() {
  7882. a.isInit || (a.isInit = !0, egret_webgl_graphics.init(), b.TextField.prototype._makeBitmapCache = function() {
  7883. this.renderTexture || (this.renderTexture = new b.RenderTexture);
  7884. var a = this.getBounds(b.Rectangle.identity);
  7885. if (0 == a.width || 0 == a.height) return this._texture_to_render = null,
  7886. !1;
  7887. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.renderContext = b.RendererContext.createRendererContext(this._bitmapData));
  7888. var d = a.width,
  7889. a = a.height,
  7890. c = b.MainContext.instance.rendererContext._texture_scale_factor,
  7891. a = a / c,
  7892. d = Math.round(d / c),
  7893. a = Math.round(a),
  7894. h = this._bitmapData;
  7895. h.width = d;
  7896. h.height = a;
  7897. h.style.width = d + "px";
  7898. h.style.height = a + "px";
  7899. this.renderContext._cacheCanvas && (this.renderContext._cacheCanvas.width = d, this.renderContext._cacheCanvas.height = a);
  7900. this._worldTransform.identity();
  7901. this._worldTransform.a = 1 / c;
  7902. this._worldTransform.d = 1 / c;
  7903. this.renderContext.setTransform(this._worldTransform);
  7904. this.worldAlpha = 1;
  7905. var h = b.RenderFilter.getInstance(),
  7906. g = h._drawAreaList.concat();
  7907. h._drawAreaList.length = 0;
  7908. this.renderContext.clearScreen();
  7909. this.renderContext.onRenderStart();
  7910. b.RendererContext.deleteTexture(this.renderTexture);
  7911. this._colorTransform && this.renderContext.setGlobalColorTransform(this._colorTransform.matrix);
  7912. var f = this.mask || this._scrollRect;
  7913. f && this.renderContext.pushMask(f);
  7914. this._render(this.renderContext);
  7915. f && this.renderContext.popMask();
  7916. this._colorTransform && this.renderContext.setGlobalColorTransform(null);
  7917. b.RenderTexture.identityRectangle.width = d;
  7918. b.RenderTexture.identityRectangle.height = a;
  7919. h.addDrawArea(b.RenderTexture.identityRectangle);
  7920. this.renderContext.onRenderFinish();
  7921. h._drawAreaList = g;
  7922. this.renderTexture._bitmapData = this._bitmapData;
  7923. this.renderTexture._sourceWidth = d;
  7924. this.renderTexture._sourceHeight = a;
  7925. this.renderTexture._textureWidth = this.renderTexture._sourceWidth * c;
  7926. this.renderTexture._textureHeight = this.renderTexture._sourceHeight * c;
  7927. this._texture_to_render = this.renderTexture;
  7928. return ! 0
  7929. },
  7930. b.TextField.prototype._draw = function(a) {
  7931. this.getDirty() && (this._texture_to_render = this.renderTexture, this._cacheAsBitmap = !0);
  7932. b.DisplayObject.prototype._draw.call(this, a)
  7933. },
  7934. b.RenderTexture.prototype.init = function() {
  7935. this._bitmapData = document.createElement("canvas");
  7936. this.canvasContext = this._bitmapData.getContext("2d");
  7937. this._webglBitmapData = document.createElement("canvas");
  7938. this.renderContext = new b.WebGLRenderer(this._webglBitmapData)
  7939. },
  7940. b.RenderTexture.prototype.setSize = function(a, d) {
  7941. if (this._webglBitmapData) {
  7942. var c = this._webglBitmapData;
  7943. c.width = a;
  7944. c.height = d;
  7945. c.style.width = a + "px";
  7946. c.style.height = d + "px";
  7947. this.renderContext.projectionX = a / 2;
  7948. this.renderContext.projectionY = -d / 2;
  7949. this.renderContext.viewportScale = b.MainContext.instance.rendererContext._texture_scale_factor
  7950. }
  7951. },
  7952. b.RenderTexture.prototype.end = function() {},
  7953. b.RenderTexture.prototype.drawToTexture = function(a, d, c) {
  7954. var h = d || a.getBounds(b.Rectangle.identity);
  7955. if (0 == h.width || 0 == h.height || d && (0 == d.width || 0 == d.height)) return ! 1;
  7956. "undefined" == typeof c && (c = 1);
  7957. this._bitmapData || (this._bitmapData = document.createElement("canvas"), this.canvasContext = this._bitmapData.getContext("2d"), b.RenderTexture.WebGLCanvas || (b.RenderTexture.WebGLCanvas = document.createElement("canvas"), b.RenderTexture.WebGLRenderer = new b.WebGLRenderer(b.RenderTexture.WebGLCanvas)), this._webglBitmapData = b.RenderTexture.WebGLCanvas, this.renderContext = b.RenderTexture.WebGLRenderer);
  7958. var g = h.x,
  7959. f = h.y;
  7960. d = h.width;
  7961. var h = h.height,
  7962. h = h / c,
  7963. l = b.MainContext.instance.rendererContext._texture_scale_factor;
  7964. d = Math.round(d / c);
  7965. h = Math.round(h);
  7966. this.setSize(d, h);
  7967. var n = this._bitmapData,
  7968. p = d / l * c,
  7969. q = h / l * c;
  7970. n.width = p;
  7971. n.height = q;
  7972. n.style.width = p + "px";
  7973. n.style.height = q + "px";
  7974. this.begin();
  7975. a._worldTransform.identity();
  7976. n = a._anchorOffsetX;
  7977. p = a._anchorOffsetY;
  7978. if (0 != a._anchorX || 0 != a._anchorY) n = a._anchorX * d,
  7979. p = a._anchorY * h;
  7980. this._offsetX = g + n;
  7981. this._offsetY = f + p;
  7982. a._worldTransform.append(1, 0, 0, 1, -this._offsetX, -this._offsetY);
  7983. a.worldAlpha = 1;
  7984. g = b.MainContext.__use_new_draw;
  7985. b.MainContext.__use_new_draw = !1;
  7986. if (a instanceof b.DisplayObjectContainer) for (f = a._children, n = 0, p = f.length; n < p; n++) f[n]._updateTransform();
  7987. this.renderContext.setTransform(a._worldTransform);
  7988. f = b.RenderFilter.getInstance();
  7989. n = f._drawAreaList.concat();
  7990. f._drawAreaList.length = 0;
  7991. p = this.renderContext.gl;
  7992. p.viewport(0, 0, d, h);
  7993. p.bindFramebuffer(p.FRAMEBUFFER, null);
  7994. p.clearColor(0, 0, 0, 0);
  7995. p.clear(p.COLOR_BUFFER_BIT);
  7996. this.renderContext.onRenderStart();
  7997. b.RendererContext.deleteTexture(this);
  7998. a._filter && this.renderContext.setGlobalFilter(a._filter);
  7999. a._colorTransform && this.renderContext.setGlobalColorTransform(a._colorTransform.matrix); (p = a.mask || a._scrollRect) && this.renderContext.pushMask(p);
  8000. a._render(this.renderContext);
  8001. this.renderContext._draw();
  8002. b.MainContext.__use_new_draw = g;
  8003. p && this.renderContext.popMask();
  8004. a._colorTransform && this.renderContext.setGlobalColorTransform(null);
  8005. a._filter && this.renderContext.setGlobalFilter(null);
  8006. b.RenderTexture.identityRectangle.width = d;
  8007. b.RenderTexture.identityRectangle.height = h;
  8008. f.addDrawArea(b.RenderTexture.identityRectangle);
  8009. this.renderContext.onRenderFinish();
  8010. f._drawAreaList = n;
  8011. this._sourceWidth = d / l * c;
  8012. this._sourceHeight = h / l * c;
  8013. this._textureWidth = d * c;
  8014. this._textureHeight = h * c;
  8015. this.canvasContext.drawImage(this._webglBitmapData, 0, 0, d, h, 0, 0, this._sourceWidth, this._sourceHeight);
  8016. return ! 0
  8017. })
  8018. };
  8019. a.prototype.createCanvas = function() {
  8020. var a = b.Browser.getInstance().$("#egretCanvas");
  8021. if (!a) {
  8022. var d = document.getElementById(b.StageDelegate.canvas_div_name),
  8023. a = b.Browser.getInstance().$new("canvas");
  8024. a.id = "egretCanvas";
  8025. d.appendChild(a)
  8026. }
  8027. b.MainContext.instance.stage.addEventListener(b.Event.RESIZE, this.onResize, this);
  8028. return a
  8029. };
  8030. a.prototype.onResize = function() {
  8031. var a = document.getElementById(b.StageDelegate.canvas_div_name);
  8032. this.canvas && (this.canvas.width = b.MainContext.instance.stage.stageWidth, this.canvas.height = b.MainContext.instance.stage.stageHeight, this.canvas.style.width = a.style.width, this.canvas.style.height = a.style.height, this.projectionX = this.canvas.width / 2, this.projectionY = -this.canvas.height / 2);
  8033. this.html5Canvas && (this.html5Canvas.width = b.MainContext.instance.stage.stageWidth, this.html5Canvas.height = b.MainContext.instance.stage.stageHeight, this.html5Canvas.style.width = a.style.width, this.html5Canvas.style.height = a.style.height)
  8034. };
  8035. a.prototype.handleContextLost = function() {
  8036. this.contextLost = !0
  8037. };
  8038. a.prototype.handleContextRestored = function() {
  8039. this.initWebGL();
  8040. this.shaderManager.setContext(this.gl);
  8041. this.contextLost = !1
  8042. };
  8043. a.prototype.initWebGL = function() {
  8044. for (var e = {},
  8045. d, c = ["experimental-webgl", "webgl"], h = 0; h < c.length; h++) {
  8046. try {
  8047. d = this.canvas.getContext(c[h], e)
  8048. } catch(g) {}
  8049. if (d) break
  8050. }
  8051. if (!d) throw Error(b.getString(1021));
  8052. a.glID++;
  8053. this.glID = a.glID;
  8054. this.setContext(d)
  8055. };
  8056. a.prototype.setContext = function(a) {
  8057. this.gl = a;
  8058. a.id = this.glContextId++;
  8059. this.vertexBuffer = a.createBuffer();
  8060. this.indexBuffer = a.createBuffer();
  8061. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  8062. a.bufferData(a.ELEMENT_ARRAY_BUFFER, this.indices, a.STATIC_DRAW);
  8063. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  8064. a.bufferData(a.ARRAY_BUFFER, this.vertices, a.DYNAMIC_DRAW);
  8065. a.disable(a.DEPTH_TEST);
  8066. a.disable(a.CULL_FACE);
  8067. a.enable(a.BLEND);
  8068. a.colorMask(!0, !0, !0, !0)
  8069. };
  8070. a.prototype.start = function() {
  8071. if (!this.contextLost) {
  8072. var a = this.gl;
  8073. a.activeTexture(a.TEXTURE0);
  8074. a.bindBuffer(a.ARRAY_BUFFER, this.vertexBuffer);
  8075. a.bindBuffer(a.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
  8076. var b;
  8077. b = this.colorTransformMatrix ? this.shaderManager.colorTransformShader: "blur" == this.filterType ? this.shaderManager.blurShader: this.shaderManager.defaultShader;
  8078. this.shaderManager.activateShader(b);
  8079. b.syncUniforms();
  8080. a.uniform2f(b.projectionVector, this.projectionX, this.projectionY);
  8081. var d = 4 * this.vertSize;
  8082. a.vertexAttribPointer(b.aVertexPosition, 2, a.FLOAT, !1, d, 0);
  8083. a.vertexAttribPointer(b.aTextureCoord, 2, a.FLOAT, !1, d, 8);
  8084. a.vertexAttribPointer(b.colorAttribute, 2, a.FLOAT, !1, d, 16)
  8085. }
  8086. };
  8087. a.prototype.clearScreen = function() {
  8088. var a = this.gl;
  8089. a.colorMask(!0, !0, !0, !0);
  8090. for (var d = b.RenderFilter.getInstance().getDrawAreaList(), c = 0, h = d.length; c < h; c++) {
  8091. var g = d[c];
  8092. a.viewport(g.x, g.y, g.width, g.height);
  8093. a.bindFramebuffer(a.FRAMEBUFFER, null);
  8094. a.clearColor(0, 0, 0, 0);
  8095. a.clear(a.COLOR_BUFFER_BIT)
  8096. }
  8097. d = b.MainContext.instance.stage;
  8098. a.viewport(0, 0, d.stageWidth, d.stageHeight);
  8099. this.renderCost = 0
  8100. };
  8101. a.prototype.setBlendMode = function(a) {
  8102. a || (a = b.BlendMode.NORMAL);
  8103. if (this.currentBlendMode != a) {
  8104. var d = b.RendererContext.blendModesForGL[a];
  8105. d && (this._draw(), this.gl.blendFunc(d[0], d[1]), this.currentBlendMode = a)
  8106. }
  8107. };
  8108. a.prototype.drawRepeatImage = function(a, d, c, h, g, f, l, n, p, q) {
  8109. q = b.MainContext.instance.rendererContext._texture_scale_factor;
  8110. h *= q;
  8111. for (g *= q; f < n; f += h) for (var r = l; r < p; r += g) {
  8112. var t = Math.min(h, n - f),
  8113. s = Math.min(g, p - r);
  8114. this.drawImage(a, d, c, t / q, s / q, f, r, t, s)
  8115. }
  8116. };
  8117. a.prototype.drawImage = function(a, b, d, c, g, f, l, n, p, q) {
  8118. void 0 === q && (q = void 0);
  8119. if (!this.contextLost) if (void 0 !== q) this.drawRepeatImage(a, b, d, c, g, f, l, n, p, q);
  8120. else {
  8121. this.createWebGLTexture(a);
  8122. q = a._bitmapData.webGLTexture[this.glID];
  8123. if (q !== this.currentBaseTexture || this.currentBatchSize >= this.size - 1) this._draw(),
  8124. this.currentBaseTexture = q;
  8125. var r = this.worldTransform,
  8126. t = r.a,
  8127. s = r.b,
  8128. u = r.c,
  8129. w = r.d,
  8130. v = r.tx,
  8131. y = r.ty;
  8132. 0 == f && 0 == l || r.append(1, 0, 0, 1, f, l);
  8133. 1 == c / n && 1 == g / p || r.append(n / c, 0, 0, p / g, 0, 0);
  8134. f = r.a;
  8135. l = r.b;
  8136. n = r.c;
  8137. p = r.d;
  8138. q = r.tx;
  8139. var x = r.ty;
  8140. r.a = t;
  8141. r.b = s;
  8142. r.c = u;
  8143. r.d = w;
  8144. r.tx = v;
  8145. r.ty = y;
  8146. t = a._sourceWidth;
  8147. s = a._sourceHeight;
  8148. a = c;
  8149. r = g;
  8150. b /= t;
  8151. d /= s;
  8152. c /= t;
  8153. g /= s;
  8154. t = this.vertices;
  8155. s = 4 * this.currentBatchSize * this.vertSize;
  8156. u = this.worldAlpha;
  8157. t[s++] = q;
  8158. t[s++] = x;
  8159. t[s++] = b;
  8160. t[s++] = d;
  8161. t[s++] = u;
  8162. t[s++] = f * a + q;
  8163. t[s++] = l * a + x;
  8164. t[s++] = c + b;
  8165. t[s++] = d;
  8166. t[s++] = u;
  8167. t[s++] = f * a + n * r + q;
  8168. t[s++] = p * r + l * a + x;
  8169. t[s++] = c + b;
  8170. t[s++] = g + d;
  8171. t[s++] = u;
  8172. t[s++] = n * r + q;
  8173. t[s++] = p * r + x;
  8174. t[s++] = b;
  8175. t[s++] = g + d;
  8176. t[s++] = u;
  8177. this.currentBatchSize++
  8178. }
  8179. };
  8180. a.prototype._draw = function() {
  8181. if (0 != this.currentBatchSize && !this.contextLost) {
  8182. var a = b.getTimer();
  8183. this.start();
  8184. var d = this.gl;
  8185. d.bindTexture(d.TEXTURE_2D, this.currentBaseTexture);
  8186. var c = this.vertices.subarray(0, 4 * this.currentBatchSize * this.vertSize);
  8187. d.bufferSubData(d.ARRAY_BUFFER, 0, c);
  8188. d.drawElements(d.TRIANGLES, 6 * this.currentBatchSize, d.UNSIGNED_SHORT, 0);
  8189. this.currentBatchSize = 0;
  8190. this.renderCost += b.getTimer() - a;
  8191. b.Profiler.getInstance().onDrawImage()
  8192. }
  8193. };
  8194. a.prototype.setTransform = function(a) {
  8195. var b = this.worldTransform;
  8196. b.a = a.a;
  8197. b.b = a.b;
  8198. b.c = a.c;
  8199. b.d = a.d;
  8200. b.tx = a.tx;
  8201. b.ty = a.ty
  8202. };
  8203. a.prototype.setAlpha = function(a, b) {
  8204. this.worldAlpha = a;
  8205. this.setBlendMode(b)
  8206. };
  8207. a.prototype.createWebGLTexture = function(a) {
  8208. a = a._bitmapData;
  8209. a.webGLTexture || (a.webGLTexture = {});
  8210. if (!a.webGLTexture[this.glID]) {
  8211. var b = this.gl;
  8212. a.webGLTexture[this.glID] = b.createTexture();
  8213. b.bindTexture(b.TEXTURE_2D, a.webGLTexture[this.glID]);
  8214. b.pixelStorei(b.UNPACK_PREMULTIPLY_ALPHA_WEBGL, !0);
  8215. b.texImage2D(b.TEXTURE_2D, 0, b.RGBA, b.RGBA, b.UNSIGNED_BYTE, a);
  8216. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MAG_FILTER, b.LINEAR);
  8217. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_MIN_FILTER, b.LINEAR);
  8218. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_S, b.CLAMP_TO_EDGE);
  8219. b.texParameteri(b.TEXTURE_2D, b.TEXTURE_WRAP_T, b.CLAMP_TO_EDGE);
  8220. b.bindTexture(b.TEXTURE_2D, null)
  8221. }
  8222. };
  8223. a.prototype.pushMask = function(a) {
  8224. this._draw();
  8225. var b = this.gl;
  8226. 0 == this.maskList.length && b.enable(b.SCISSOR_TEST);
  8227. a = this.getScissorRect(a);
  8228. this.maskList.push(a);
  8229. this.scissor(a.x, a.y, a.width, a.height)
  8230. };
  8231. a.prototype.getScissorRect = function(a) {
  8232. var d = this.maskList[this.maskList.length - 1],
  8233. c,
  8234. h,
  8235. g;
  8236. d ? d.intersects(d) ? (c = Math.max(a.x + this.worldTransform.tx, d.x), h = Math.max(a.y + this.worldTransform.ty, d.y), g = Math.min(a.x + this.worldTransform.tx + a.width, d.x + d.width) - c, a = Math.min(a.y + this.worldTransform.ty + a.height, d.y + d.height) - h) : a = g = h = c = 0 : (c = a.x + this.worldTransform.tx, h = a.y + this.worldTransform.ty, g = a.width, a = a.height); (d = this.maskDataFreeList.pop()) ? (d.x = c, d.y = h, d.width = g, d.height = a) : d = new b.Rectangle(c, h, g, a);
  8237. return d
  8238. };
  8239. a.prototype.popMask = function() {
  8240. this._draw();
  8241. var a = this.gl,
  8242. b = this.maskList.pop();
  8243. this.maskDataFreeList.push(b);
  8244. b = this.maskList.length;
  8245. 0 != b ? (b = this.maskList[b - 1], (0 < b.width || 0 < b.height) && this.scissor(b.x, b.y, b.width, b.height)) : a.disable(a.SCISSOR_TEST)
  8246. };
  8247. a.prototype.scissor = function(a, d, c, h) {
  8248. var g = this.gl;
  8249. 0 > c && (c = 0);
  8250. 0 > h && (h = 0);
  8251. g.scissor(a, -d + b.MainContext.instance.stage.stageHeight - h, c, h)
  8252. };
  8253. a.prototype.setGlobalColorTransform = function(a) {
  8254. if (this.colorTransformMatrix != a && (this._draw(), this.colorTransformMatrix = a)) {
  8255. a = a.concat();
  8256. var b = this.shaderManager.colorTransformShader;
  8257. b.uniforms.colorAdd.value.w = a.splice(19, 1)[0] / 255;
  8258. b.uniforms.colorAdd.value.z = a.splice(14, 1)[0] / 255;
  8259. b.uniforms.colorAdd.value.y = a.splice(9, 1)[0] / 255;
  8260. b.uniforms.colorAdd.value.x = a.splice(4, 1)[0] / 255;
  8261. b.uniforms.matrix.value = a
  8262. }
  8263. };
  8264. a.prototype.setGlobalFilter = function(a) {
  8265. this._draw();
  8266. this.setFilterProperties(a)
  8267. };
  8268. a.prototype.setFilterProperties = function(a) {
  8269. if (a) switch (this.filterType = a.type, a.type) {
  8270. case "blur":
  8271. var b = this.shaderManager.blurShader;
  8272. b.uniforms.blur.value.x = a.blurX;
  8273. b.uniforms.blur.value.y = a.blurY
  8274. } else this.filterType = null
  8275. };
  8276. a.prototype.setupFont = function(a, b) {
  8277. void 0 === b && (b = null);
  8278. this.canvasContext.setupFont(a, b)
  8279. };
  8280. a.prototype.measureText = function(a) {
  8281. return this.canvasContext.measureText(a)
  8282. };
  8283. a.prototype.renderGraphics = function(a) {
  8284. this._draw();
  8285. var b = this.gl,
  8286. d = this.shaderManager.primitiveShader;
  8287. this.graphicsPoints ? (this.graphicsPoints.length = 0, this.graphicsIndices.length = 0) : (this.graphicsPoints = [], this.graphicsIndices = [], this.graphicsBuffer = b.createBuffer(), this.graphicsIndexBuffer = b.createBuffer());
  8288. this.updateGraphics(a);
  8289. this.shaderManager.activateShader(d);
  8290. b.blendFunc(b.ONE, b.ONE_MINUS_SRC_ALPHA);
  8291. b.uniformMatrix3fv(d.translationMatrix, !1, this.worldTransform.toArray(!0));
  8292. b.uniform2f(d.projectionVector, this.projectionX, -this.projectionY);
  8293. b.uniform2f(d.offsetVector, 0, 0);
  8294. b.uniform3fv(d.tintColor, [1, 1, 1]);
  8295. b.uniform1f(d.alpha, this.worldAlpha);
  8296. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  8297. b.vertexAttribPointer(d.aVertexPosition, 2, b.FLOAT, !1, 24, 0);
  8298. b.vertexAttribPointer(d.colorAttribute, 4, b.FLOAT, !1, 24, 8);
  8299. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  8300. b.drawElements(b.TRIANGLE_STRIP, this.graphicsIndices.length, b.UNSIGNED_SHORT, 0);
  8301. this.shaderManager.activateShader(this.shaderManager.defaultShader)
  8302. };
  8303. a.prototype.updateGraphics = function(a) {
  8304. var b = this.gl;
  8305. this.buildRectangle(a);
  8306. b.bindBuffer(b.ARRAY_BUFFER, this.graphicsBuffer);
  8307. b.bufferData(b.ARRAY_BUFFER, new Float32Array(this.graphicsPoints), b.STATIC_DRAW);
  8308. b.bindBuffer(b.ELEMENT_ARRAY_BUFFER, this.graphicsIndexBuffer);
  8309. b.bufferData(b.ELEMENT_ARRAY_BUFFER, new Uint16Array(this.graphicsIndices), b.STATIC_DRAW)
  8310. };
  8311. a.prototype.buildRectangle = function(a) {
  8312. var b = a.x,
  8313. d = a.y,
  8314. c = a.w;
  8315. a = a.h;
  8316. var g = this.graphicsStyle.a,
  8317. f = this.graphicsStyle.r * g,
  8318. l = this.graphicsStyle.g * g,
  8319. n = this.graphicsStyle.b * g,
  8320. p = this.graphicsPoints,
  8321. q = this.graphicsIndices,
  8322. r = p.length / 6;
  8323. p.push(b, d);
  8324. p.push(f, l, n, g);
  8325. p.push(b + c, d);
  8326. p.push(f, l, n, g);
  8327. p.push(b, d + a);
  8328. p.push(f, l, n, g);
  8329. p.push(b + c, d + a);
  8330. p.push(f, l, n, g);
  8331. q.push(r, r, r + 1, r + 2, r + 3, r + 3)
  8332. };
  8333. a.prototype.setGraphicsStyle = function(a, b, d, c) {
  8334. this.graphicsStyle.r = a;
  8335. this.graphicsStyle.g = b;
  8336. this.graphicsStyle.b = d;
  8337. this.graphicsStyle.a = c
  8338. };
  8339. a.glID = 0;
  8340. a.isInit = !1;
  8341. return a
  8342. } (b.RendererContext);
  8343. b.WebGLRenderer = c;
  8344. c.prototype.__class__ = "egret.WebGLRenderer"
  8345. })(egret || (egret = {}));
  8346. var egret_webgl_graphics; (function(b) {
  8347. b.beginFill = function(b, a) {
  8348. void 0 === a && (a = 1);
  8349. this._pushCommand(new c(this._setStyle, this, [(b >> 16) / 255, ((b & 65280) >> 8) / 255, (b & 255) / 255, a]))
  8350. };
  8351. b.drawRect = function(b, a, e, k) {
  8352. this._pushCommand(new c(function(a) {
  8353. this.renderContext.renderGraphics(a)
  8354. },
  8355. this, [{
  8356. x: b,
  8357. y: a,
  8358. w: e,
  8359. h: k
  8360. }]));
  8361. this.checkRect(b, a, e, k)
  8362. };
  8363. b.drawCircle = function(b, a, c) {};
  8364. b.drawRoundRect = function(b, a, c, k, m, h) {};
  8365. b.drawEllipse = function(b, a, c, k) {};
  8366. b.lineStyle = function(b, a, c, k, m, h, g, f) {};
  8367. b.lineTo = function(b, a) {};
  8368. b.curveTo = function(b, a, c, k) {};
  8369. b.moveTo = function(b, a) {};
  8370. b.clear = function() {
  8371. this._maxY = this._maxX = this._minY = this._minX = this.commandQueue.length = 0
  8372. };
  8373. b.endFill = function() {};
  8374. b._pushCommand = function(b) {
  8375. this.commandQueue.push(b)
  8376. };
  8377. b._draw = function(b) {
  8378. var a = this.commandQueue.length;
  8379. if (0 != a) for (this.renderContext = b, b = 0; b < a; b++) {
  8380. var c = this.commandQueue[b];
  8381. c.method.apply(c.thisObject, c.args)
  8382. }
  8383. };
  8384. var c = function() {
  8385. return function(b, a, c) {
  8386. this.method = b;
  8387. this.thisObject = a;
  8388. this.args = c
  8389. }
  8390. } ();
  8391. c.prototype.__class__ = "egret_webgl_graphics.Command";
  8392. b._setStyle = function(b, a, c, k) {
  8393. this.renderContext.setGraphicsStyle(b, a, c, k)
  8394. };
  8395. b.init = function() {
  8396. for (var d in b) egret.Graphics.prototype[d] = b[d]
  8397. }
  8398. })(egret_webgl_graphics || (egret_webgl_graphics = {})); (function(b) {
  8399. var c = function() {
  8400. function d() {}
  8401. d.compileProgram = function(a, c, k) {
  8402. k = d.compileFragmentShader(a, k);
  8403. c = d.compileVertexShader(a, c);
  8404. var m = a.createProgram();
  8405. a.attachShader(m, c);
  8406. a.attachShader(m, k);
  8407. a.linkProgram(m);
  8408. a.getProgramParameter(m, a.LINK_STATUS) || b.Logger.infoWithErrorId(1020);
  8409. return m
  8410. };
  8411. d.compileFragmentShader = function(a, b) {
  8412. return d._compileShader(a, b, a.FRAGMENT_SHADER)
  8413. };
  8414. d.compileVertexShader = function(a, b) {
  8415. return d._compileShader(a, b, a.VERTEX_SHADER)
  8416. };
  8417. d._compileShader = function(a, d, c) {
  8418. c = a.createShader(c);
  8419. a.shaderSource(c, d);
  8420. a.compileShader(c);
  8421. return a.getShaderParameter(c, a.COMPILE_STATUS) ? c: (b.Logger.info(a.getShaderInfoLog(c)), null)
  8422. };
  8423. d.checkCanUseWebGL = function() {
  8424. if (void 0 == d.canUseWebGL) try {
  8425. var a = document.createElement("canvas");
  8426. d.canUseWebGL = !!window.WebGLRenderingContext && !(!a.getContext("webgl") && !a.getContext("experimental-webgl"))
  8427. } catch(b) {
  8428. d.canUseWebGL = !1
  8429. }
  8430. return d.canUseWebGL
  8431. };
  8432. return d
  8433. } ();
  8434. b.WebGLUtils = c;
  8435. c.prototype.__class__ = "egret.WebGLUtils"
  8436. })(egret || (egret = {})); (function(b) {
  8437. var c = function() {
  8438. function d(a) {
  8439. this.defaultVertexSrc = "attribute vec2 aVertexPosition;\nattribute vec2 aTextureCoord;\nattribute vec2 aColor;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nconst vec2 center = vec2(-1.0, 1.0);\nvoid main(void) {\n gl_Position = vec4( ((aVertexPosition + offsetVector) / projectionVector) + center , 0.0, 1.0);\n vTextureCoord = aTextureCoord;\n vColor = vec4(aColor.x, aColor.x, aColor.x, aColor.x);\n}";
  8440. this.program = this.gl = null;
  8441. this.fragmentSrc = "precision lowp float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform sampler2D uSampler;\nvoid main(void) {\ngl_FragColor = texture2D(uSampler, vTextureCoord) * vColor ;\n}";
  8442. this.uniforms = null;
  8443. this.gl = a;
  8444. this.init()
  8445. }
  8446. d.prototype.init = function() {
  8447. var a = this.gl,
  8448. d = b.WebGLUtils.compileProgram(a, this.defaultVertexSrc, this.fragmentSrc);
  8449. a.useProgram(d);
  8450. this.uSampler = a.getUniformLocation(d, "uSampler");
  8451. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  8452. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  8453. this.dimensions = a.getUniformLocation(d, "dimensions");
  8454. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  8455. this.aTextureCoord = a.getAttribLocation(d, "aTextureCoord");
  8456. this.colorAttribute = a.getAttribLocation(d, "aColor"); - 1 === this.colorAttribute && (this.colorAttribute = 2);
  8457. this.attributes = [this.aVertexPosition, this.aTextureCoord, this.colorAttribute];
  8458. for (var c in this.uniforms) this.uniforms[c].uniformLocation = a.getUniformLocation(d, c);
  8459. this.initUniforms();
  8460. this.program = d
  8461. };
  8462. d.prototype.initUniforms = function() {
  8463. if (this.uniforms) {
  8464. var a = this.gl,
  8465. b, d;
  8466. for (d in this.uniforms) {
  8467. b = this.uniforms[d];
  8468. var c = b.type;
  8469. "mat2" === c || "mat3" === c || "mat4" === c ? (b.glMatrix = !0, b.glValueLength = 1, "mat2" === c ? b.glFunc = a.uniformMatrix2fv: "mat3" === c ? b.glFunc = a.uniformMatrix3fv: "mat4" === c && (b.glFunc = a.uniformMatrix4fv)) : (b.glFunc = a["uniform" + c], b.glValueLength = "2f" === c || "2i" === c ? 2 : "3f" === c || "3i" === c ? 3 : "4f" === c || "4i" === c ? 4 : 1)
  8470. }
  8471. }
  8472. };
  8473. d.prototype.syncUniforms = function() {
  8474. if (this.uniforms) {
  8475. var a, b = this.gl,
  8476. d;
  8477. for (d in this.uniforms) a = this.uniforms[d],
  8478. 1 === a.glValueLength ? !0 === a.glMatrix ? a.glFunc.call(b, a.uniformLocation, a.transpose, a.value) : a.glFunc.call(b, a.uniformLocation, a.value) : 2 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y) : 3 === a.glValueLength ? a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z) : 4 === a.glValueLength && a.glFunc.call(b, a.uniformLocation, a.value.x, a.value.y, a.value.z, a.value.w)
  8479. }
  8480. };
  8481. return d
  8482. } ();
  8483. b.EgretShader = c;
  8484. c.prototype.__class__ = "egret.EgretShader"
  8485. })(egret || (egret = {}));
  8486. __extends = this.__extends ||
  8487. function(b, c) {
  8488. function d() {
  8489. this.constructor = b
  8490. }
  8491. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8492. d.prototype = c.prototype;
  8493. b.prototype = new d
  8494. }; (function(b) {
  8495. var c = function(b) {
  8496. function a(a) {
  8497. b.call(this, a);
  8498. this.fragmentSrc = "precision mediump float;\nvarying vec2 vTextureCoord;\nvarying vec4 vColor;\nuniform float invert;\nuniform mat4 matrix;\nuniform vec4 colorAdd;\nuniform sampler2D uSampler;\nvoid main(void) {\nvec4 locColor = texture2D(uSampler, vTextureCoord) * matrix;\nif(locColor.a != 0.0){\nlocColor += colorAdd;\n}\ngl_FragColor = locColor;\n}";
  8499. this.uniforms = {
  8500. matrix: {
  8501. type: "mat4",
  8502. value: [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1]
  8503. },
  8504. colorAdd: {
  8505. type: "4f",
  8506. value: {
  8507. x: 0,
  8508. y: 0,
  8509. z: 0,
  8510. w: 0
  8511. }
  8512. }
  8513. };
  8514. this.init()
  8515. }
  8516. __extends(a, b);
  8517. return a
  8518. } (b.EgretShader);
  8519. b.ColorTransformShader = c;
  8520. c.prototype.__class__ = "egret.ColorTransformShader"
  8521. })(egret || (egret = {}));
  8522. __extends = this.__extends ||
  8523. function(b, c) {
  8524. function d() {
  8525. this.constructor = b
  8526. }
  8527. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8528. d.prototype = c.prototype;
  8529. b.prototype = new d
  8530. }; (function(b) {
  8531. var c = function(b) {
  8532. function a(a) {
  8533. b.call(this, a);
  8534. this.fragmentSrc = "precision mediump float;uniform vec2 blur;uniform sampler2D uSampler;varying vec2 vTextureCoord;void main(){gl_FragColor = vec4(0.0);gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.028 * blur.x, -0.028 * blur.y))) * 0.0044299121055113265;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.024 * blur.x, -0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.020 * blur.x, -0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.016 * blur.x, -0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.012 * blur.x, -0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.008 * blur.x, -0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2(-0.004 * blur.x, -0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, vTextureCoord) * 0.159576912161;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.004 * blur.x, 0.004 * blur.y))) * 0.147308056121;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.008 * blur.x, 0.008 * blur.y))) * 0.115876621105;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.012 * blur.x, 0.012 * blur.y))) * 0.0776744219933;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.016 * blur.x, 0.016 * blur.y))) * 0.0443683338718;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.020 * blur.x, 0.020 * blur.y))) * 0.0215963866053;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.024 * blur.x, 0.024 * blur.y))) * 0.00895781211794;gl_FragColor += texture2D(uSampler, (vTextureCoord + vec2( 0.028 * blur.x, 0.028 * blur.y))) * 0.0044299121055113265;}";
  8535. this.uniforms = {
  8536. blur: {
  8537. type: "2f",
  8538. value: {
  8539. x: 2,
  8540. y: 2
  8541. }
  8542. }
  8543. };
  8544. this.init()
  8545. }
  8546. __extends(a, b);
  8547. return a
  8548. } (b.EgretShader);
  8549. b.BlurShader = c;
  8550. c.prototype.__class__ = "egret.BlurShader"
  8551. })(egret || (egret = {})); (function(b) {
  8552. var c = function() {
  8553. function d(a) {
  8554. this.alpha = this.translationMatrix = this.attributes = this.colorAttribute = this.aVertexPosition = this.tintColor = this.offsetVector = this.projectionVector = this.program = this.gl = null;
  8555. this.fragmentSrc = "precision mediump float;\nvarying vec4 vColor;\nvoid main(void) {\n gl_FragColor = vColor;\n}";
  8556. this.vertexSrc = "attribute vec2 aVertexPosition;\nattribute vec4 aColor;\nuniform mat3 translationMatrix;\nuniform vec2 projectionVector;\nuniform vec2 offsetVector;\nuniform float alpha;\nuniform vec3 tint;\nvarying vec4 vColor;\nvoid main(void) {\n vec3 v = translationMatrix * vec3(aVertexPosition , 1.0);\n v -= offsetVector.xyx;\n gl_Position = vec4( v.x / projectionVector.x -1.0, v.y / -projectionVector.y + 1.0 , 0.0, 1.0);\n vColor = aColor * vec4(tint * alpha, alpha);\n}";
  8557. this.gl = a;
  8558. this.init()
  8559. }
  8560. d.prototype.init = function() {
  8561. var a = this.gl,
  8562. d = b.WebGLUtils.compileProgram(a, this.vertexSrc, this.fragmentSrc);
  8563. a.useProgram(d);
  8564. this.projectionVector = a.getUniformLocation(d, "projectionVector");
  8565. this.offsetVector = a.getUniformLocation(d, "offsetVector");
  8566. this.tintColor = a.getUniformLocation(d, "tint");
  8567. this.aVertexPosition = a.getAttribLocation(d, "aVertexPosition");
  8568. this.colorAttribute = a.getAttribLocation(d, "aColor");
  8569. this.attributes = [this.aVertexPosition, this.colorAttribute];
  8570. this.translationMatrix = a.getUniformLocation(d, "translationMatrix");
  8571. this.alpha = a.getUniformLocation(d, "alpha");
  8572. this.program = d
  8573. };
  8574. return d
  8575. } ();
  8576. b.PrimitiveShader = c;
  8577. c.prototype.__class__ = "egret.PrimitiveShader"
  8578. })(egret || (egret = {})); (function(b) {
  8579. var c = function() {
  8580. function d(a) {
  8581. this.gl = null;
  8582. this.maxAttibs = 10;
  8583. this.attribState = [];
  8584. this.tempAttribState = [];
  8585. this.blurShader = this.colorTransformShader = this.primitiveShader = this.defaultShader = this.currentShader = null;
  8586. for (var b = 0; b < this.maxAttibs; b++) this.attribState[b] = !1;
  8587. this.setContext(a)
  8588. }
  8589. d.prototype.setContext = function(a) {
  8590. this.gl = a;
  8591. this.primitiveShader = new b.PrimitiveShader(a);
  8592. this.defaultShader = new b.EgretShader(a);
  8593. this.colorTransformShader = new b.ColorTransformShader(a);
  8594. this.blurShader = new b.BlurShader(a);
  8595. this.activateShader(this.defaultShader)
  8596. };
  8597. d.prototype.activateShader = function(a) {
  8598. this.currentShader != a && (this.gl.useProgram(a.program), this.setAttribs(a.attributes), this.currentShader = a)
  8599. };
  8600. d.prototype.setAttribs = function(a) {
  8601. var b, d;
  8602. d = this.tempAttribState.length;
  8603. for (b = 0; b < d; b++) this.tempAttribState[b] = !1;
  8604. d = a.length;
  8605. for (b = 0; b < d; b++) this.tempAttribState[a[b]] = !0;
  8606. a = this.gl;
  8607. d = this.attribState.length;
  8608. for (b = 0; b < d; b++) this.attribState[b] !== this.tempAttribState[b] && (this.attribState[b] = this.tempAttribState[b], this.tempAttribState[b] ? a.enableVertexAttribArray(b) : a.disableVertexAttribArray(b))
  8609. };
  8610. return d
  8611. } ();
  8612. b.WebGLShaderManager = c;
  8613. c.prototype.__class__ = "egret.WebGLShaderManager"
  8614. })(egret || (egret = {}));
  8615. __extends = this.__extends ||
  8616. function(b, c) {
  8617. function d() {
  8618. this.constructor = b
  8619. }
  8620. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8621. d.prototype = c.prototype;
  8622. b.prototype = new d
  8623. }; (function(b) {
  8624. var c = function(d) {
  8625. function a() {
  8626. d.call(this)
  8627. }
  8628. __extends(a, d);
  8629. a.prototype.proceed = function(a) {
  8630. function d() {
  8631. if (4 == h.readyState) if (h.status != a._status && (a._status = h.status, b.HTTPStatusEvent.dispatchHTTPStatusEvent(a, h.status)), 400 <= h.status || 0 == h.status) b.IOErrorEvent.dispatchIOErrorEvent(a);
  8632. else {
  8633. switch (a.dataFormat) {
  8634. case b.URLLoaderDataFormat.TEXT:
  8635. a.data = h.responseText;
  8636. break;
  8637. case b.URLLoaderDataFormat.VARIABLES:
  8638. a.data = new b.URLVariables(h.responseText);
  8639. break;
  8640. case b.URLLoaderDataFormat.BINARY:
  8641. a.data = h.response;
  8642. break;
  8643. default:
  8644. a.data = h.responseText
  8645. }
  8646. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  8647. }
  8648. }
  8649. if (a.dataFormat == b.URLLoaderDataFormat.TEXTURE) this.loadTexture(a);
  8650. else if (a.dataFormat == b.URLLoaderDataFormat.SOUND) this.loadSound(a);
  8651. else {
  8652. var c = a._request,
  8653. h = this.getXHR();
  8654. h.onreadystatechange = d;
  8655. var g = b.NetContext._getUrl(c);
  8656. h.open(c.method, g, !0);
  8657. this.setResponseType(h, a.dataFormat);
  8658. c.method != b.URLRequestMethod.GET && c.data ? c.data instanceof b.URLVariables ? (h.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"), h.send(c.data.toString())) : (h.setRequestHeader("Content-Type", "multipart/form-data"), h.send(c.data)) : h.send()
  8659. }
  8660. };
  8661. a.prototype.loadSound = function(a) {
  8662. function d(g) {
  8663. b.clearTimeout(h.__timeoutId);
  8664. h.removeEventListener("canplaythrough", d, !1);
  8665. h.removeEventListener("error", c, !1);
  8666. g = new b.Sound;
  8667. g._setAudio(h);
  8668. a.data = g;
  8669. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  8670. }
  8671. function c(g) {
  8672. b.clearTimeout(h.__timeoutId);
  8673. h.removeEventListener("canplaythrough", d, !1);
  8674. h.removeEventListener("error", c, !1);
  8675. b.IOErrorEvent.dispatchIOErrorEvent(a)
  8676. }
  8677. var h = new Audio(a._request.url);
  8678. h.__timeoutId = b.setTimeout(d, this, 100);
  8679. h.addEventListener("canplaythrough", d, !1);
  8680. h.addEventListener("error", c, !1);
  8681. h.load()
  8682. };
  8683. a.prototype.getXHR = function() {
  8684. return window.XMLHttpRequest ? new window.XMLHttpRequest: new ActiveXObject("MSXML2.XMLHTTP")
  8685. };
  8686. a.prototype.setResponseType = function(a, d) {
  8687. switch (d) {
  8688. case b.URLLoaderDataFormat.TEXT:
  8689. case b.URLLoaderDataFormat.VARIABLES:
  8690. a.responseType = b.URLLoaderDataFormat.TEXT;
  8691. break;
  8692. case b.URLLoaderDataFormat.BINARY:
  8693. a.responseType = "arraybuffer";
  8694. break;
  8695. default:
  8696. a.responseType = d
  8697. }
  8698. };
  8699. a.prototype.loadTexture = function(a) {
  8700. var d = a._request,
  8701. c = new Image;
  8702. c.onload = function(d) {
  8703. c.onerror = null;
  8704. c.onload = null;
  8705. d = new b.Texture;
  8706. d._setBitmapData(c);
  8707. a.data = d;
  8708. b.__callAsync(b.Event.dispatchEvent, b.Event, a, b.Event.COMPLETE)
  8709. };
  8710. c.onerror = function(d) {
  8711. c.onerror = null;
  8712. c.onload = null;
  8713. b.IOErrorEvent.dispatchIOErrorEvent(a)
  8714. };
  8715. c.src = d.url
  8716. };
  8717. return a
  8718. } (b.NetContext);
  8719. b.HTML5NetContext = c;
  8720. c.prototype.__class__ = "egret.HTML5NetContext"
  8721. })(egret || (egret = {}));
  8722. __extends = this.__extends ||
  8723. function(b, c) {
  8724. function d() {
  8725. this.constructor = b
  8726. }
  8727. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8728. d.prototype = c.prototype;
  8729. b.prototype = new d
  8730. }; (function(b) {
  8731. var c = function(d) {
  8732. function a() {
  8733. d.call(this);
  8734. this._isTouchDown = !1;
  8735. this.rootDiv = null;
  8736. this.rootDiv = document.getElementById(b.StageDelegate.canvas_div_name)
  8737. }
  8738. __extends(a, d);
  8739. a.prototype.prevent = function(a) {
  8740. a.stopPropagation(); ! 0 != a.isScroll && a.preventDefault()
  8741. };
  8742. a.prototype.run = function() {
  8743. var a = this;
  8744. window.navigator.msPointerEnabled ? (this.rootDiv.addEventListener("MSPointerDown",
  8745. function(b) {
  8746. a._onTouchBegin(b);
  8747. a.prevent(b)
  8748. },
  8749. !1), this.rootDiv.addEventListener("MSPointerMove",
  8750. function(b) {
  8751. a._onTouchMove(b);
  8752. a.prevent(b)
  8753. },
  8754. !1), this.rootDiv.addEventListener("MSPointerUp",
  8755. function(b) {
  8756. a._onTouchEnd(b);
  8757. a.prevent(b)
  8758. },
  8759. !1)) : b.MainContext.deviceType == b.MainContext.DEVICE_MOBILE ? this.addTouchListener() : b.MainContext.deviceType == b.MainContext.DEVICE_PC && (this.addTouchListener(), this.addMouseListener());
  8760. window.addEventListener("mousedown",
  8761. function(b) {
  8762. a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._isTouchDown = !0
  8763. });
  8764. window.addEventListener("mouseup",
  8765. function(b) {
  8766. a._isTouchDown && (a.inOutOfCanvas(b) ? a.dispatchLeaveStageEvent() : a._onTouchEnd(b));
  8767. a._isTouchDown = !1
  8768. })
  8769. };
  8770. a.prototype.addMouseListener = function() {
  8771. var a = this;
  8772. this.rootDiv.addEventListener("mousedown",
  8773. function(b) {
  8774. a._onTouchBegin(b)
  8775. });
  8776. this.rootDiv.addEventListener("mousemove",
  8777. function(b) {
  8778. a._onTouchMove(b)
  8779. });
  8780. this.rootDiv.addEventListener("mouseup",
  8781. function(b) {
  8782. a._onTouchEnd(b)
  8783. })
  8784. };
  8785. a.prototype.addTouchListener = function() {
  8786. var a = this;
  8787. this.rootDiv.addEventListener("touchstart",
  8788. function(b) {
  8789. for (var d = b.changedTouches.length,
  8790. c = 0; c < d; c++) a._onTouchBegin(b.changedTouches[c]);
  8791. a.prevent(b)
  8792. },
  8793. !1);
  8794. this.rootDiv.addEventListener("touchmove",
  8795. function(b) {
  8796. for (var d = b.changedTouches.length,
  8797. c = 0; c < d; c++) a._onTouchMove(b.changedTouches[c]);
  8798. a.prevent(b)
  8799. },
  8800. !1);
  8801. this.rootDiv.addEventListener("touchend",
  8802. function(b) {
  8803. for (var d = b.changedTouches.length,
  8804. c = 0; c < d; c++) a._onTouchEnd(b.changedTouches[c]);
  8805. a.prevent(b)
  8806. },
  8807. !1);
  8808. this.rootDiv.addEventListener("touchcancel",
  8809. function(b) {
  8810. for (var d = b.changedTouches.length,
  8811. c = 0; c < d; c++) a._onTouchEnd(b.changedTouches[c]);
  8812. a.prevent(b)
  8813. },
  8814. !1)
  8815. };
  8816. a.prototype.inOutOfCanvas = function(a) {
  8817. var d = this.getLocation(this.rootDiv, a);
  8818. a = d.x;
  8819. var d = d.y,
  8820. c = b.MainContext.instance.stage;
  8821. return 0 > a || 0 > d || a > c.stageWidth || d > c.stageHeight ? !0 : !1
  8822. };
  8823. a.prototype.dispatchLeaveStageEvent = function() {
  8824. this.touchingIdentifiers.length = 0;
  8825. b.MainContext.instance.stage.dispatchEventWith(b.Event.LEAVE_STAGE)
  8826. };
  8827. a.prototype._onTouchBegin = function(a) {
  8828. var b = this.getLocation(this.rootDiv, a),
  8829. d = -1;
  8830. a.hasOwnProperty("identifier") && (d = a.identifier);
  8831. this.onTouchBegan(b.x, b.y, d)
  8832. };
  8833. a.prototype._onTouchMove = function(a) {
  8834. var b = this.getLocation(this.rootDiv, a),
  8835. d = -1;
  8836. a.hasOwnProperty("identifier") && (d = a.identifier);
  8837. this.onTouchMove(b.x, b.y, d)
  8838. };
  8839. a.prototype._onTouchEnd = function(a) {
  8840. var b = this.getLocation(this.rootDiv, a),
  8841. d = -1;
  8842. a.hasOwnProperty("identifier") && (d = a.identifier);
  8843. this.onTouchEnd(b.x, b.y, d)
  8844. };
  8845. a.prototype.getLocation = function(a, d) {
  8846. var c = document.documentElement,
  8847. h = window,
  8848. g, f;
  8849. "function" === typeof a.getBoundingClientRect ? (f = a.getBoundingClientRect(), g = f.left, f = f.top) : f = g = 0;
  8850. g += h.pageXOffset - c.clientLeft;
  8851. f += h.pageYOffset - c.clientTop;
  8852. null != d.pageX ? (c = d.pageX, h = d.pageY) : (g -= document.body.scrollLeft, f -= document.body.scrollTop, c = d.clientX, h = d.clientY);
  8853. var l = b.Point.identity;
  8854. l.x = (c - g) / b.StageDelegate.getInstance().getScaleX();
  8855. l.y = (h - f) / b.StageDelegate.getInstance().getScaleY();
  8856. return l
  8857. };
  8858. return a
  8859. } (b.TouchContext);
  8860. b.HTML5TouchContext = c;
  8861. c.prototype.__class__ = "egret.HTML5TouchContext"
  8862. })(egret || (egret = {}));
  8863. __extends = this.__extends ||
  8864. function(b, c) {
  8865. function d() {
  8866. this.constructor = b
  8867. }
  8868. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  8869. d.prototype = c.prototype;
  8870. b.prototype = new d
  8871. }; (function(b) {
  8872. var c = function(d) {
  8873. function a() {
  8874. d.call(this);
  8875. this.inputElement = this.div = null;
  8876. this._hasListeners = !1;
  8877. this._inputType = "";
  8878. this._isShow = !1;
  8879. this.textValue = "";
  8880. this._height = this._width = 0;
  8881. this._styleInfoes = {};
  8882. var a = b.StageDelegate.getInstance().getScaleX(),
  8883. c = b.StageDelegate.getInstance().getScaleY(),
  8884. m = b.Browser.getInstance().$new("div");
  8885. m.position.x = 0;
  8886. m.position.y = 0;
  8887. m.scale.x = a;
  8888. m.scale.y = c;
  8889. m.transforms();
  8890. m.style[egret_dom.getTrans("transformOrigin")] = "0% 0% 0px";
  8891. this.div = m;
  8892. c = b.MainContext.instance.stage;
  8893. a = c.stageWidth;
  8894. c = c.stageHeight;
  8895. m = new b.Shape;
  8896. m.width = a;
  8897. m.height = c;
  8898. m.touchEnabled = !0;
  8899. this._shape = m;
  8900. this.getStageDelegateDiv().appendChild(this.div)
  8901. }
  8902. __extends(a, d);
  8903. a.prototype.getStageDelegateDiv = function() {
  8904. var a = b.Browser.getInstance().$("#StageDelegateDiv");
  8905. a || (a = b.Browser.getInstance().$new("div"), a.id = "StageDelegateDiv", document.getElementById(b.StageDelegate.canvas_div_name).appendChild(a), a.transforms());
  8906. return a
  8907. };
  8908. a.prototype._setMultiline = function(a) {
  8909. d.prototype._setMultiline.call(this, a);
  8910. this.createInput()
  8911. };
  8912. a.prototype.callHandler = function(a) {
  8913. a.stopPropagation()
  8914. };
  8915. a.prototype._add = function() {
  8916. this.div && null == this.div.parentNode && this.getStageDelegateDiv().appendChild(this.div)
  8917. };
  8918. a.prototype._remove = function() {
  8919. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape);
  8920. this.div && this.div.parentNode && this.div.parentNode.removeChild(this.div)
  8921. };
  8922. a.prototype._addListeners = function() {
  8923. this.inputElement && !this._hasListeners && (this._hasListeners = !0, this.inputElement.addEventListener("mousedown", this.callHandler), this.inputElement.addEventListener("touchstart", this.callHandler), this.inputElement.addEventListener("MSPointerDown", this.callHandler))
  8924. };
  8925. a.prototype._removeListeners = function() {
  8926. this.inputElement && this._hasListeners && (this._hasListeners = !1, this.inputElement.removeEventListener("mousedown", this.callHandler), this.inputElement.removeEventListener("touchstart", this.callHandler), this.inputElement.removeEventListener("MSPointerDown", this.callHandler))
  8927. };
  8928. a.prototype.createInput = function() {
  8929. var a = this._multiline ? "textarea": "input";
  8930. this._inputType != a && (this._inputType = a, null != this.inputElement && (this._removeListeners(), this.div.removeChild(this.inputElement)), this._multiline ? (a = document.createElement("textarea"), a.style.resize = "none") : a = document.createElement("input"), this._styleInfoes = {},
  8931. a.type = "text", this.inputElement = a, this.inputElement.value = "", this.div.appendChild(a), this._addListeners(), this.setElementStyle("width", "0px"), this.setElementStyle("border", "none"), this.setElementStyle("margin", "0"), this.setElementStyle("padding", "0"), this.setElementStyle("outline", "medium"), this.setElementStyle("verticalAlign", "top"), this.setElementStyle("wordBreak", "break-all"), this.setElementStyle("overflow", "hidden"))
  8932. };
  8933. a.prototype._open = function(a, b, d, c) {};
  8934. a.prototype._setScale = function(a, c) {
  8935. d.prototype._setScale.call(this, a, c);
  8936. var m = b.StageDelegate.getInstance().getScaleX(),
  8937. h = b.StageDelegate.getInstance().getScaleY();
  8938. this.div.scale.x = m * a;
  8939. this.div.scale.y = h * c;
  8940. this.div.transforms()
  8941. };
  8942. a.prototype.changePosition = function(a, d) {
  8943. var c = b.StageDelegate.getInstance().getScaleX(),
  8944. h = b.StageDelegate.getInstance().getScaleY();
  8945. this.div.position.x = a * c;
  8946. this.div.position.y = d * h;
  8947. this.div.transforms()
  8948. };
  8949. a.prototype.setStyles = function() {
  8950. this.setElementStyle("fontStyle", this._italic ? "italic": "normal");
  8951. this.setElementStyle("fontWeight", this._bold ? "bold": "normal");
  8952. this.setElementStyle("textAlign", this._textAlign);
  8953. this.setElementStyle("fontSize", this._size + "px");
  8954. this.setElementStyle("color", "#000000");
  8955. this.setElementStyle("width", this._width + "px");
  8956. this.setElementStyle("height", this._height + "px");
  8957. this.setElementStyle("display", "block")
  8958. };
  8959. a.prototype._show = function() {
  8960. b.MainContext.instance.stage._changeSizeDispatchFlag = !1;
  8961. 0 < this._maxChars ? this.inputElement.setAttribute("maxlength", this._maxChars) : this.inputElement.removeAttribute("maxlength");
  8962. this._isShow = !0;
  8963. var a = this._getText();
  8964. this.inputElement.value = a;
  8965. var d = this;
  8966. this.inputElement.oninput = function() {
  8967. d.textValue = d.inputElement.value;
  8968. d.dispatchEvent(new b.Event("updateText"))
  8969. };
  8970. this.setStyles();
  8971. this.inputElement.focus();
  8972. this.inputElement.selectionStart = a.length;
  8973. this.inputElement.selectionEnd = a.length;
  8974. this._shape && null == this._shape.parent && b.MainContext.instance.stage.addChild(this._shape)
  8975. };
  8976. a.prototype._hide = function() {
  8977. b.MainContext.instance.stage._changeSizeDispatchFlag = !0;
  8978. if (null != this.inputElement) {
  8979. this._isShow = !1;
  8980. this.inputElement.oninput = function() {};
  8981. this.setElementStyle("border", "none");
  8982. this.setElementStyle("display", "none");
  8983. this.inputElement.value = "";
  8984. this.setElementStyle("width", "0px");
  8985. window.scrollTo(0, 0);
  8986. var a = this;
  8987. b.setTimeout(function() {
  8988. a.inputElement.blur();
  8989. window.scrollTo(0, 0)
  8990. },
  8991. this, 50);
  8992. this._shape && this._shape.parent && this._shape.parent.removeChild(this._shape)
  8993. }
  8994. };
  8995. a.prototype._getText = function() {
  8996. this.textValue || (this.textValue = "");
  8997. return this.textValue
  8998. };
  8999. a.prototype._setText = function(a) {
  9000. this.textValue = a;
  9001. this.resetText()
  9002. };
  9003. a.prototype.resetText = function() {
  9004. this.inputElement && (this.inputElement.value = this.textValue)
  9005. };
  9006. a.prototype._setWidth = function(a) {
  9007. this._width = a
  9008. };
  9009. a.prototype._setHeight = function(a) {
  9010. this._height = a
  9011. };
  9012. a.prototype.setElementStyle = function(a, b) {
  9013. this.inputElement && this._styleInfoes[a] != b && (this.inputElement.style[a] = b, this._styleInfoes[a] = b)
  9014. };
  9015. return a
  9016. } (b.StageText);
  9017. b.HTML5StageText = c;
  9018. c.prototype.__class__ = "egret.HTML5StageText"
  9019. })(egret || (egret = {}));
  9020. egret.StageText.create = function() {
  9021. return new egret.HTML5StageText
  9022. };
  9023. var __extends = this.__extends ||
  9024. function(b, c) {
  9025. function d() {
  9026. this.constructor = b
  9027. }
  9028. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9029. d.prototype = c.prototype;
  9030. b.prototype = new d
  9031. },
  9032. Panel = function(b) {
  9033. function c() {
  9034. b.call(this);
  9035. lowResolution && (this.bg.scaleX = this.bg.scaleY = 2);
  9036. this.scaleY = this.scaleX = sizeOffset;
  9037. this.x = centerX;
  9038. this.y = centerY;
  9039. this.bg = new egret.Bitmap;
  9040. this.bg.anchorX = this.bg.anchorY = 0.5;
  9041. this.bg.scaleX = sizeOffsetW / sizeOffset
  9042. }
  9043. __extends(c, b);
  9044. c.prototype.setAnchor = function() {
  9045. for (var b = 0; b < this.numChildren; b++) this.getChildAt(b).anchorX = this.getChildAt(b).anchorY = 0.5
  9046. };
  9047. c.prototype.blackField = function() {
  9048. this.stage.addChild(this.blackScreen);
  9049. this.blackScreen.alpha = 0;
  9050. egret.Tween.get(this.blackScreen).to({
  9051. alpha: 1
  9052. },
  9053. 200).wait(200).to({
  9054. alpha: 0
  9055. },
  9056. 200).call(function() {
  9057. egret.Tween.removeAllTweens()
  9058. },
  9059. this)
  9060. };
  9061. c.prototype.whiteField = function() {
  9062. var b = this;
  9063. this.alpha = 0;
  9064. egret.Tween.get(this).wait(200).call(function() {
  9065. b.alpha = 1
  9066. },
  9067. this)
  9068. };
  9069. return c
  9070. } (egret.DisplayObjectContainer);
  9071. Panel.prototype.__class__ = "Panel";
  9072. var __extends = this.__extends ||
  9073. function(b, c) {
  9074. function d() {
  9075. this.constructor = b
  9076. }
  9077. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9078. d.prototype = c.prototype;
  9079. b.prototype = new d
  9080. },
  9081. MyButton = function(b) {
  9082. function c(d) {
  9083. b.call(this);
  9084. this.bg = new egret.Bitmap(d);
  9085. this.addChild(this.bg);
  9086. this.touchEnabled = !0;
  9087. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onPressStart, this)
  9088. }
  9089. __extends(c, b);
  9090. c.prototype.onPressStart = function() {
  9091. egret.Tween.get(this).to({
  9092. scaleX: 0.8,
  9093. scaleY: 0.8
  9094. },
  9095. 50).to({
  9096. scaleX: 1,
  9097. scaleY: 1
  9098. },
  9099. 50)
  9100. };
  9101. c.prototype.onPressEnd = function() {
  9102. egret.Tween.get(this).to({
  9103. scaleX: 1,
  9104. scaleY: 1
  9105. },
  9106. 50)
  9107. };
  9108. return c
  9109. } (egret.DisplayObjectContainer);
  9110. MyButton.prototype.__class__ = "MyButton";
  9111. var __extends = this.__extends ||
  9112. function(b, c) {
  9113. function d() {
  9114. this.constructor = b
  9115. }
  9116. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9117. d.prototype = c.prototype;
  9118. b.prototype = new d
  9119. },
  9120. GamePanel = function(b) {
  9121. function c() {
  9122. b.call(this);
  9123. this.frame = 1;
  9124. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.reset, this);
  9125. test = this;
  9126. levelSteps = RES.getRes("levels").step;
  9127. this.bg.texture = RES.getRes("game-bg");
  9128. this.intro = new egret.Bitmap(RES.getRes("game-intro"));
  9129. this.introText = new egret.Bitmap;
  9130. this.levelLabel = new MyText(RES.getRes("game-level-label"));
  9131. this.step = new MyText(RES.getRes("game-step"));
  9132. this.levelBtn = new MyButton(RES.getRes("game-level-button"));
  9133. this.replayBtn = new MyButton(RES.getRes("game-replay"));
  9134. this.gridBoard = new GridBoard;
  9135. this.addChild(this.bg);
  9136. this.addChild(this.step);
  9137. this.addChild(this.levelLabel);
  9138. this.addChild(this.levelBtn);
  9139. this.addChild(this.replayBtn);
  9140. this.addChild(this.gridBoard);
  9141. this.setAnchor();
  9142. this.setLayout();
  9143. this.setListener();
  9144. this.updateLabel()
  9145. }
  9146. __extends(c, b);
  9147. c.prototype.setLayout = function() {
  9148. this.levelBtn.x = -240;
  9149. this.levelBtn.y = -450;
  9150. this.replayBtn.x = 240;
  9151. this.replayBtn.y = -450;
  9152. this.step.anchorX = this.step.anchorY = 0;
  9153. this.step.y = -450;
  9154. this.step.setTextSize(80);
  9155. this.step.setPosOffset(0, -15);
  9156. this.levelLabel.x = -110;
  9157. this.levelLabel.y = -400;
  9158. this.levelLabel.setPosOffset(60);
  9159. this.levelLabel.setTextSize(50);
  9160. this.gridBoard.anchorX = this.gridBoard.anchorY = 0.5;
  9161. this.gridBoard.y = 100;
  9162. this.introText.anchorX = this.introText.anchorY = 0.5;
  9163. this.introText.y = 400
  9164. };
  9165. c.prototype.setListener = function() {
  9166. var b = this;
  9167. this.levelBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9168. function() {
  9169. sendEvent("level", b)
  9170. },
  9171. this);
  9172. this.replayBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9173. function() {
  9174. sendEvent("replay", b)
  9175. },
  9176. this);
  9177. this.gridBoard.addEventListener("move", this.update, this);
  9178. this.addEventListener("over",
  9179. function() {
  9180. b.gridBoard.timer.stop()
  9181. },
  9182. this);
  9183. this.addEventListener("passed",
  9184. function() {
  9185. b.gridBoard.timer.stop()
  9186. },
  9187. this)
  9188. };
  9189. c.prototype.reset = function() {
  9190. steps = levelSteps[currentLevel - 1];
  9191. this.updateLabel();
  9192. this.gridBoard.reset();
  9193. safeRemove(this.intro);
  9194. safeRemove(this.introText);
  9195. 1 == currentLevel && (this.frame = 1, this.addChild(this.intro), this.addChild(this.introText), this.playIntro(this.frame))
  9196. };
  9197. c.prototype.update = function() {
  9198. 1 == currentLevel && this.playIntro(++this.frame);
  9199. this.gridBoard.update();
  9200. steps--;
  9201. this.updateLabel();
  9202. this.gridBoard.judge() ? (this.gridBoard.disableTouch(), sendEvent("passed", this), console.log("passed"),console.log(currentLevel)) : 0 >= steps && (this.gridBoard.disableTouch(), sendEvent("over", this))
  9203. };
  9204. c.prototype.updateLabel = function() {
  9205. this.step.setText("" + steps);
  9206. this.levelLabel.setText("" + currentLevel)
  9207. };
  9208. c.prototype.playIntro = function(b) {
  9209. egret.Tween.removeTweens(this.intro);
  9210. var a = egret.Tween.get(this.intro, {
  9211. loop: !0
  9212. });
  9213. switch (b) {
  9214. case 1:
  9215. this.intro.y = 200;
  9216. this.intro.x = 0;
  9217. a.to({
  9218. y: -50
  9219. },
  9220. 1E3, egret.Ease.sineOut);
  9221. this.introText.texture = RES.getRes("game-intro-text1");
  9222. break;
  9223. case 2:
  9224. this.intro.y = 200;
  9225. this.intro.x = 200;
  9226. a.to({
  9227. x: -200
  9228. },
  9229. 1E3, egret.Ease.sineOut);
  9230. this.introText.texture = RES.getRes("game-intro-text2");
  9231. break;
  9232. case 3:
  9233. this.intro.y = 200;
  9234. this.intro.x = 0;
  9235. a.to({
  9236. x: -200
  9237. },
  9238. 1E3, egret.Ease.sineOut);
  9239. this.introText.texture = RES.getRes("game-intro-text3");
  9240. break;
  9241. default:
  9242. safeRemove(this.intro),
  9243. safeRemove(this.introText)
  9244. }
  9245. };
  9246. return c
  9247. } (Panel);
  9248. GamePanel.prototype.__class__ = "GamePanel";
  9249. var __extends = this.__extends ||
  9250. function(b, c) {
  9251. function d() {
  9252. this.constructor = b
  9253. }
  9254. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9255. d.prototype = c.prototype;
  9256. b.prototype = new d
  9257. },
  9258. GameOverPanel; (function(b) {
  9259. b.SHARE = "share";
  9260. b.REPLAY = "replay";
  9261. b.MORE = "more";
  9262. b.NEXT = "next";
  9263. var c = function(c) {
  9264. function k() {
  9265. c.call(this);
  9266. this.addEventListener(b.REPLAY, this.hide, this);
  9267. this.addEventListener(b.NEXT, this.hide, this);
  9268. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9269. this.addEventListener(b.SHARE, this.displayShareHint, this);
  9270. this.dialog_bg = new egret.Bitmap(RES.getRes("bg"));
  9271. this.shareHint = new a(RES.getRes("shareHint"));
  9272. this.shareBtn = new d(b.SHARE);
  9273. this.replayBtn = new d(b.REPLAY);
  9274. this.moreBtn = new d(b.MORE);
  9275. this.nextBtn = new d(b.NEXT);
  9276. this.scoreText = new egret.BitmapText;
  9277. this.scoreText.spriteSheet = RES.getRes("over_number_fnt");
  9278. this.scoreText.text = "" + score;
  9279. this.bestText = new egret.TextField;
  9280. this.bestText.text = "\u6700\u9ad8 " + bestScore;
  9281. this.bestText.textColor = 7829367;
  9282. this.bestText.size = 28;
  9283. this.bestText.fontFamily = "\u5fae\u8f6f\u96c5\u9ed1";
  9284. this.badgeEffect = new egret.Bitmap(RES.getRes("light"));
  9285. this.badge = new egret.Bitmap(RES.getRes("win"));
  9286. this.setLayout();
  9287. this.addChild(this.dialog_bg);
  9288. this.addChild(this.badgeEffect);
  9289. this.addChild(this.badge);
  9290. // this.addChild(this.scoreText);
  9291. this.setAnchor()
  9292. }
  9293. __extends(k, c);
  9294. k.prototype.onAddToStage = function() {
  9295. var a = this,
  9296. b = this.scaleX = this.scaleY = this.stage.stageHeight / 1136;
  9297. this.x = this.stage.stageWidth / 2;
  9298. var d = this.stage.stageWidth / b,
  9299. c = this.stage.stageHeight / b;
  9300. this.y = 0;
  9301. egret.Tween.get(this).to({
  9302. y: this.stage.stageHeight / 2
  9303. },
  9304. 200).call(function() {
  9305. a.graphics.beginFill(0, 0.5);
  9306. a.graphics.drawRect( - d / 2, -c / 2, d, c);
  9307. a.graphics.endFill();
  9308. var b = parseInt(a.scoreText.text);
  9309. a.scoreTimerHandler(a.currentScore, 1, b)
  9310. },
  9311. this)
  9312. };
  9313. k.prototype.hide = function() {
  9314. var a = this;
  9315. this.graphics.clear();
  9316. egret.Tween.get(this).to({
  9317. y: 0
  9318. },
  9319. 200).call(function() {
  9320. a.parent.removeChild(a);
  9321. safeRemove(a.shareBtn);
  9322. safeRemove(a.nextBtn);
  9323. safeRemove(a.replayBtn);
  9324. safeRemove(a.moreBtn);
  9325. egret.Tween.removeTweens(a.badgeEffect)
  9326. },
  9327. this)
  9328. };
  9329. k.prototype.displayShareHint = function() {
  9330. this.stage.addChild(this.shareHint)
  9331. };
  9332. k.prototype.setAnchor = function() {
  9333. for (var a = 0; a < this.numChildren; a++) this.getChildAt(a).anchorX = this.getChildAt(a).anchorY = 0.5
  9334. };
  9335. k.prototype.setLayout = function() {
  9336. this.scoreText.y = -250;
  9337. this.replayBtn.x = -120;
  9338. this.replayBtn.y = 200;
  9339. this.shareBtn.x =120;
  9340. this.shareBtn.y = 200;
  9341. this.moreBtn.x = 00;
  9342. this.moreBtn.y = 300;
  9343. this.nextBtn.x = 0;
  9344. this.nextBtn.y = 200;
  9345. this.bestText.y = -130
  9346. };
  9347. k.prototype.update = function(a, b, d) {
  9348. var c = this;
  9349. this.setLayout();
  9350. b = egret.Tween.get(this.badgeEffect, {
  9351. loop: !0
  9352. });
  9353. d ? (this.badgeEffect.x = 0, this.badge.texture = RES.getRes("win"), this.badgeEffect.texture = RES.getRes("light"), b.wait(300).call(function() {
  9354. c.badgeEffect.rotation += 45
  9355. },
  9356. this), this.addChild(this.nextBtn)) : (this.badge.texture = RES.getRes("badge-text"), this.badgeEffect.texture = RES.getRes(""), this.addChild(this.replayBtn),this.addChild(this.shareBtn), this.addChild(this.moreBtn));
  9357. this.currentScore = a
  9358. };
  9359. k.prototype.scoreTimerHandler = function(a, b, d) {
  9360. var c = this;
  9361. d < a && (d += b, egret.setTimeout(function() {
  9362. c.scoreTimerHandler(a, b, d)
  9363. },
  9364. this, 100));
  9365. this.scoreText.text = "" + Math.floor(d)
  9366. };
  9367. return k
  9368. } (egret.Sprite);
  9369. b.OverDialog = c;
  9370. c.prototype.__class__ = "GameOverPanel.OverDialog";
  9371. var d = function(a) {
  9372. function d(b) {
  9373. a.call(this, RES.getRes(b));
  9374. this.pressed = !1;
  9375. this.type = this.bitmapKey = b;
  9376. this.touchEnabled = !0;
  9377. this.anchorX = this.anchorY = 0.5;
  9378. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onPressStart, this);
  9379. this.addEventListener(egret.TouchEvent.TOUCH_END, this.onPressEnd, this);
  9380. this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.onPressEnd, this)
  9381. }
  9382. __extends(d, a);
  9383. d.prototype.onPressStart = function() {
  9384. this.pressed = !0;
  9385. this.texture = RES.getRes(this.bitmapKey + "-press")
  9386. };
  9387. d.prototype.onPressEnd = function() {
  9388. if (this.pressed) {
  9389. this.pressed = !1;
  9390. switch (this.type) {
  9391. case b.REPLAY:
  9392. var a = new egret.Event(b.REPLAY);
  9393. this.parent.dispatchEvent(a);
  9394. break;
  9395. case b.NEXT:
  9396. a = new egret.Event(b.NEXT);
  9397. this.parent.dispatchEvent(a);
  9398. break;
  9399. case b.SHARE:
  9400. window.cb_share();
  9401. break;
  9402. case b.MORE:
  9403. Play68.goHome();break;
  9404. }
  9405. this.texture = RES.getRes(this.bitmapKey)
  9406. }
  9407. };
  9408. return d
  9409. } (egret.Bitmap);
  9410. d.prototype.__class__ = "GameOverPanel.OverButton";
  9411. var a = function(a) {
  9412. function b(d) {
  9413. a.call(this);
  9414. this.touchEnabled = !0;
  9415. this.finger = new egret.Bitmap(d);
  9416. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9417. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  9418. }
  9419. __extends(b, a);
  9420. b.prototype.onRemoveFromStage = function() {
  9421. this.removeChildren()
  9422. };
  9423. b.prototype.onAddToStage = function() {
  9424. var a = this.stage.stageWidth,
  9425. b = this.stage.stageHeight,
  9426. d = a / 320,
  9427. c = new egret.Shape;
  9428. c.graphics.clear();
  9429. c.graphics.beginFill(0, 0.5);
  9430. c.graphics.drawRect(0, 0, a, b);
  9431. c.graphics.endFill();
  9432. this.finger.anchorX = 1;
  9433. this.finger.x = a;
  9434. this.finger.scaleX = d;
  9435. this.finger.scaleY = d;
  9436. egret.Tween.get(this.finger, {
  9437. loop: !0
  9438. }).to({
  9439. y: 10
  9440. },
  9441. 100).to({
  9442. y: 0
  9443. },
  9444. 100);
  9445. var e = new egret.TextField;
  9446. e.fontFamily = "\u5fae\u8f6f\u96c5\u9ed1";
  9447. e.size = 18;
  9448. e.textAlign = "center";
  9449. e.text = "\u70b9\u51fb\u53f3\u4e0a\u89d2\u5206\u4eab\u5230\u670b\u53cb\u5708\n\u8ba9\u4f60\u7684\u670b\u53cb\u4eec\u53bb\u6311\u6218\u4f60\u725b\u903c\u7684\u8bb0\u5f55\u5427\uff01";
  9450. e.textColor = 16777215;
  9451. e.width = a;
  9452. e.x = a / 2;
  9453. e.y = b / 2;
  9454. e.anchorX = 0.5;
  9455. e.scaleX = e.scaleY = d;
  9456. this.addChild(c);
  9457. this.addChild(e);
  9458. this.addChild(this.finger);
  9459. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onShare, this)
  9460. };
  9461. b.prototype.onShare = function(a) {
  9462. a.currentTarget.parent && a.currentTarget.parent.removeChild(a.currentTarget);
  9463. console.log("removeShareHint")
  9464. };
  9465. return b
  9466. } (egret.DisplayObjectContainer);
  9467. a.prototype.__class__ = "GameOverPanel.ShareHint"
  9468. })(GameOverPanel || (GameOverPanel = {}));
  9469. var __extends = this.__extends ||
  9470. function(b, c) {
  9471. function d() {
  9472. this.constructor = b
  9473. }
  9474. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9475. d.prototype = c.prototype;
  9476. b.prototype = new d
  9477. },
  9478. neoges; (function(b) {
  9479. var c = function(d) {
  9480. function a(a) {
  9481. void 0 === a && (a = null);
  9482. d.call(this);
  9483. this._useMultiPoints = !1;
  9484. this._stats = -1;
  9485. this._location = new egret.Point;
  9486. this._target = a;
  9487. null != this._target && this.addHostToManager()
  9488. }
  9489. __extends(a, d);
  9490. Object.defineProperty(a.prototype, "target", {
  9491. get: function() {
  9492. return this._target
  9493. },
  9494. set: function(a) {
  9495. this._target != a && (this._stats = -1, null != this._target && this.removeHostFromManager(), this._target = a, null != this._target && this.addHostToManager())
  9496. },
  9497. enumerable: !0,
  9498. configurable: !0
  9499. });
  9500. Object.defineProperty(a.prototype, "location", {
  9501. get: function() {
  9502. return this._location.clone()
  9503. },
  9504. enumerable: !0,
  9505. configurable: !0
  9506. });
  9507. a.prototype.addHostToManager = function() {
  9508. b.GestureManager.addHost(this)
  9509. };
  9510. a.prototype.removeHostFromManager = function() {
  9511. b.GestureManager.removeHost(this)
  9512. };
  9513. a.prototype.onTouch = function(a) {};
  9514. a.prototype.gestureBegan = function() {
  9515. this._stats = 1;
  9516. var a = new b.GestureEvent(b.GestureEvent.BEGAN);
  9517. a.host = this._target;
  9518. this.dispatchEvent(a)
  9519. };
  9520. a.prototype.gestureUpdate = function() {
  9521. this._stats = 2;
  9522. var a = new b.GestureEvent(b.GestureEvent.UPDATE);
  9523. a.host = this._target;
  9524. this.dispatchEvent(a)
  9525. };
  9526. a.prototype.gestureEnded = function() {
  9527. this._stats = 3;
  9528. var a = new b.GestureEvent(b.GestureEvent.ENDED);
  9529. a.host = this._target;
  9530. this.dispatchEvent(a);
  9531. this._stats = -1
  9532. };
  9533. a.prototype.gestureFailed = function() {
  9534. var a = new b.GestureEvent(b.GestureEvent.FAILED);
  9535. a.host = this._target;
  9536. this.dispatchEvent(a);
  9537. this._stats = -1
  9538. };
  9539. a.prototype.subtract = function(a, b) {
  9540. var d = new egret.Point;
  9541. d.x = a.x - b.x;
  9542. d.y = a.y - b.y;
  9543. return d
  9544. };
  9545. a.prototype.getPointLength = function(a) {
  9546. var b = 0,
  9547. b = new egret.Point(0, 0);
  9548. return b = egret.Point.distance(a, b)
  9549. };
  9550. a.prototype.dispose = function() {
  9551. this._stats = -1;
  9552. b.GestureManager.removeHost(this);
  9553. this._target = null
  9554. };
  9555. return a
  9556. } (egret.EventDispatcher);
  9557. b.AbstractGesture = c;
  9558. c.prototype.__class__ = "neoges.AbstractGesture"
  9559. })(neoges || (neoges = {})); (function(b) {
  9560. var c = function() {
  9561. function b() {
  9562. this._collection = []
  9563. }
  9564. b.prototype.clone = function(a) {
  9565. var b = this._collection.pop();
  9566. null == b && (b = new egret.TouchEvent(a.type));
  9567. for (var d in a) b[d] = a[d];
  9568. return b
  9569. };
  9570. b.prototype.setProperties = function(a, b) {
  9571. for (var d in a) b[d] = a[d];
  9572. return b
  9573. };
  9574. b.prototype.reclaim = function(a) { - 1 == this._collection.indexOf(a) && this._collection.push(a)
  9575. };
  9576. b.prototype.reclaimAll = function(a) {
  9577. for (; 0 < a.length;) this.reclaim(a[0]),
  9578. a.shift()
  9579. };
  9580. return b
  9581. } ();
  9582. b.EventPool = c;
  9583. c.prototype.__class__ = "neoges.EventPool"
  9584. })(neoges || (neoges = {})); (function(b) {
  9585. var c = function() {
  9586. function d() {}
  9587. d.addHost = function(a) {
  9588. var d = b.GestureManager.hostCollection; - 1 != d.indexOf(a) ? console.warn("\u4e0d\u8981\u91cd\u590d\u6dfb\u52a0\u624b\u52bf\u5b9e\u4f8b") : (b.GestureManager.registerEvent(a.target), d.push(a), b.GestureManager.eventDict[a.target.hashCode] = [])
  9589. };
  9590. d.removeHost = function(a) {
  9591. var d = b.GestureManager.hostCollection,
  9592. c = d.indexOf(a); - 1 == c ? console.warn("\u4e0d\u5b58\u5728\u8fd9\u4e2a\u5b9e\u4f8b") : (d.slice(c, 1), b.GestureManager.removeEvent(a.target), b.GestureManager.eventDict[a.target.hashCode] = null)
  9593. };
  9594. d.registerEvent = function(a) {
  9595. a.addEventListener(egret.TouchEvent.TOUCH_BEGIN, b.GestureManager.touchedHandler, a)
  9596. };
  9597. d.removeEvent = function(a) {
  9598. a.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, b.GestureManager.touchedHandler, a)
  9599. };
  9600. d.touchedHandler = function(a) {
  9601. var d, c = egret.MainContext.instance.stage;
  9602. a.type == egret.TouchEvent.TOUCH_BEGIN ? (d = a.currentTarget, b.GestureManager.currentTouchObject = d, c.removeEventListener(egret.TouchEvent.TOUCH_MOVE, b.GestureManager.touchedHandler, c), c.addEventListener(egret.TouchEvent.TOUCH_MOVE, b.GestureManager.touchedHandler, c), c.removeEventListener(egret.TouchEvent.TOUCH_END, b.GestureManager.touchedHandler, c), c.addEventListener(egret.TouchEvent.TOUCH_END, b.GestureManager.touchedHandler, c), c.removeEventListener(egret.Event.LEAVE_STAGE, b.GestureManager.leaveStageHandler, c), c.addEventListener(egret.Event.LEAVE_STAGE, b.GestureManager.leaveStageHandler, c)) : d = b.GestureManager.currentTouchObject;
  9603. null == b.GestureManager.eventDict[d.hashCode] && (b.GestureManager.eventDict[d.hashCode] = []);
  9604. var c = b.GestureManager.eventDict[d.hashCode],
  9605. m;
  9606. b.GestureManager.hasTouchEvent(a) ? (m = b.GestureManager.getTouchEventByID(a.touchPointID, d), b.GestureManager.evtPool.setProperties(a, m)) : (m = b.GestureManager.evtPool.clone(a), c.push(m));
  9607. a = b.GestureManager.hostCollection;
  9608. for (var h, g = 0; g < a.length; g++) if (h = a[g], h.target == d) h.onTouch(c);
  9609. m.type == egret.TouchEvent.TOUCH_END && b.GestureManager.removeAllEvent();
  9610. b.GestureManager.showTouchPoint && b.GestureManager.drawTouchPoint()
  9611. };
  9612. d.hasTouchEvent = function(a) {
  9613. for (var d = b.GestureManager.eventDict[b.GestureManager.currentTouchObject.hashCode], c = 0; c < d.length; c++) if (d[c].touchPointID == a.touchPointID) return ! 0;
  9614. return ! 1
  9615. };
  9616. d.getTouchEventByID = function(a, d) {
  9617. for (var c = b.GestureManager.eventDict[d.hashCode], m = 0; m < c.length; m++) if (c[m].touchPointID == a) return c[m];
  9618. return null
  9619. };
  9620. d.leaveStageHandler = function(a) {
  9621. b.GestureManager.removeAllEvent()
  9622. };
  9623. d.removeAllEvent = function() {
  9624. var a = egret.MainContext.instance.stage,
  9625. d;
  9626. for (d in b.GestureManager.eventDict) {
  9627. var c = b.GestureManager.eventDict[d];
  9628. null != c && b.GestureManager.evtPool.reclaimAll(c)
  9629. }
  9630. a.removeEventListener(egret.TouchEvent.TOUCH_MOVE, b.GestureManager.touchedHandler, a);
  9631. a.removeEventListener(egret.TouchEvent.TOUCH_END, b.GestureManager.touchedHandler, a);
  9632. a.removeEventListener(egret.Event.LEAVE_STAGE, b.GestureManager.leaveStageHandler, a);
  9633. b.GestureManager.drawTouchPoint()
  9634. };
  9635. d.drawTouchPoint = function() {
  9636. if (null != b.GestureManager.currentTouchObject) {
  9637. var a = b.GestureManager.drawLayer,
  9638. d = egret.MainContext.instance.stage;
  9639. null == a.stage && d.addChild(a);
  9640. a = a.graphics;
  9641. a.clear();
  9642. a.beginFill(0, 0.4);
  9643. for (var c in b.GestureManager.eventDict) if (b.GestureManager.currentTouchObject.hashCode == c) {
  9644. var m = b.GestureManager.eventDict[c];
  9645. if (null != m && 0 < m.length) for (var h = 0; h < m.length; h++) d = m[h],
  9646. a.drawCircle(d.stageX, d.stageY, 10)
  9647. }
  9648. m = b.GestureManager.simulatePoints;
  9649. for (h = 0; h < m.length; h++) d = m[h],
  9650. a.drawCircle(d.stageX, d.stageY, 10);
  9651. a.endFill()
  9652. }
  9653. };
  9654. d.showTouchPoint = !1;
  9655. d.simulateMultitouch = !1;
  9656. d.simulatePoints = [];
  9657. d.hostCollection = [];
  9658. d.eventDict = {};
  9659. d.evtPool = new b.EventPool;
  9660. d.drawLayer = new egret.Sprite;
  9661. return d
  9662. } ();
  9663. b.GestureManager = c;
  9664. c.prototype.__class__ = "neoges.GestureManager"
  9665. })(neoges || (neoges = {}));
  9666. __extends = this.__extends ||
  9667. function(b, c) {
  9668. function d() {
  9669. this.constructor = b
  9670. }
  9671. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9672. d.prototype = c.prototype;
  9673. b.prototype = new d
  9674. }; (function(b) {
  9675. var c = function(b) {
  9676. function a(a) {
  9677. b.call(this, a)
  9678. }
  9679. __extends(a, b);
  9680. a.BEGAN = "began";
  9681. a.UPDATE = "update";
  9682. a.ENDED = "ended";
  9683. a.FAILED = "failed";
  9684. return a
  9685. } (egret.Event);
  9686. b.GestureEvent = c;
  9687. c.prototype.__class__ = "neoges.GestureEvent"
  9688. })(neoges || (neoges = {}));
  9689. var currentLevel = 1,
  9690. passedLevel = 90,
  9691. test, steps = 999,
  9692. blockGap = 98,
  9693. pointer = function() {
  9694. function b(b, d) {
  9695. this.x = b;
  9696. this.y = d
  9697. }
  9698. b.prototype.equal = function(b) {
  9699. return b.x == this.x && b.y == this.y ? !0 : !1
  9700. };
  9701. return b
  9702. } ();
  9703. pointer.prototype.__class__ = "pointer";
  9704. var levelSteps = [];
  9705. function getTypeString(b) {
  9706. switch (b) {
  9707. case 0:
  9708. return "empty";
  9709. case 1:
  9710. return "face";
  9711. case 2:
  9712. return "wall";
  9713. case 3:
  9714. return "white";
  9715. case 4:
  9716. return "big";
  9717. case 5:
  9718. return "magnet"
  9719. }
  9720. }
  9721. function getTypeNumber(b) {
  9722. switch (b) {
  9723. case "empty":
  9724. return 0;
  9725. case "face":
  9726. return 1;
  9727. case "wall":
  9728. return 2;
  9729. case "white":
  9730. return 3;
  9731. case "big":
  9732. return 4
  9733. }
  9734. }
  9735. function safeRemove(b) {
  9736. b.parent && b.parent.removeChild(b)
  9737. }
  9738. var colorID = -1,
  9739. COLOR = [5374493, 8307882, 12287684],
  9740. __extends = this.__extends ||
  9741. function(b, c) {
  9742. function d() {
  9743. this.constructor = b
  9744. }
  9745. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9746. d.prototype = c.prototype;
  9747. b.prototype = new d
  9748. },
  9749. LevelPanel = function(b) {
  9750. function c() {
  9751. b.call(this);
  9752. this.levelBtns = [];
  9753. this.page = 0;
  9754. this.lastPage = 2;
  9755. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  9756. this.bg.texture = RES.getRes("level-bg");
  9757. this.dialog = new egret.Bitmap(RES.getRes("level-dialog"));
  9758. this.homeBtn = new MyButton(RES.getRes("level-home"));
  9759. this.previousBtn = new MyButton(RES.getRes("game-previous"));
  9760. this.nextBtn = new MyButton(RES.getRes("game-next"));
  9761. this.addChild(this.bg);
  9762. this.addChild(this.dialog);
  9763. this.addChild(this.homeBtn);
  9764. this.addChild(this.previousBtn);
  9765. this.addChild(this.nextBtn);
  9766. var d = "passed";
  9767. this.levelBtns.push(new LevelButton("passed", 0));
  9768. for (var a = 1; 30 >= a; a++) d = a == currentLevel ? "current": a <= passedLevel ? "passed": "refer",
  9769. d = new LevelButton(d, a),
  9770. this.addChild(d),
  9771. this.levelBtns.push(d);
  9772. this.setAnchor();
  9773. this.setLayout();
  9774. this.setListener()
  9775. }
  9776. __extends(c, b);
  9777. c.prototype.onAddToStage = function() {
  9778. this.update()
  9779. };
  9780. c.prototype.setListener = function() {
  9781. var b = this;
  9782. this.homeBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9783. function() {
  9784. sendEvent("home", b)
  9785. },
  9786. this);
  9787. for (var a = 0; a < this.levelBtns.length; a++) this.levelBtns[a].addEventListener(egret.TouchEvent.TOUCH_END,
  9788. function(a) {
  9789. currentLevel = a.currentTarget.levelNum;
  9790. sendEvent("start", b)
  9791. },
  9792. this);
  9793. this.previousBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9794. function() {
  9795. 0 < b.page && (b.page--, b.update())
  9796. },
  9797. this);
  9798. this.nextBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9799. function() {
  9800. b.page < b.lastPage && (b.page++, b.update())
  9801. },
  9802. this)
  9803. };
  9804. c.prototype.update = function() {
  9805. for (var b = "passed",
  9806. a = 1; a < this.levelBtns.length; a++) {
  9807. var c = a + 30 * this.page;
  9808. c == currentLevel ? (b = "current", this.levelBtns[a].touchEnabled = !0) : c <= passedLevel ? (b = "passed", this.levelBtns[a].touchEnabled = !0) : b = "refer";
  9809. this.levelBtns[a].update(b, c)
  9810. }
  9811. };
  9812. c.prototype.setLayout = function() {
  9813. this.homeBtn.x = 200;
  9814. this.homeBtn.y = -450;
  9815. this.dialog.y = -50;
  9816. this.nextBtn.x = 100;
  9817. this.nextBtn.y = 500;
  9818. this.previousBtn.x = -100;
  9819. this.previousBtn.y = 500
  9820. };
  9821. return c
  9822. } (Panel);
  9823. LevelPanel.prototype.__class__ = "LevelPanel";
  9824. var __extends = this.__extends ||
  9825. function(b, c) {
  9826. function d() {
  9827. this.constructor = b
  9828. }
  9829. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9830. d.prototype = c.prototype;
  9831. b.prototype = new d
  9832. },
  9833. StartPanel = function(b) {
  9834. function c() {
  9835. var d = this;
  9836. b.call(this);
  9837. this.bg.texture = RES.getRes("start-bg");
  9838. this.startBtn = new MyButton(RES.getRes("start-button"));
  9839. this.title = new egret.Bitmap(RES.getRes("start-title"));
  9840. this.addChild(this.bg);
  9841. 1 != version && this.addChild(this.title);
  9842. this.addChild(this.startBtn);
  9843. this.setAnchor();
  9844. this.setLayout();
  9845. this.startBtn.addEventListener(egret.TouchEvent.TOUCH_END,
  9846. function() {
  9847. sendEvent("level", d)
  9848. },
  9849. this)
  9850. }
  9851. __extends(c, b);
  9852. c.prototype.setLayout = function() {
  9853. this.title.y = -350;
  9854. this.startBtn.y = 200
  9855. };
  9856. return c
  9857. } (Panel);
  9858. StartPanel.prototype.__class__ = "StartPanel";
  9859. var VERSION; (function(b) {
  9860. b[b.autobox = 0] = "autobox";
  9861. b[b.single = 1] = "single";
  9862. b[b.market = 2] = "market";
  9863. b[b.weixin = 3] = "weixin"
  9864. })(VERSION || (VERSION = {}));
  9865. var score = 0,
  9866. bestScore = 0,
  9867. screenW = 320,
  9868. screenH = 568,
  9869. centerX = 160,
  9870. centerY = 284,
  9871. sizeOffset = 1,
  9872. sizeOffsetW = 1,
  9873. state = 0,
  9874. gameState; (function(b) {
  9875. b[b.ready = 0] = "ready";
  9876. b[b.playing = 1] = "playing";
  9877. b[b.pausing = 2] = "pausing";
  9878. b[b.over = 3] = "over";
  9879. b[b.replay = 4] = "replay";
  9880. b[b.home = 5] = "home"
  9881. })(gameState || (gameState = {}));
  9882. var version = 2,
  9883. lowResolution = !1,
  9884. debug = !1,
  9885. local = !1,
  9886. gameName = "kuaiyiqi_2",
  9887. __extends = this.__extends ||
  9888. function(b, c) {
  9889. function d() {
  9890. this.constructor = b
  9891. }
  9892. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  9893. d.prototype = c.prototype;
  9894. b.prototype = new d
  9895. }; (function(b) {
  9896. var c = function(d) {
  9897. function a(a) {
  9898. void 0 === a && (a = null);
  9899. d.call(this, a);
  9900. this._useMultiPoints = !1
  9901. }
  9902. __extends(a, d);
  9903. a.prototype.onTouch = function(a) {
  9904. 1 < a.length || b.GestureManager.simulateMultitouch || (a = a[0], a.type == egret.TouchEvent.TOUCH_BEGIN ? (this.gestureBegan(), this._startPoint = new egret.Point(a.stageX, a.stageY)) : a.type == egret.TouchEvent.TOUCH_MOVE ? (this._endPoint = new egret.Point(a.stageX, a.stageY), this.gestureUpdate()) : a.type == egret.TouchEvent.TOUCH_END && this.gestureEnded())
  9905. };
  9906. a.prototype.gestureUpdate = function() {
  9907. this._stats = 2;
  9908. var a = new b.GestureEvent(b.GestureEvent.UPDATE);
  9909. a.host = this.target;
  9910. a.offsetX = this._endPoint.x - this._startPoint.x;
  9911. a.offsetY = this._endPoint.y - this._startPoint.y;
  9912. this.dispatchEvent(a)
  9913. };
  9914. return a
  9915. } (b.AbstractGesture);
  9916. b.PanGesture = c;
  9917. c.prototype.__class__ = "neoges.PanGesture"
  9918. })(neoges || (neoges = {}));
  9919. var OverDialog = GameOverPanel.OverDialog,
  9920. Controller = function() {
  9921. function b(b) {
  9922. game = this;
  9923. grestart = this.onGameInit;
  9924. local && (egret.localStorage.getItem(gameName) ? passedLevel = parseInt(egret.localStorage.getItem(gameName)) : savePassed());
  9925. this.container = b;
  9926. this.startPanel = new StartPanel;
  9927. this.levelPanel = new LevelPanel;
  9928. this.gamePanel = new GamePanel;
  9929. this.overDialog = new OverDialog;
  9930. this.startPanel.addEventListener("level", this.onGameLevelSelect, this);
  9931. this.levelPanel.addEventListener("start", this.onGameStart, this);
  9932. this.levelPanel.addEventListener("home", this.onGameInit, this);
  9933. this.gamePanel.addEventListener("over", this.onGameOver, this);
  9934. this.gamePanel.addEventListener("level", this.onGameLevelSelect, this);
  9935. this.gamePanel.addEventListener("passed", this.onGamePassed, this);
  9936. this.gamePanel.addEventListener("replay", this.onGameRestart, this);
  9937. this.overDialog.addEventListener(GameOverPanel.REPLAY, this.onGameRestart, this);
  9938. this.overDialog.addEventListener(GameOverPanel.NEXT, this.onGameRestart, this);
  9939. this.onGameInit()
  9940. }
  9941. b.prototype.onGameInit = function() {
  9942. this.container.removeChildren();
  9943. this.container.addChild(this.startPanel);
  9944. window.cb_finishload()
  9945. };
  9946. b.prototype.onGameLevelSelect = function() {
  9947. this.container.removeChildren();
  9948. this.container.addChild(this.levelPanel)
  9949. };
  9950. b.prototype.onGameStart = function() {
  9951. this.container.removeChildren();
  9952. this.container.addChild(this.gamePanel);
  9953. window.cb_start()
  9954. };
  9955. b.prototype.onGameOver = function() {
  9956. this.levelPanel.update();
  9957. this.overDialog.update(0, bestScore, !1);
  9958. this.container.addChild(this.overDialog);
  9959. window.cb_gameover(currentLevel)
  9960. };
  9961. b.prototype.onGameRestart = function(b) {
  9962. b.type == GameOverPanel.NEXT ? 150 > currentLevel && currentLevel++:score = 0;
  9963. this.gamePanel.reset();
  9964. window.cb_restart()
  9965. };
  9966. b.prototype.onGamePassed = function() {
  9967. score += steps;
  9968. currentLevel == passedLevel && (passedLevel++, this.levelPanel.update());
  9969. this.overDialog.update(1, bestScore, !0);
  9970. this.container.addChild(this.overDialog);
  9971. console.log(currentLevel);
  9972. window.myScore = currentLevel;
  9973. // updateShare(currentLevel);
  9974. // Play68.setRankingScoreDesc(currentLevel,Play68.rankingShowType.RANKING_SHOW_NO);
  9975. };
  9976. b.prototype.removePanel = function(b) {
  9977. b.parent && b.parent.removeChild(b)
  9978. };
  9979. return b
  9980. } ();
  9981. Controller.prototype.__class__ = "Controller";
  9982. function sendEvent(b, c) {
  9983. var d = new egret.Event(b);
  9984. c.dispatchEvent(d)
  9985. }
  9986. var game, grestart;
  9987. function restartGame() {
  9988. grestart.call(game)
  9989. }
  9990. function savePassed() {
  9991. if (local) {
  9992. var b = gameName + "passedLevel",
  9993. c = "" + passedLevel;
  9994. egret.localStorage.setItem(b, c);
  9995. b = gameName + "bestScore";
  9996. c = "" + bestScore;
  9997. egret.localStorage.setItem(b, c)
  9998. }
  9999. }
  10000. var __extends = this.__extends ||
  10001. function(b, c) {
  10002. function d() {
  10003. this.constructor = b
  10004. }
  10005. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10006. d.prototype = c.prototype;
  10007. b.prototype = new d
  10008. },
  10009. tweenEnd = !0,
  10010. GridBoard = function(b) {
  10011. function c() {
  10012. b.call(this);
  10013. this.blocks = [];
  10014. this.hasDirect = !0;
  10015. this.emptyI = [];
  10016. this.CN = 0;
  10017. this.conversation = [];
  10018. this.lastTouchY = this.lastTouchX = 0;
  10019. this.moveBlockN = -1;
  10020. this.timer = new egret.Timer(3E3, -1);
  10021. this.timer.addEventListener(egret.TimerEvent.TIMER, this.speak, this);
  10022. this.cv = new BlockConversation
  10023. }
  10024. __extends(c, b);
  10025. c.prototype.createBlocks = function() {
  10026. this.removeChildren();
  10027. this.conversation = [];
  10028. this.blocks = [];
  10029. var b = RES.getRes("levels").level[currentLevel];
  10030. this.map = b.map;
  10031. this.addMagnetBlock(b);
  10032. this.addCornerBlock(b);
  10033. this.addOneGridBlock(b, 1);
  10034. this.addOneGridBlock(b, 0);
  10035. this.addOneGridBlock(b, 2);
  10036. this.addBigBlock(b);
  10037. for (b = 1; b <= this.map[0]; b++) for (var a = 1; a <= this.map[1]; a++) {
  10038. var c = new pointer(b, a); - 1 == this.getIndex(c) && (c = [], c.push(new pointer(b, a)), c = new GameBlock(c, 3), this.addChild(c), this.blocks.push(c))
  10039. }
  10040. this.drawBg();
  10041. for (b = 0; b < this.blocks.length; b++) 1 == this.blocks[b].type && this.conversation.push(this.blocks[b].coords[0])
  10042. };
  10043. c.prototype.addOneGridBlock = function(b, a) {
  10044. for (var c in b[getTypeString(a)]) {
  10045. var k = [];
  10046. k.push(new pointer(b[getTypeString(a)][c][0], b[getTypeString(a)][c][1]));
  10047. k = new GameBlock(k, a);
  10048. 0 != a && 2 != a && this.addChild(k);
  10049. this.blocks.push(k)
  10050. }
  10051. };
  10052. c.prototype.addBigBlock = function(b) {
  10053. for (var a in b.big) {
  10054. for (var c = [], k = 0; k < b.big[a][2]; k++) for (var m = 0; m < b.big[a][3]; m++) c.push(new pointer(b.big[a][0] + k, b.big[a][1] + m));
  10055. c = new GameBlock(c, 4);
  10056. this.addChild(c);
  10057. this.blocks.push(c)
  10058. }
  10059. };
  10060. c.prototype.addMagnetBlock = function(b) {
  10061. for (var a in b.magnet) {
  10062. var c = [],
  10063. k;
  10064. for (k in b.magnet[a]) c.push(new pointer(b.magnet[a][k][0], b.magnet[a][k][1]));
  10065. c = new GameBlock(c, 5);
  10066. this.addChild(c);
  10067. this.blocks.push(c)
  10068. }
  10069. };
  10070. c.prototype.addCornerBlock = function(b) {
  10071. if (b.corner) {
  10072. console.log(b.corner);
  10073. for (var a in b.corner) {
  10074. var c = [],
  10075. k;
  10076. for (k in b.corner[a]) console.log("corner Joint"),
  10077. c.push(new pointer(b.corner[a][k][0], b.corner[a][k][1]));
  10078. console.log("corner");
  10079. c = new GameBlock(c, 6);
  10080. this.addChild(c);
  10081. this.blocks.push(c)
  10082. }
  10083. }
  10084. };
  10085. c.prototype.onSelect = function(b) {
  10086. egret.Tween.removeTweens(this.cv);
  10087. this.cv.alpha = 0;
  10088. this.timer.reset();
  10089. this.timer.start();
  10090. if (tweenEnd) {
  10091. this.isSelected = !0;
  10092. this.startPoint = new egret.Point(b.host.x, b.host.y);
  10093. b = b.host;
  10094. var a = this.getIndex(b.coords[0]);
  10095. this.moveBlockN = a;
  10096. this.movableD = [];
  10097. var c = [],
  10098. k = [],
  10099. k = clonePointerArr(b.coords),
  10100. m;
  10101. for (m in k) k[m].x++;
  10102. this.isOverlap(k, a) || (c.push(k), this.movableD.push(1));
  10103. k = clonePointerArr(b.coords);
  10104. for (m in k) k[m].x--;
  10105. this.isOverlap(k, a) || (c.push(k), this.movableD.push(3));
  10106. k = clonePointerArr(b.coords);
  10107. for (m in k) k[m].y++;
  10108. this.isOverlap(k, a) || (c.push(k), this.movableD.push(2));
  10109. k = clonePointerArr(b.coords);
  10110. for (m in k) k[m].y--;
  10111. this.isOverlap(k, a) || (c.push(k), this.movableD.push(0));
  10112. 0 == c.length ? this.hasDirect = this.isSelected = !1 : (this.hasDirect = !0, this.movable = c, console.log(this.movable))
  10113. }
  10114. };
  10115. c.prototype.onMove = function(b) {
  10116. if (tweenEnd && this.hasDirect && this.isSelected && !(20 > Math.abs(b.offsetX) && 20 > Math.abs(b.offsetY))) {
  10117. if (Math.abs(b.offsetX) > Math.abs(b.offsetY)) if (0 < b.offsetX) {
  10118. console.log("east");
  10119. for (var a in this.movableD) 1 == this.movableD[a] && (1 == this.blocks[this.getIndex(this.movable[a][0])].type && this.blocks[this.getIndex(this.movable[a][0])].merge(), this.blocks[this.moveBlockN].coords = this.movable[a], this.blocks[this.moveBlockN].move())
  10120. } else for (a in console.log("west"), this.movableD) 3 == this.movableD[a] && (1 == this.blocks[this.getIndex(this.movable[a][0])].type && this.blocks[this.getIndex(this.movable[a][0])].merge(), this.blocks[this.moveBlockN].coords = this.movable[a], this.blocks[this.moveBlockN].move());
  10121. else if (0 < b.offsetY) for (a in console.log("south"), this.movableD) 2 == this.movableD[a] && (1 == this.blocks[this.getIndex(this.movable[a][0])].type && this.blocks[this.getIndex(this.movable[a][0])].merge(), this.blocks[this.moveBlockN].coords = this.movable[a], this.blocks[this.moveBlockN].move());
  10122. else for (a in console.log("north"), this.movableD) 0 == this.movableD[a] && (1 == this.blocks[this.getIndex(this.movable[a][0])].type && this.blocks[this.getIndex(this.movable[a][0])].merge(), this.blocks[this.moveBlockN].coords = this.movable[a], this.blocks[this.moveBlockN].move());
  10123. this.isSelected = !1
  10124. }
  10125. };
  10126. c.prototype.onTouchEnd = function() {
  10127. this.isSelected = !1
  10128. };
  10129. c.prototype.isOverlap = function(b, a) {
  10130. for (var c in b) {
  10131. var k = this.getIndex(b[c]);
  10132. if ( - 1 == k) return ! 0;
  10133. if (1 == this.blocks[a].type && 1 == this.blocks[k].type) break;
  10134. else if (0 != this.blocks[k].type && k != a) return ! 0
  10135. }
  10136. return ! 1
  10137. };
  10138. c.prototype.resetEmpty = function() {
  10139. this.emptyI = [];
  10140. for (var b in this.blocks) 0 == this.blocks[b].type && (this.blocks[b].coords[0] = new pointer(0, 0), this.emptyI.push(b));
  10141. b = 0;
  10142. for (var a = 1; a <= this.map[0]; a++) for (var c = 1; c <= this.map[1]; c++) - 1 == this.getIndex(new pointer(a, c)) && (this.blocks[this.emptyI[b++]].coords[0] = new pointer(a, c), console.log(a, c));
  10143. this.conversation = [];
  10144. for (b = 0; b < this.blocks.length; b++) 1 == this.blocks[b].type && (this.conversation.push(this.blocks[b].coords[0]), this.blocks[b].normalFace(), a = new pointer(this.blocks[b].coords[0].x + 1, this.blocks[b].coords[0].y), -1 != this.getIndex(a) && 1 == this.blocks[this.getIndex(a)].type ? this.blocks[b].loveFace() : (a = new pointer(this.blocks[b].coords[0].x - 1, this.blocks[b].coords[0].y), -1 != this.getIndex(a) && 1 == this.blocks[this.getIndex(a)].type ? this.blocks[b].loveFace() : (a = new pointer(this.blocks[b].coords[0].x, this.blocks[b].coords[0].y + 1), -1 != this.getIndex(a) && 1 == this.blocks[this.getIndex(a)].type ? this.blocks[b].loveFace() : (a = new pointer(this.blocks[b].coords[0].x, this.blocks[b].coords[0].y - 1), -1 != this.getIndex(a) && 1 == this.blocks[this.getIndex(a)].type && this.blocks[b].loveFace()))))
  10145. };
  10146. c.prototype.setTouch = function() {
  10147. for (var b in this.blocks) if (0 != this.blocks[b].type && 2 != this.blocks[b].type) {
  10148. this.blocks[b].touchEnabled = !0;
  10149. var a = new neoges.PanGesture(this.blocks[b]);
  10150. a.addEventListener(neoges.GestureEvent.BEGAN, this.onSelect, this);
  10151. a.addEventListener(neoges.GestureEvent.UPDATE, this.onMove, this);
  10152. a.addEventListener(neoges.GestureEvent.ENDED, this.onTouchEnd, this)
  10153. }
  10154. };
  10155. c.prototype.disableTouch = function() {
  10156. for (var b in this.blocks) this.blocks[b].touchEnabled = !1
  10157. };
  10158. c.prototype.getIndex = function(b) {
  10159. for (var a in this.blocks) for (var c in this.blocks[a].coords) if (this.blocks[a].coords[c].equal(b)) return a;
  10160. return - 1
  10161. };
  10162. c.prototype.update = function() {
  10163. this.resetEmpty()
  10164. };
  10165. c.prototype.reset = function() {
  10166. this.createBlocks();
  10167. this.resetEmpty();
  10168. this.setTouch();
  10169. this.scaleSize = this.map[0] >= this.map[1] ? this.scaleX = this.scaleY = 6 / this.map[0] : this.scaleX = this.scaleY = 5 / (this.map[0] + 0.5);
  10170. egret.Tween.removeTweens(this.cv);
  10171. this.cv.alpha = 0;
  10172. this.timer.reset();
  10173. this.timer.start();
  10174. this.addChild(this.cv)
  10175. };
  10176. c.prototype.drawBg = function() {
  10177. var b = blockGap + 2 * boardBorder;
  10178. this.graphics.clear();
  10179. for (var a = 0; a < this.blocks.length; a++) if (2 != this.blocks[a].type) for (var c in this.blocks[a].coords) {
  10180. var k = this.blocks[a].coords[c].x * blockGap - blockGap,
  10181. m = this.blocks[a].coords[c].y * blockGap - blockGap;
  10182. this.graphics.beginFill(16696782, 1);
  10183. this.graphics.drawRoundRect(k, m, b, b, 30)
  10184. }
  10185. this.graphics.endFill();
  10186. this.width = this.map[0] * blockGap + 20;
  10187. this.height = this.map[1] * blockGap + 20
  10188. };
  10189. c.prototype.judge = function() {
  10190. for (var b = 0,
  10191. a = 0; a < this.blocks.length; a++) 1 == this.blocks[a].type && b++;
  10192. return 1 == b ? !0 : !1
  10193. };
  10194. c.prototype.speak = function() {
  10195. this.cv.change();
  10196. this.cv.x = blockGap / 2 + (this.conversation[this.CN].x - 1) * blockGap + boardBorder;
  10197. this.cv.y = blockGap / 2 + (this.conversation[this.CN].y - 1) * blockGap + boardBorder - 50;
  10198. var b = egret.Tween.get(this.cv);
  10199. b.to({
  10200. alpha: 1
  10201. },
  10202. 300).wait(2E3).to({
  10203. alpha: 0
  10204. },
  10205. 300);
  10206. b.wait(300).call(function() {},
  10207. this);
  10208. this.CN++;
  10209. this.CN >= this.conversation.length && (this.CN = 0)
  10210. };
  10211. return c
  10212. } (egret.Sprite);
  10213. GridBoard.prototype.__class__ = "GridBoard";
  10214. var boardBorder = 10;
  10215. function clonePointerArr(b) {
  10216. var c = [],
  10217. d;
  10218. for (d in b) c.push(new pointer(b[d].x, b[d].y));
  10219. return c
  10220. }
  10221. var __extends = this.__extends ||
  10222. function(b, c) {
  10223. function d() {
  10224. this.constructor = b
  10225. }
  10226. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10227. d.prototype = c.prototype;
  10228. b.prototype = new d
  10229. },
  10230. BlockConversation = function(b) {
  10231. function c() {
  10232. b.call(this);
  10233. this.i = 1;
  10234. this.text = new egret.Bitmap;
  10235. var c = new egret.Bitmap(RES.getRes("conversation-bg"));
  10236. this.anchorY = 1;
  10237. this.change();
  10238. this.text.x = 20;
  10239. this.text.y = 15;
  10240. this.addChild(this.text);
  10241. this.addChild(c)
  10242. }
  10243. __extends(c, b);
  10244. c.prototype.change = function() {
  10245. this.text.texture = RES.getRes("conversation-" + this.i);
  10246. this.i++;
  10247. 6 < this.i && (this.i = 1)
  10248. };
  10249. return c
  10250. } (egret.DisplayObjectContainer);
  10251. BlockConversation.prototype.__class__ = "BlockConversation";
  10252. var __extends = this.__extends ||
  10253. function(b, c) {
  10254. function d() {
  10255. this.constructor = b
  10256. }
  10257. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10258. d.prototype = c.prototype;
  10259. b.prototype = new d
  10260. },
  10261. blockType; (function(b) {
  10262. b[b.empty = 0] = "empty";
  10263. b[b.face = 1] = "face";
  10264. b[b.wall = 2] = "wall";
  10265. b[b.white = 3] = "white";
  10266. b[b.big = 4] = "big";
  10267. b[b.magnet = 5] = "magnet";
  10268. b[b.corner = 6] = "corner"
  10269. })(blockType || (blockType = {}));
  10270. var directions; (function(b) {
  10271. b[b.north = 0] = "north";
  10272. b[b.east = 1] = "east";
  10273. b[b.south = 2] = "south";
  10274. b[b.west = 3] = "west";
  10275. b[b.none = 4] = "none"
  10276. })(directions || (directions = {}));
  10277. var GameBlock = function(b) {
  10278. function c(c, a, e) {
  10279. var k = this;
  10280. void 0 === e && (e = 0);
  10281. b.call(this);
  10282. this.moveSpeed = 200;
  10283. this.bitmapBody = new egret.Bitmap;
  10284. this.shapeBody = new egret.Shape;
  10285. this.coords = [];
  10286. this.setCoord(c);
  10287. this.type = a;
  10288. this.corner = e;
  10289. this.extSize = new pointer(this.coords[this.coords.length - 1].x - this.coords[0].x + 1, this.coords[this.coords.length - 1].y - this.coords[0].y + 1);
  10290. this.width = (blockGap - 90) * (this.extSize.x - 1) + 90 * this.extSize.x;
  10291. this.height = (blockGap - 90) * (this.extSize.y - 1) + 90 * this.extSize.y;
  10292. this.anchorX = 45 / this.width;
  10293. this.anchorY = 45 / this.height;
  10294. if (1 == a) this.bitmapBody.texture = RES.getRes("game-block" + a),
  10295. this.addChild(this.bitmapBody);
  10296. else if (5 == a) {
  10297. colorID = (colorID + 1) % 3;
  10298. c = new egret.Shape;
  10299. this.addChild(c);
  10300. for (var m in this.coords) c.graphics.beginFill(COLOR[colorID], 1),
  10301. c.graphics.drawRoundRect((this.coords[m].x - this.coords[0].x) * blockGap, (this.coords[m].y - this.coords[0].y) * blockGap, 90, 90, 20),
  10302. e = new egret.Bitmap(RES.getRes("game-block" + a)),
  10303. e.anchorX = e.anchorY = 0.5,
  10304. e.x = (this.coords[m].x - this.coords[0].x) * blockGap + 45,
  10305. e.y = (this.coords[m].y - this.coords[0].y) * blockGap + 45,
  10306. this.addChild(e);
  10307. c.graphics.endFill()
  10308. } else if (6 == a) {
  10309. c = new egret.Shape;
  10310. for (a = 0; a < this.coords.length - 1; a++) {
  10311. e = m = 0;
  10312. var h = this.coords[a].x < this.coords[a + 1].x ? this.coords[a].x: this.coords[a + 1].x,
  10313. g = this.coords[a].y < this.coords[a + 1].y ? this.coords[a].y: this.coords[a + 1].y,
  10314. f = Math.abs(this.coords[a + 1].x - this.coords[a].x) + 1,
  10315. l = Math.abs(this.coords[a + 1].y - this.coords[a].y) + 1;
  10316. f > l ? m = (blockGap - 90) / 2 : e = (blockGap - 90) / 2;
  10317. c.graphics.beginFill(51675, 1);
  10318. c.graphics.drawRoundRect((h - this.coords[0].x) * blockGap, (g - this.coords[0].y) * blockGap, f * (90 + m), l * (90 + e), 20)
  10319. }
  10320. c.graphics.endFill();
  10321. this.addChild(c)
  10322. } else 3 == a && (h = 16777215),
  10323. 4 == a && (h = 51675),
  10324. this.shapeBody.graphics.beginFill(h, 1),
  10325. this.shapeBody.graphics.drawRoundRect(0, 0, this.width, this.height, 20),
  10326. this.shapeBody.graphics.endFill(),
  10327. this.addChild(this.shapeBody);
  10328. this.init();
  10329. this.addEventListener(egret.TouchEvent.TOUCH_BEGIN,
  10330. function() {
  10331. k.alpha = 0.6
  10332. },
  10333. this);
  10334. this.addEventListener(egret.TouchEvent.TOUCH_END,
  10335. function() {
  10336. k.alpha = 1
  10337. },
  10338. this);
  10339. this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE,
  10340. function() {
  10341. k.alpha = 1
  10342. },
  10343. this)
  10344. }
  10345. __extends(c, b);
  10346. c.prototype.move = function() {
  10347. var b = this,
  10348. a = this.transCoord();
  10349. tweenEnd = !1;
  10350. var c = egret.Tween.get(this);
  10351. 1 == this.type && (this.bitmapBody.texture = RES.getRes("game-block" + this.type + "-move"));
  10352. c.to({
  10353. x: a.x,
  10354. y: a.y
  10355. },
  10356. this.moveSpeed, egret.Ease.sineOut).call(function() {
  10357. tweenEnd = !0;
  10358. sendEvent("move", b.parent);
  10359. egret.Tween.removeTweens(b);
  10360. b.alpha = 1
  10361. },
  10362. this)
  10363. };
  10364. c.prototype.merge = function() {
  10365. var b = this;
  10366. this.type = 0;
  10367. egret.Tween.get(this).to({
  10368. alpha: 0
  10369. },
  10370. this.moveSpeed / 2).call(function() {
  10371. safeRemove(b.bitmapBody);
  10372. egret.Tween.removeTweens(b)
  10373. },
  10374. this)
  10375. };
  10376. c.prototype.init = function() {
  10377. var b = this,
  10378. a = this.transCoord();
  10379. this.x = a.x;
  10380. this.y = a.y;
  10381. this.scaleX = this.scaleY = 0;
  10382. tweenEnd = !1;
  10383. egret.Tween.get(this).to({
  10384. scaleX: 1,
  10385. scaleY: 1
  10386. },
  10387. this.moveSpeed, egret.Ease.sineIn).call(function() {
  10388. tweenEnd = !0;
  10389. egret.Tween.removeTweens(b)
  10390. },
  10391. this)
  10392. };
  10393. c.prototype.transCoord = function() {
  10394. return new pointer(blockGap / 2 + (this.coords[0].x - 1) * blockGap + boardBorder, blockGap / 2 + (this.coords[0].y - 1) * blockGap + boardBorder)
  10395. };
  10396. c.prototype.setCoord = function(b) {
  10397. this.coords = b
  10398. };
  10399. c.prototype.loveFace = function() {
  10400. this.bitmapBody.texture = RES.getRes("game-block" + this.type + "-love")
  10401. };
  10402. c.prototype.normalFace = function() {
  10403. this.bitmapBody.texture = RES.getRes("game-block" + this.type)
  10404. };
  10405. return c
  10406. } (egret.DisplayObjectContainer);
  10407. GameBlock.prototype.__class__ = "GameBlock";
  10408. var __extends = this.__extends ||
  10409. function(b, c) {
  10410. function d() {
  10411. this.constructor = b
  10412. }
  10413. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10414. d.prototype = c.prototype;
  10415. b.prototype = new d
  10416. },
  10417. LevelButton = function(b) {
  10418. function c(c, a) {
  10419. b.call(this, RES.getRes("level-" + c));
  10420. this.type = c;
  10421. "refer" == c && (this.touchEnabled = !1);
  10422. this.levelNum = a;
  10423. this.label = new egret.TextField;
  10424. this.label.fontFamily = "Arial";
  10425. this.label.text = "" + this.levelNum;
  10426. this.label.anchorX = this.label.anchorY = 0.5;
  10427. this.label.x = this.width / 2;
  10428. this.label.y = this.height / 2;
  10429. this.label.size = 40;
  10430. this.label.scaleY = 1.1;
  10431. this.addChild(this.label);
  10432. this.x = -190 + (a - 1) % 5 * 95;
  10433. this.y = -260 + 110 * Math.floor((a - 1) / 5);
  10434. this.scaleX = this.scaleY = 0;
  10435. this.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.onRemoveFromStage, this)
  10436. }
  10437. __extends(c, b);
  10438. c.prototype.update = function(b, a) {
  10439. var c = this,
  10440. k = 10 * Math.floor(this.levelNum % 31);
  10441. egret.Tween.get(this).to({
  10442. scaleX: 0,
  10443. scaleY: 0
  10444. },
  10445. 100).call(function() {
  10446. c.levelNum = a;
  10447. c.label.text = "" + c.levelNum;
  10448. c.type = b;
  10449. c.bg.texture = RES.getRes("level-" + b);
  10450. c.touchEnabled = "refer" != b ? !0 : !1
  10451. },
  10452. this).wait(k).to({
  10453. scaleX: 1,
  10454. scaleY: 1
  10455. },
  10456. 100).call(function() {
  10457. egret.Tween.removeTweens(c)
  10458. },
  10459. this)
  10460. };
  10461. c.prototype.onRemoveFromStage = function() {
  10462. this.scaleX = this.scaleY = 0
  10463. };
  10464. return c
  10465. } (MyButton);
  10466. LevelButton.prototype.__class__ = "LevelButton";
  10467. var LevelSet = function() {
  10468. return function() {
  10469. this.map = [];
  10470. this.empty = [];
  10471. this.face = [];
  10472. this.wall = [];
  10473. this.white = [];
  10474. this.big = [];
  10475. this.magnet = [];
  10476. this.corner = []
  10477. }
  10478. } ();
  10479. LevelSet.prototype.__class__ = "LevelSet";
  10480. var __extends = this.__extends ||
  10481. function(b, c) {
  10482. function d() {
  10483. this.constructor = b
  10484. }
  10485. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10486. d.prototype = c.prototype;
  10487. b.prototype = new d
  10488. },
  10489. Main = function(b) {
  10490. function c() {
  10491. b.call(this);
  10492. this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this)
  10493. }
  10494. __extends(c, b);
  10495. c.prototype.onAddToStage = function(b) {
  10496. this.removeEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);
  10497. RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onComplete, this);
  10498. RES.loadConfig("resource/resource.json", "resource/");
  10499. RES.loadGroup("preload");
  10500. screenW = this.stage.stageWidth;
  10501. screenH = this.stage.stageHeight;
  10502. centerX = screenW / 2;
  10503. centerY = screenH / 2;
  10504. sizeOffset = screenH / 1136;
  10505. sizeOffsetW = screenW / 640
  10506. };
  10507. c.prototype.onComplete = function(b) {
  10508. RES.removeEventListener(RES.ResourceEvent.GROUP_COMPLETE, this.onComplete, this);
  10509. debug && egret.Profiler.getInstance().run();
  10510. this.createGameScene()
  10511. };
  10512. c.prototype.createGameScene = function() {
  10513. this.ctrl = new Controller(this)
  10514. };
  10515. return c
  10516. } (egret.DisplayObjectContainer);
  10517. Main.prototype.__class__ = "Main";
  10518. var __extends = this.__extends ||
  10519. function(b, c) {
  10520. function d() {
  10521. this.constructor = b
  10522. }
  10523. for (var a in c) c.hasOwnProperty(a) && (b[a] = c[a]);
  10524. d.prototype = c.prototype;
  10525. b.prototype = new d
  10526. },
  10527. MyText = function(b) {
  10528. function c(c) {
  10529. b.call(this);
  10530. this.bg = new egret.Bitmap(c);
  10531. this.bg.anchorX = this.bg.anchorY = 0.5;
  10532. this.addChild(this.bg);
  10533. this.text = new egret.TextField;
  10534. this.text.anchorX = this.text.anchorY = 0.5;
  10535. this.setText("0");
  10536. this.addChild(this.text)
  10537. }
  10538. __extends(c, b);
  10539. c.prototype.setText = function(b) {
  10540. this.text.text = b
  10541. };
  10542. c.prototype.setTextSize = function(b) {
  10543. this.text.size = b
  10544. };
  10545. c.prototype.setPosOffset = function(b, a) {
  10546. void 0 === b && (b = 0);
  10547. void 0 === a && (a = 0);
  10548. this.text.y = a;
  10549. this.text.x = b
  10550. };
  10551. return c
  10552. } (egret.DisplayObjectContainer);
  10553. MyText.prototype.__class__ = "MyText";