lufylegend-1.9.7.min.js 260 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072
  1. function LEvent(e) {
  2. this.eventType = e;
  3. this._ll_preventDefault = false
  4. }
  5. function LStageAlign() {
  6. throw "LStageAlign cannot be instantiated"
  7. }
  8. function LStageScaleMode() {
  9. throw "LStageScaleMode cannot be instantiated"
  10. }
  11. function trace() {
  12. if (!LGlobal.traceDebug) return;
  13. var e = document.getElementById("traceObject"),
  14. t;
  15. if (trace.arguments.length > 0 && e == null) {
  16. e = document.createElement("TEXTAREA");
  17. e.id = "traceObject";
  18. e.style.position = "absolute";
  19. e.style.top = LGlobal.height + 20 + "px";
  20. e.style.width = LGlobal.width + "px";
  21. e.style.height = "200px";
  22. document.body.appendChild(e)
  23. }
  24. for (t = 0; t < trace.arguments.length; t++) {
  25. e.value = e.value + trace.arguments[t] + "\r\n";
  26. e.scrollTop = e.scrollHeight
  27. }
  28. }
  29. function addChild(e) {
  30. LGlobal.stage.addChild(e)
  31. }
  32. function removeChild(e) {
  33. LGlobal.stage.removeChild(e)
  34. }
  35. function init(e, t, n, r, i, s) {
  36. // updateShare(0);
  37. LGlobal.speed = e;
  38. var o = function() {
  39. if (LGlobal.canTouch && LGlobal.aspectRatio == LANDSCAPE && window.innerWidth < window.innerHeight) {
  40. LGlobal.horizontalError()
  41. } else if (LGlobal.canTouch && LGlobal.aspectRatio == PORTRAIT && window.innerWidth > window.innerHeight) {
  42. LGlobal.verticalError()
  43. } else {
  44. setTimeout(i, 100)
  45. }
  46. LGlobal.startTimer = (new Date).getTime()
  47. };
  48. if (s != null && s == LEvent.INIT) {
  49. LGlobal.frameRate = setInterval(function() {
  50. LGlobal.onShow()
  51. }, e);
  52. LGlobal.setCanvas(t, n, r);
  53. o()
  54. } else {
  55. LEvent.addEventListener(window, "load", function() {
  56. LGlobal.frameRate = setInterval(function() {
  57. LGlobal.onShow()
  58. }, e);
  59. LGlobal.setCanvas(t, n, r);
  60. o()
  61. })
  62. }
  63. }
  64. function base(e, t, n) {
  65. var r = null,
  66. i = e.constructor.prototype,
  67. s = {};
  68. if (e.constructor.name == "Object") {
  69. console.warn("When you use the extends. You must make a method like 'XX.prototype.xxx=function(){}'. but not 'XX.prototype={xxx:function(){}}'.")
  70. }
  71. if (typeof e.__ll__parent__ == UNDEFINED) {
  72. e.__ll__parent__ = [];
  73. e.__ll__parent__ = []
  74. }
  75. e.__ll__parent__.push(t.prototype);
  76. for (r in i) {
  77. s[r] = 1
  78. }
  79. for (r in t.prototype) {
  80. if (!s[r]) {
  81. i[r] = t.prototype[r]
  82. }
  83. }
  84. if (i.toString == Object.prototype.toString) {
  85. i.toString = LObject.prototype.toString
  86. }
  87. t.apply(e, n)
  88. }
  89. function getTimer() {
  90. return (new Date).getTime() - LGlobal.startTimer
  91. }
  92. function getExtension(e) {
  93. var t, n = /([^#?]+\.)([^.#?]+)/;
  94. t = e.match(n);
  95. if (t.length >= 3) {
  96. return t[2].toLowerCase()
  97. }
  98. return null
  99. }
  100. function LBlendMode() {
  101. throw "LBlendMode cannot be instantiated"
  102. }
  103. function LoadingSample2(e, t, n) {
  104. base(this, LSprite, []);
  105. var r = this,
  106. i = LGlobal.canvas,
  107. s = "Loading...",
  108. o;
  109. r.backgroundColor = t == null ? "#000000" : t;
  110. r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
  111. if (n == null) n = LGlobal._create_loading_color();
  112. r.color = n;
  113. r.progress = 0;
  114. r.size = e == null ? LGlobal.height * .2 : e;
  115. o = new LTextField;
  116. o.text = s;
  117. o.size = r.size;
  118. o.color = "#ffffff";
  119. o.x = (LGlobal.width - o.getWidth()) / 2;
  120. o.y = (LGlobal.height - r.size) / 2;
  121. r.addChild(o);
  122. r.backLabel = o;
  123. o = new LTextField;
  124. o.text = "***%";
  125. o.size = r.size * .3;
  126. o.color = n;
  127. o.x = (LGlobal.width - o.getWidth()) / 2;
  128. o.y = (LGlobal.height - r.size) / 2 - r.size * .4;
  129. r.addChild(o);
  130. r.progressLabel = o;
  131. o = new LTextField;
  132. o.text = s;
  133. o.size = r.size;
  134. o.color = r.color;
  135. o.x = (LGlobal.width - o.getWidth()) / 2;
  136. o.y = (LGlobal.height - r.size) / 2;
  137. o.mask = new LGraphics;
  138. r.screenX = o.x;
  139. r.screenY = o.y;
  140. r.screenWidth = o.getWidth();
  141. r.addChild(o);
  142. r.showLabel = o;
  143. i.shadowOffsetX = 2;
  144. i.shadowOffsetY = 2;
  145. i.shadowColor = "blue";
  146. r.setProgress(r.progress)
  147. }
  148. function LoadingSample3(e, t, n) {
  149. base(this, LSprite, []);
  150. var r = this,
  151. i = LGlobal.canvas;
  152. r.backgroundColor = t == null ? "#000000" : t;
  153. r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
  154. if (n == null) n = LGlobal._create_loading_color();
  155. r.color = n;
  156. r.progress = 0;
  157. r.screenWidth = LGlobal.width * .75;
  158. r.screenHeight = e == null ? LGlobal.height * .1 : e;
  159. if (r.screenHeight > 5) r.screenHeight = 5;
  160. r.screenX = (LGlobal.width - r.screenWidth) / 2;
  161. r.screenY = (LGlobal.height - r.screenHeight) / 2;
  162. r.back = new LSprite;
  163. r.addChild(r.back);
  164. r.label = new LTextField;
  165. r.label.color = "#ffffff";
  166. r.label.weight = "bolder";
  167. r.label.size = r.screenHeight * 2;
  168. r.label.x = r.screenX + (r.screenWidth - r.label.getWidth()) * .5;
  169. r.label.y = r.screenY - r.screenHeight * 4;
  170. r.addChild(r.label);
  171. r.star = new Array;
  172. r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
  173. r.setProgress(r.progress)
  174. }
  175. function LoadingSample4(e, t, n) {
  176. base(this, LSprite, []);
  177. var r = this,
  178. i = LGlobal.canvas;
  179. r.backgroundColor = t == null ? "#000000" : t;
  180. r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
  181. if (n == null) n = "#FFFFFF";
  182. r.arc = new LSprite;
  183. r.arc.x = LGlobal.width * .5;
  184. r.arc.y = LGlobal.height * .5;
  185. r.addChild(r.arc);
  186. for (var s = 0; s < 360; s++) {
  187. r.arc.graphics.drawArc(1 + s / 36, n, [0, 0, 50, 2 * Math.PI / 360 * s, 2 * Math.PI / 360 * (s + 2)])
  188. }
  189. r.progress = 0;
  190. r.label = new LTextField;
  191. r.label.color = n;
  192. r.label.weight = "bolder";
  193. r.label.size = 18;
  194. r.label.x = LGlobal.width * .5;
  195. r.label.y = LGlobal.height * .5 - r.label.getHeight() * .5;
  196. r.addChild(r.label);
  197. var o = new LDropShadowFilter(0, 0, "#FFFFFF", 30);
  198. r.arc.filters = [o];
  199. r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
  200. r.setProgress(r.progress)
  201. }
  202. function LoadingSample5(e, t, n) {
  203. base(this, LSprite, []);
  204. var r = this,
  205. i = LGlobal.canvas;
  206. r.backgroundColor = t == null ? "#000000" : t;
  207. r.graphics.drawRect(1, r.backgroundColor, [0, 0, LGlobal.width, LGlobal.height], true, r.backgroundColor);
  208. if (n == null) n = "#FFFFFF";
  209. r.arc = new LSprite;
  210. r.arc.x = LGlobal.width * .5;
  211. r.arc.y = LGlobal.height * .5;
  212. r.addChild(r.arc);
  213. var s = 50;
  214. for (var o = 0; o < 360; o += 30) {
  215. var u = new LSprite;
  216. u.graphics.drawArc(0, n, [s, 0, 7, 0, 2 * Math.PI], true, n);
  217. u.rotate = o;
  218. u.alpha = .1 + o / 360;
  219. r.arc.addChild(u)
  220. }
  221. r.index = 0;
  222. r.max = 3;
  223. r.progress = 0;
  224. r.label = new LTextField;
  225. r.label.color = "#FFFFFF";
  226. r.label.weight = "bolder";
  227. r.label.size = 18;
  228. r.label.x = LGlobal.width * .5;
  229. r.label.y = LGlobal.height * .5 - r.label.getHeight() * .5;
  230. r.addChild(r.label);
  231. var a = new LDropShadowFilter(0, 0, "#FFFFFF", 30);
  232. r.arc.filters = [a];
  233. r.addEventListener(LEvent.ENTER_FRAME, r.onframe);
  234. r.setProgress(r.progress)
  235. }
  236. function LoadingSample6(e, t, n) {
  237. var r = this;
  238. base(r, LSprite, []);
  239. r.progress = 0;
  240. r.step = 0;
  241. r.holeR = e || 10;
  242. r.holeAmount = 5;
  243. r.holesx = 20;
  244. r.loadingBarWidth = r.holeR * 2 * r.holeAmount + r.holesx * (r.holeAmount - 1);
  245. r.loadingBarHeight = r.holeR * 2;
  246. r.progressColor = t || "#2187e7";
  247. r.filterColor = n || "#00c6ff";
  248. r.backLayer = new LSprite;
  249. r.backLayer.graphics.drawRect(0, "", [0, 0, LGlobal.width, LGlobal.height], true, "#161616");
  250. r.addChild(r.backLayer);
  251. r.holeLayer = new LSprite;
  252. r.holeLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
  253. r.holeLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
  254. r.addChild(r.holeLayer);
  255. r.progressLayer = new LSprite;
  256. r.progressLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
  257. r.progressLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
  258. r.addChild(r.progressLayer);
  259. r._addHole()
  260. }
  261. function LoadingSample7(e, t, n) {
  262. var r = this;
  263. base(r, LSprite, []);
  264. r.progress = 0;
  265. r.step = 0;
  266. r.holeW = e || 10;
  267. r.holeH = t || 30;
  268. r.holeAmount = 10;
  269. r.holesx = 8;
  270. r.loadingBarWidth = r.holeW * r.holeAmount + r.holesx * (r.holeAmount - 1);
  271. r.loadingBarHeight = r.holeH;
  272. r.progressColor = n || "#2187e7";
  273. r.backLayer = new LSprite;
  274. r.backLayer.graphics.drawRect(0, "", [0, 0, LGlobal.width, LGlobal.height], true, "#161616");
  275. r.addChild(r.backLayer);
  276. r.holeLayer = new LSprite;
  277. r.holeLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
  278. r.holeLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
  279. r.addChild(r.holeLayer);
  280. r.progressLayer = new LSprite;
  281. r.progressLayer.x = (LGlobal.width - r.loadingBarWidth) * .5;
  282. r.progressLayer.y = (LGlobal.height - r.loadingBarHeight) * .5;
  283. r.addChild(r.progressLayer);
  284. r._addHole()
  285. }
  286. var OS_PC = "pc",
  287. OS_IPHONE = "iPhone",
  288. OS_IPOD = "iPod",
  289. OS_IPAD = "iPad",
  290. OS_ANDROID = "Android",
  291. OS_WINDOWS_PHONE = "Windows Phone",
  292. OS_BLACK_BERRY = "BlackBerry",
  293. NONE = "none",
  294. UNDEFINED = "undefined",
  295. LANDSCAPE = "landscape",
  296. PORTRAIT = "portrait",
  297. mouseX, mouseY;
  298. LEvent.prototype.preventDefault = function() {
  299. this._ll_preventDefault = true
  300. };
  301. LEvent.INIT = "init";
  302. LEvent.COMPLETE = "complete";
  303. LEvent.ENTER_FRAME = "enter_frame";
  304. LEvent.WINDOW_RESIZE = "resize";
  305. LEvent.SOUND_COMPLETE = "sound_complete";
  306. LEvent.END_CONTACT = "endContact";
  307. LEvent.PRE_SOLVE = "preSolve";
  308. LEvent.POST_SOLVE = "postSolve";
  309. LEvent.BEGIN_CONTACT = "beginContact";
  310. LEvent.addEventListener = function(e, t, n, r) {
  311. if (r == null) {
  312. r = false
  313. }
  314. if (e.addEventListener) {
  315. e.addEventListener(t, n, r)
  316. } else if (e.attachEvent) {
  317. e["e" + t + n] = n;
  318. e[t + n] = function() {
  319. e["e" + t + n]()
  320. };
  321. e.attachEvent("on" + t, e[t + n])
  322. }
  323. };
  324. LEvent.removeEventListener = function(e, t, n, r) {
  325. if (r == null) {
  326. r = false
  327. }
  328. if (e.removeEventListener) {
  329. e.removeEventListener(t, n, r)
  330. } else if (e.detachEvent) {
  331. e["e" + t + n] = n;
  332. e[t + n] = function() {
  333. e["e" + t + n]()
  334. };
  335. e.detachEvent("on" + t, e[t + n])
  336. }
  337. };
  338. var LMouseEvent = function() {
  339. throw "LMouseEvent cannot be instantiated"
  340. };
  341. LMouseEvent.MOUSE_DOWN = "mousedown";
  342. LMouseEvent.MOUSE_UP = "mouseup";
  343. LMouseEvent.TOUCH_START = "touchstart";
  344. LMouseEvent.TOUCH_MOVE = "touchmove";
  345. LMouseEvent.TOUCH_END = "touchend";
  346. LMouseEvent.MOUSE_MOVE = "mousemove";
  347. LMouseEvent.MOUSE_OVER = "mouseover";
  348. LMouseEvent.MOUSE_OUT = "mouseout";
  349. LMouseEvent.DOUBLE_CLICK = "dblclick";
  350. var LMultitouchInputMode = function() {
  351. throw "LMultitouchInputMode cannot be instantiated"
  352. };
  353. LMultitouchInputMode.NONE = "none";
  354. LMultitouchInputMode.GESTURE = "gesture";
  355. LMultitouchInputMode.TOUCH_POINT = "touchPoint";
  356. var LMultitouch = function() {
  357. throw "LMultitouch cannot be instantiated"
  358. };
  359. LMultitouch.inputMode = "none";
  360. LMultitouch.touchs = [];
  361. var LTextEvent = function() {
  362. throw "LTextEvent cannot be instantiated"
  363. };
  364. LTextEvent.TEXT_INPUT = "textInput";
  365. LTextEvent.WIND_COMPLETE = "windComplete";
  366. var LFocusEvent = function() {
  367. throw "LFocusEvent cannot be instantiated"
  368. };
  369. LFocusEvent.FOCUS_IN = "focusIn";
  370. LFocusEvent.FOCUS_OUT = "focusOut";
  371. var LMouseEventContainer = function() {
  372. function e() {
  373. var e = this;
  374. e.container = {};
  375. e.dispatchAllEvent = false;
  376. e.mouseDownContainer = [];
  377. e.mouseUpContainer = [];
  378. e.mouseMoveContainer = [];
  379. e.mouseOverContainer = [];
  380. e.mouseOutContainer = [];
  381. e.mouseDblContainer = [];
  382. e.textFieldInputContainer = [];
  383. e.buttonContainer = []
  384. }
  385. e.prototype = {
  386. pushInputBox: function(e) {
  387. var t = this,
  388. n = t.textFieldInputContainer,
  389. r, i;
  390. for (r = 0, i = n.length; r < i; r++) {
  391. if (e.objectIndex == n[r].objectIndex) {
  392. return
  393. }
  394. }
  395. t.textFieldInputContainer.push(e)
  396. },
  397. removeInputBox: function(e) {
  398. var t = this,
  399. n = t.textFieldInputContainer,
  400. r, i;
  401. for (r = 0, i = n.length; r < i; r++) {
  402. if (e.objectIndex == n[r].objectIndex) {
  403. t.textFieldInputContainer.splice(r, 1);
  404. break
  405. }
  406. }
  407. },
  408. pushButton: function(e) {
  409. var t = this,
  410. n = t.buttonContainer,
  411. r, i;
  412. for (r = 0, i = n.length; r < i; r++) {
  413. if (e.objectIndex == n[r].objectIndex) {
  414. return
  415. }
  416. }
  417. t.buttonContainer.push(e)
  418. },
  419. removeButton: function(e) {
  420. var t = this,
  421. n = t.buttonContainer,
  422. r, i;
  423. for (r = 0, i = n.length; r < i; r++) {
  424. if (e.objectIndex == n[r].objectIndex) {
  425. t.buttonContainer.splice(r, 1);
  426. break
  427. }
  428. }
  429. },
  430. dispatchEventButton: function(e) {
  431. var t = this,
  432. n = t.buttonContainer,
  433. r, i;
  434. for (r = 0, i = n.length; r < i; r++) {
  435. if (typeof t.buttonContainer[r].ll_button_mode == "function") {
  436. t.buttonContainer[r].ll_button_mode(e)
  437. }
  438. }
  439. },
  440. addEvent: function(e, t, n) {
  441. var r = this;
  442. t.push({
  443. container: e,
  444. listener: n
  445. })
  446. },
  447. removeEvent: function(e, t, n) {
  448. var r = this,
  449. i, s;
  450. for (i = 0, s = t.length; i < s; i++) {
  451. if (t[i].container.objectIndex === e.objectIndex && (!n || t[i].listener == n)) {
  452. t.splice(i, 1);
  453. break
  454. }
  455. }
  456. },
  457. addMouseDownEvent: function(e, t) {
  458. var n = this;
  459. n.addEvent(e, n.mouseDownContainer, t)
  460. },
  461. addMouseUpEvent: function(e, t) {
  462. var n = this;
  463. n.addEvent(e, n.mouseUpContainer, t)
  464. },
  465. addMouseMoveEvent: function(e, t) {
  466. var n = this;
  467. n.addEvent(e, n.mouseMoveContainer, t)
  468. },
  469. addMouseOverEvent: function(e, t) {
  470. var n = this;
  471. n.addEvent(e, n.mouseOverContainer, t)
  472. },
  473. addMouseOutEvent: function(e, t) {
  474. var n = this;
  475. n.addEvent(e, n.mouseOutContainer, t)
  476. },
  477. addMouseDblEvent: function(e, t) {
  478. var n = this;
  479. n.addEvent(e, n.mouseDblContainer, t)
  480. },
  481. addMouseEvent: function(e, t, n) {
  482. var r = this;
  483. if (t == LMouseEvent.MOUSE_DOWN) {
  484. r.addMouseDownEvent(e, n)
  485. } else if (t == LMouseEvent.MOUSE_UP) {
  486. r.addMouseUpEvent(e, n)
  487. } else if (t == LMouseEvent.MOUSE_OVER) {
  488. r.addMouseOverEvent(e, n)
  489. } else if (t == LMouseEvent.MOUSE_OUT) {
  490. r.addMouseOutEvent(e, n)
  491. } else if (t == LMouseEvent.MOUSE_MOVE) {
  492. r.addMouseMoveEvent(e, n)
  493. } else {
  494. r.addMouseDblEvent(e, n)
  495. }
  496. },
  497. hasEvent: function(e, t) {
  498. for (var n = 0, r = t.length; n < r; n++) {
  499. if (t[n].container.objectIndex === e.objectIndex) {
  500. return true
  501. }
  502. }
  503. return false
  504. },
  505. removeMouseDownEvent: function(e, t) {
  506. var n = this;
  507. n.removeEvent(e, n.mouseDownContainer, t)
  508. },
  509. removeMouseUpEvent: function(e, t) {
  510. var n = this;
  511. n.removeEvent(e, n.mouseUpContainer, t)
  512. },
  513. removeMouseMoveEvent: function(e, t) {
  514. var n = this;
  515. n.removeEvent(e, n.mouseMoveContainer, t)
  516. },
  517. removeMouseOverEvent: function(e, t) {
  518. var n = this;
  519. n.removeEvent(e, n.mouseOverContainer, t)
  520. },
  521. removeMouseOutEvent: function(e, t) {
  522. var n = this;
  523. n.removeEvent(e, n.mouseOutContainer, t)
  524. },
  525. removeMouseDblEvent: function(e, t) {
  526. var n = this;
  527. n.removeEvent(e, n.mouseDblContainer, t)
  528. },
  529. removeMouseEvent: function(e, t, n) {
  530. var r = this;
  531. if (t == LMouseEvent.MOUSE_DOWN) {
  532. r.removeMouseDownEvent(e, n)
  533. } else if (t == LMouseEvent.MOUSE_UP) {
  534. r.removeMouseUpEvent(e, n)
  535. } else if (t == LMouseEvent.MOUSE_OVER) {
  536. r.removeMouseOverEvent(e, n)
  537. } else if (t == LMouseEvent.MOUSE_OUT) {
  538. r.removeMouseOutEvent(e, n)
  539. } else if (t == LMouseEvent.MOUSE_MOVE) {
  540. r.removeMouseMoveEvent(e, n)
  541. } else {
  542. r.removeMouseDblEvent(e, n)
  543. }
  544. },
  545. dispatchMouseEvent: function(e, t) {
  546. var n = this;
  547. if (t == LMouseEvent.MOUSE_DOWN) {
  548. n.dispatchEvent(e, n.mouseDownContainer, LMouseEvent.MOUSE_DOWN);
  549. n.dispatchEvent(e, n.textFieldInputContainer)
  550. } else if (t == LMouseEvent.MOUSE_UP) {
  551. n.dispatchEvent(e, n.mouseUpContainer, LMouseEvent.MOUSE_UP)
  552. } else if (t == LMouseEvent.DOUBLE_CLICK) {
  553. n.dispatchEvent(e, n.mouseDblContainer, LMouseEvent.DOUBLE_CLICK)
  554. } else {
  555. n.dispatchEventButton(e);
  556. n.dispatchEvent(e, n.mouseOutContainer, LMouseEvent.MOUSE_OUT);
  557. n.dispatchEvent(e, n.mouseOverContainer, LMouseEvent.MOUSE_OVER);
  558. n.dispatchEvent(e, n.mouseMoveContainer, LMouseEvent.MOUSE_MOVE)
  559. }
  560. },
  561. getRootParams: function(e) {
  562. var t = e.parent,
  563. n = {
  564. x: 0,
  565. y: 0,
  566. scaleX: 1,
  567. scaleY: 1
  568. };
  569. while (t != "root") {
  570. n.x *= t.scaleX;
  571. n.y *= t.scaleY;
  572. n.x += t.x;
  573. n.y += t.y;
  574. n.scaleX *= t.scaleX;
  575. n.scaleY *= t.scaleY;
  576. t = t.parent
  577. }
  578. return n
  579. },
  580. _mouseEnabled: function(e) {
  581. var t = this;
  582. if (!e || !e.parent || e.parent == "root") {
  583. return false
  584. }
  585. if (!e.visible || typeof e.mouseEnabled != UNDEFINED && !e.mouseEnabled) {
  586. return false
  587. }
  588. var n = e.parent;
  589. while (n != "root") {
  590. if (!n.mouseEnabled || !n.mouseChildren) {
  591. return false
  592. }
  593. n = n.parent;
  594. if (!n) {
  595. return false
  596. }
  597. }
  598. return true
  599. },
  600. dispatchEvent: function(e, t, n) {
  601. var r = this,
  602. i, s, o = [],
  603. u, a, f;
  604. for (a = 0, f = t.length; a < f; a++) {
  605. i = t[a].container || t[a];
  606. if (!r._mouseEnabled(i)) {
  607. continue
  608. }
  609. s = r.getRootParams(i);
  610. if (!n && i.mouseEvent) {
  611. i.mouseEvent(e, LMouseEvent.MOUSE_DOWN, s);
  612. continue
  613. }
  614. if (i.ismouseon(e, s)) {
  615. if (n == LMouseEvent.MOUSE_OUT) {
  616. continue
  617. }
  618. if (n == LMouseEvent.MOUSE_OVER) {
  619. if (i.ll_mousein) {
  620. continue
  621. }
  622. }
  623. if (n != LMouseEvent.MOUSE_UP) {
  624. i.ll_mousein = true
  625. }
  626. o.push({
  627. sp: i,
  628. co: s,
  629. listener: t[a].listener
  630. })
  631. } else {
  632. if (n != LMouseEvent.MOUSE_OUT && n != LMouseEvent.MOUSE_OVER) {
  633. continue
  634. }
  635. if (!i.ll_mousein) {
  636. continue
  637. }
  638. i.ll_mousein = false;
  639. o.push({
  640. sp: i,
  641. co: s,
  642. listener: t[a].listener
  643. })
  644. }
  645. }
  646. if (o.length == 0) {
  647. return
  648. }
  649. if (o.length > 1) {
  650. o = o.sort(r._sort.bind(r))
  651. }
  652. f = r.dispatchAllEvent ? o.length : 1;
  653. for (a = 0; a < f && a < o.length; a++) {
  654. u = o[a];
  655. e.currentTarget = e.clickTarget = u.sp;
  656. if (!e.target) {
  657. e.target = u.sp
  658. }
  659. e.event_type = n;
  660. e.selfX = (e.offsetX - u.co.x - u.sp.x) / (u.co.scaleX * u.sp.scaleX);
  661. e.selfY = (e.offsetY - u.co.y - u.sp.y) / (u.co.scaleY * u.sp.scaleY);
  662. u.listener(e, u.sp);
  663. if (f == 1 && a < o.length - 1 && u.sp.objectIndex == o[a + 1].sp.objectIndex) {
  664. o.splice(a, 1);
  665. a--
  666. }
  667. }
  668. },
  669. set: function(e, t) {
  670. this.container[e] = t
  671. },
  672. _sort: function(e, t) {
  673. var n = this,
  674. r, i, s = n._getSort(e.sp),
  675. o = n._getSort(t.sp),
  676. u, a, f;
  677. for (u = 0, a = s.length, f = o.length; u < a && u < f; u++) {
  678. r = s[u];
  679. i = o[u];
  680. if (r.objectIndex == i.objectIndex) {
  681. continue
  682. }
  683. return i.parent.getChildIndex(i) - r.parent.getChildIndex(r)
  684. }
  685. return o.length - s.length
  686. },
  687. _getSort: function(e) {
  688. var t = e.parent,
  689. n = [e];
  690. while (t != "root") {
  691. n.unshift(t);
  692. t = t.parent
  693. }
  694. return n
  695. }
  696. };
  697. return new e
  698. }();
  699. var LKeyboardEvent = function() {
  700. throw "LKeyboardEvent cannot be instantiated"
  701. };
  702. LKeyboardEvent.KEY_DOWN = "keydown";
  703. LKeyboardEvent.KEY_UP = "keyup";
  704. LKeyboardEvent.KEY_PRESS = "keypress";
  705. var LAccelerometerEvent = function() {
  706. throw "LAccelerometerEvent cannot be instantiated"
  707. };
  708. LAccelerometerEvent.DEVICEMOTION = "devicemotion";
  709. LStageAlign.TOP = "T";
  710. LStageAlign.BOTTOM = "B";
  711. LStageAlign.LEFT = "L";
  712. LStageAlign.RIGHT = "Re";
  713. LStageAlign.TOP_LEFT = "TL";
  714. LStageAlign.TOP_RIGHT = "TR";
  715. LStageAlign.TOP_MIDDLE = "TM";
  716. LStageAlign.BOTTOM_LEFT = "BL";
  717. LStageAlign.BOTTOM_RIGHT = "BR";
  718. LStageAlign.BOTTOM_MIDDLE = "BM";
  719. LStageAlign.MIDDLE = "M";
  720. LStageScaleMode.EXACT_FIT = "exactFit";
  721. LStageScaleMode.SHOW_ALL = "showAll";
  722. LStageScaleMode.NO_BORDER = "noBorder";
  723. LStageScaleMode.NO_SCALE = "noScale";
  724. var LGlobal = function() {
  725. function e() {
  726. throw "LGlobal cannot be instantiated"
  727. }
  728. e.FULL_SCREEN = "full_screen";
  729. e.traceDebug = false;
  730. e.displayState = NONE;
  731. e.aspectRatio = NONE;
  732. e.canvasObj = null;
  733. e.canvas = null;
  734. e.webAudio = true;
  735. e.objectIndex = 1;
  736. e.stage = null;
  737. e.width = 0;
  738. e.height = 0;
  739. e.box2d = null;
  740. e.speed = 50;
  741. e.IS_MOUSE_DOWN = false;
  742. e.preventDefault = true;
  743. e.childList = new Array;
  744. e.dragList = new Array;
  745. e.excludingContainer = new Array;
  746. e.stageScale = "noScale";
  747. e.align = "M";
  748. e.mobile = false;
  749. e.canTouch = false;
  750. e.os = OS_PC;
  751. e.ios = false;
  752. e.android = false;
  753. e.android_new = false;
  754. e.backgroundColor = null;
  755. e.destroy = true;
  756. e.forceRefresh = false;
  757. e.devicePixelRatio = window.devicePixelRatio || 1;
  758. e.startTimer = 0;
  759. e.keepClear = true;
  760. e.top = 0;
  761. e.left = 0;
  762. e.window = window;
  763. (function(t) {
  764. e.isFirefox = t.toLowerCase().indexOf("firefox") >= 0;
  765. if (t.indexOf(OS_IPHONE) > 0) {
  766. e.os = OS_IPHONE;
  767. e.canTouch = true;
  768. e.ios = true
  769. } else if (t.indexOf(OS_IPOD) > 0) {
  770. e.os = OS_IPOD;
  771. e.canTouch = true;
  772. e.ios = true
  773. } else if (t.indexOf(OS_IPAD) > 0) {
  774. e.os = OS_IPAD;
  775. e.ios = true;
  776. e.canTouch = true
  777. } else if (t.indexOf(OS_ANDROID) > 0) {
  778. e.os = OS_ANDROID;
  779. e.canTouch = true;
  780. e.android = true;
  781. var n = t.indexOf(OS_ANDROID);
  782. if (parseInt(t.substr(n + 8, 1)) > 3) {
  783. e.android_new = true
  784. }
  785. } else if (t.indexOf(OS_WINDOWS_PHONE) > 0) {
  786. e.os = OS_WINDOWS_PHONE;
  787. e.canTouch = true
  788. } else if (t.indexOf(OS_BLACK_BERRY) > 0) {
  789. e.os = OS_BLACK_BERRY;
  790. e.canTouch = true
  791. }
  792. e.mobile = e.canTouch
  793. })(navigator.userAgent);
  794. e.setDebug = function(t) {
  795. e.traceDebug = t
  796. };
  797. e.setCanvas = function(t, n, r) {
  798. e.ll_createCanvas(t, n, r);
  799. e.ll_createStage();
  800. if (e.displayState == LStage.FULL_SCREEN) {
  801. e.resize()
  802. } else if (typeof e.displayState == "number") {
  803. e.resize(e.width * e.displayState, e.height * e.displayState)
  804. }
  805. if (e.canTouch) {
  806. e.ll_clicks = 0;
  807. e.ll_prev_clickTime = 0;
  808. LEvent.addEventListener(e.canvasObj, LMouseEvent.TOUCH_START, e.ll_touchStart);
  809. LEvent.addEventListener(document, LMouseEvent.TOUCH_END, e.ll_touchEnd);
  810. LEvent.addEventListener(e.canvasObj, LMouseEvent.TOUCH_MOVE, e.ll_touchMove)
  811. } else {
  812. LEvent.addEventListener(e.canvasObj, LMouseEvent.DOUBLE_CLICK, e.ll_mouseDbclick);
  813. LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_DOWN, e.ll_mouseDown);
  814. LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_MOVE, e.ll_mouseMove);
  815. LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_UP, e.ll_mouseUp);
  816. LEvent.addEventListener(e.canvasObj, LMouseEvent.MOUSE_OUT, e.ll_mouseOut)
  817. }
  818. };
  819. e.ll_createCanvas = function(t, n, r) {
  820. e.id = t;
  821. e.object = document.getElementById(t);
  822. e.object.innerHTML = '<div style="position:absolute;margin:0;padding:0;overflow:visible;-webkit-transform:translateZ(0);z-index:0;">' + '<canvas id="' + e.id + '_canvas" style="margin:0;padding:0;width:' + n + "px;height:" + r + 'px;">' + '<div id="noCanvas">' + "<p>Hey there,it looks like you're using Microsoft's Internet Explorer. Microsoft hates the Web and doesn't support HTML5:(</p>" + "</div>" + "</canvas></div>" + '<div id="' + e.id + '_InputText" style="position:absolute;margin:0;padding:0;z-index:10;display:none;">' + '<textarea rows="1" id="' + e.id + '_InputTextareaBox" style="resize:none;background:transparent;border:0px;"></textarea>' + '<input type="text" id="' + e.id + '_InputTextBox" style="background:transparent;border:0px;"/>' + '<input type="password" id="' + e.id + '_passwordBox" style="background:transparent;border:0px;"/></div>';
  823. e.canvasObj = document.getElementById(e.id + "_canvas");
  824. e._canvas = document.createElement("canvas");
  825. e._context = e._canvas.getContext("2d");
  826. if (e._context) {
  827. e.canvasObj.innerHTML = ""
  828. }
  829. e.inputBox = document.getElementById(e.id + "_InputText");
  830. e.inputTextareaBoxObj = document.getElementById(e.id + "_InputTextareaBox");
  831. e.inputTextBoxObj = document.getElementById(e.id + "_InputTextBox");
  832. e.passwordBoxObj = document.getElementById(e.id + "_passwordBox");
  833. e.inputTextField = null;
  834. if (n) {
  835. e.canvasObj.width = n
  836. }
  837. if (r) {
  838. e.canvasObj.height = r
  839. }
  840. e.width = e.canvasObj.width;
  841. e.height = e.canvasObj.height;
  842. e.canvasStyleWidth = e.width;
  843. e.canvasStyleHeight = e.height;
  844. e.canvas = e.canvasObj.getContext("2d");
  845. e.offsetX = mouseX = 0;
  846. e.offsetY = mouseY = 0
  847. };
  848. e.ll_createStage = function() {
  849. e.stage = new LSprite;
  850. e.stage.parent = "root";
  851. e.childList.push(e.stage);
  852. e.stage.baseAddEvent = e.stage.addEventListener;
  853. e.stage.baseRemoveEvent = e.stage.removeEventListener;
  854. e.stage.addEventListener = function(t, n) {
  855. if (t == LEvent.WINDOW_RESIZE) {
  856. e.stage.onresizeListener = n;
  857. e.stage.onresize = function(t) {
  858. e.stage.onresizeEvent = t
  859. };
  860. LEvent.addEventListener(e.window, t, e.stage.onresize)
  861. } else if (t == LKeyboardEvent.KEY_DOWN || t == LKeyboardEvent.KEY_UP || t == LKeyboardEvent.KEY_PRESS) {
  862. LEvent.addEventListener(e.window, t, n)
  863. } else {
  864. e.stage.baseAddEvent(t, n)
  865. }
  866. };
  867. e.stage.removeEventListener = function(t, n) {
  868. if (t == LEvent.WINDOW_RESIZE) {
  869. LEvent.removeEventListener(e.window, LEvent.WINDOW_RESIZE, e.stage.onresize);
  870. delete e.stage.onresize;
  871. delete e.stage.onresizeListener
  872. } else if (t == LKeyboardEvent.KEY_DOWN || t == LKeyboardEvent.KEY_UP || t == LKeyboardEvent.KEY_PRESS) {
  873. LEvent.removeEventListener(e.window, t, n)
  874. } else {
  875. e.stage.baseRemoveEvent(t, n)
  876. }
  877. }
  878. };
  879. e.ll_touchStart = function(t) {
  880. if (e.inputBox.style.display != NONE) {
  881. e.inputTextField._ll_getValue()
  882. }
  883. var n, r, i, s, o;
  884. n = parseInt(0 + e.object.style.left) + parseInt(e.canvasObj.style.marginLeft);
  885. r = parseInt(0 + e.object.style.top) + parseInt(e.canvasObj.style.marginTop);
  886. if (LMultitouch.inputMode == LMultitouchInputMode.NONE) {
  887. i = e.ll_touchStartEvent(t, 0, n, r)
  888. } else if (LMultitouch.inputMode == LMultitouchInputMode.TOUCH_POINT) {
  889. for (var o = 0, u = t.touches.length; o < u; o++) {
  890. if (!LMultitouch.touchs["touch" + t.touches[o].identifier]) {
  891. i = e.ll_touchStartEvent(t, o, n, r)
  892. }
  893. }
  894. }
  895. var a = new Date;
  896. var f = a.getTime();
  897. e.ll_clicks = f <= e.ll_prev_clickTime + 500 ? e.ll_clicks + 1 : 1;
  898. e.ll_prev_clickTime = f;
  899. if (e.ll_clicks === 2) {
  900. e.mouseEvent(i, LMouseEvent.DOUBLE_CLICK);
  901. e.ll_clicks = 0
  902. }
  903. e.IS_MOUSE_DOWN = true;
  904. if (e.mouseJoint_start) {
  905. e.mouseJoint_start(i)
  906. }
  907. e.touchHandler(t)
  908. };
  909. e.ll_touchStartEvent = function(t, n, r, i) {
  910. var s = {
  911. offsetX: t.touches[n].pageX - r,
  912. offsetY: t.touches[n].pageY - i,
  913. touchPointID: t.touches[n].identifier
  914. };
  915. s.offsetX = e.ll_scaleX(s.offsetX);
  916. s.offsetY = e.ll_scaleY(s.offsetY);
  917. mouseX = e.offsetX = s.offsetX;
  918. mouseY = e.offsetY = s.offsetY;
  919. LMultitouch.touchs["touch" + s.touchPointID] = s;
  920. e.mouseEvent(s, LMouseEvent.MOUSE_DOWN);
  921. e.buttonStatusEvent = s;
  922. return s
  923. };
  924. e.ll_touchEnd = function(t) {
  925. var n, r, i, s, o, u;
  926. if (LMultitouch.inputMode == LMultitouchInputMode.TOUCH_POINT) {
  927. for (i in LMultitouch.touchs) {
  928. n = LMultitouch.touchs[i];
  929. u = false;
  930. for (s = 0, o = t.touches.length; s < o; s++) {
  931. if (t.touches[s].identifier == n.touchPointID) {
  932. u = true;
  933. break
  934. }
  935. }
  936. if (!u) {
  937. r = n;
  938. delete LMultitouch.touchs[i];
  939. e.mouseEvent(r, LMouseEvent.MOUSE_UP)
  940. }
  941. }
  942. }
  943. if (!r) {
  944. r = {
  945. offsetX: e.offsetX,
  946. offsetY: e.offsetY
  947. }
  948. }
  949. e.mouseEvent(r, LMouseEvent.MOUSE_UP);
  950. e.touchHandler(t);
  951. e.IS_MOUSE_DOWN = false;
  952. e.buttonStatusEvent = null;
  953. if (e.mouseJoint_end) {
  954. e.mouseJoint_end()
  955. }
  956. };
  957. e.ll_touchMove = function(t) {
  958. var n, r, s, o, u = t.touches.length;
  959. n = parseInt(0 + e.object.style.left) + parseInt(e.canvasObj.style.marginLeft);
  960. r = parseInt(0 + e.object.style.top) + parseInt(e.canvasObj.style.marginTop);
  961. if (LMultitouch.inputMode == LMultitouchInputMode.NONE) {
  962. u = 1
  963. }
  964. for (i = 0, o = t.touches.length; i < o && i < u; i++) {
  965. s = {
  966. offsetX: t.touches[i].pageX - n,
  967. offsetY: t.touches[i].pageY - r,
  968. touchPointID: t.touches[i].identifier
  969. };
  970. s.offsetX = e.ll_scaleX(s.offsetX);
  971. s.offsetY = e.ll_scaleY(s.offsetY);
  972. mouseX = e.offsetX = s.offsetX;
  973. mouseY = e.offsetY = s.offsetY;
  974. if (LMultitouch.touchs["touch" + s.touchPointID] && LMultitouch.touchs["touch" + s.touchPointID].offsetX == s.offsetX && LMultitouch.touchs["touch" + s.touchPointID].offsetY == s.offsetY) {
  975. continue
  976. }
  977. e.buttonStatusEvent = s;
  978. LMultitouch.touchs["touch" + s.touchPointID] = s;
  979. e.mouseEvent(s, LMouseEvent.MOUSE_MOVE)
  980. }
  981. e.touchHandler(t);
  982. if (e.mouseJoint_move) {
  983. e.mouseJoint_move(s)
  984. }
  985. };
  986. e.ll_mouseDbclick = function(t) {
  987. if (t.offsetX == null && t.layerX != null) {
  988. t.offsetX = t.layerX;
  989. t.offsetY = t.layerY
  990. }
  991. var n = {
  992. button: t.button
  993. };
  994. n.offsetX = e.ll_scaleX(t.offsetX);
  995. n.offsetY = e.ll_scaleY(t.offsetY);
  996. e.mouseEvent(n, LMouseEvent.DOUBLE_CLICK)
  997. };
  998. e.ll_mouseDown = function(t) {
  999. if (t.offsetX == null && t.layerX != null) {
  1000. t.offsetX = t.layerX;
  1001. t.offsetY = t.layerY
  1002. }
  1003. if (e.inputBox.style.display != NONE) {
  1004. e.inputTextField._ll_getValue()
  1005. }
  1006. var n = {
  1007. button: t.button
  1008. };
  1009. n.offsetX = e.ll_scaleX(t.offsetX);
  1010. n.offsetY = e.ll_scaleY(t.offsetY);
  1011. e.mouseEvent(n, LMouseEvent.MOUSE_DOWN);
  1012. e.IS_MOUSE_DOWN = true;
  1013. if (e.mouseJoint_start) {
  1014. e.mouseJoint_start(n)
  1015. }
  1016. };
  1017. e.ll_mouseMove = function(t) {
  1018. if (t.offsetX == null && t.layerX != null) {
  1019. t.offsetX = t.layerX;
  1020. t.offsetY = t.layerY
  1021. }
  1022. var n = {};
  1023. n.offsetX = e.ll_scaleX(t.offsetX);
  1024. n.offsetY = e.ll_scaleY(t.offsetY);
  1025. e.buttonStatusEvent = n;
  1026. mouseX = e.offsetX = n.offsetX;
  1027. mouseY = e.offsetY = n.offsetY;
  1028. e.cursor = "default";
  1029. e.mouseEvent(n, LMouseEvent.MOUSE_MOVE);
  1030. document.body.style.cursor = e.cursor;
  1031. if (e.mouseJoint_move) {
  1032. e.mouseJoint_move(n)
  1033. }
  1034. };
  1035. e.ll_mouseUp = function(t) {
  1036. if (t.offsetX == null && t.layerX != null) {
  1037. t.offsetX = t.layerX;
  1038. t.offsetY = t.layerY
  1039. }
  1040. var n = {
  1041. button: t.button
  1042. };
  1043. n.offsetX = e.ll_scaleX(t.offsetX);
  1044. n.offsetY = e.ll_scaleY(t.offsetY);
  1045. e.mouseEvent(n, LMouseEvent.MOUSE_UP);
  1046. e.IS_MOUSE_DOWN = false;
  1047. if (e.mouseJoint_end) {
  1048. e.mouseJoint_end()
  1049. }
  1050. };
  1051. e.ll_mouseOut = function(t) {
  1052. if (t.offsetX == null && t.layerX != null) {
  1053. t.offsetX = t.layerX;
  1054. t.offsetY = t.layerY
  1055. }
  1056. var n = {};
  1057. n.offsetX = e.ll_scaleX(t.offsetX);
  1058. n.offsetY = e.ll_scaleY(t.offsetY);
  1059. e.mouseEvent(n, LMouseEvent.MOUSE_OUT);
  1060. e.IS_MOUSE_DOWN = false
  1061. };
  1062. e.touchHandler = function(t) {
  1063. t.stopPropagation();
  1064. if (e.preventDefault) {
  1065. t.preventDefault()
  1066. }
  1067. if (t.stopImmediatePropagation) {
  1068. t.stopImmediatePropagation()
  1069. }
  1070. return t
  1071. };
  1072. e.mouseEvent = function(t, n) {
  1073. if (n == LMouseEvent.MOUSE_MOVE) {
  1074. e.dragHandler(t)
  1075. }
  1076. if (LMouseEventContainer.container[n]) {
  1077. LMouseEventContainer.dispatchMouseEvent(t, n);
  1078. return
  1079. }
  1080. for (var r = e.childList.length - 1; r >= 0; r--) {
  1081. if (e.childList[r].mouseEvent && e.childList[r].mouseEvent(t, n)) {
  1082. break
  1083. }
  1084. }
  1085. };
  1086. e.dragHandler = function(t) {
  1087. var n, r, i, s = e.dragList;
  1088. for (n = s.length - 1; n >= 0; n--) {
  1089. r = s[n];
  1090. if (e.canTouch && r.ll_touchPointID != t.touchPointID) {
  1091. continue
  1092. }
  1093. i = r.getAbsoluteScale();
  1094. r.x = r.ll_dragStartX + (t.offsetX - r.ll_dragMX) * r.scaleX / i.scaleX;
  1095. r.y = r.ll_dragStartY + (t.offsetY - r.ll_dragMY) * r.scaleY / i.scaleY;
  1096. break
  1097. }
  1098. };
  1099. e._ll_mobile = function() {
  1100. var t = e.width * .3,
  1101. n = t * 1.5,
  1102. r = e.width * .05,
  1103. i = t * .05,
  1104. s = t * .15,
  1105. o = t * .3,
  1106. u = n * .2,
  1107. a = "#cccccc",
  1108. f = "#000000",
  1109. l = "#ffffff",
  1110. c = "#ff0000",
  1111. h, t, n, p, d, v, m;
  1112. h = new LSprite;
  1113. addChild(h);
  1114. t = e.width * .3, n = t * 1.5;
  1115. h.graphics.drawRoundRect(1, f, [r, r, t, n, r], true, a);
  1116. h.graphics.drawRoundRect(1, f, [r + i, r + i, t - i * 2, n - i * 2, r], true, f);
  1117. h.graphics.drawRect(1, l, [r + s, r + u, t - s * 2, n - u * 2], true, l);
  1118. h.graphics.drawArc(1, l, [r + t * .5, r + n - i * 3.5, i * 1.5, 0, 2 * Math.PI]);
  1119. h.graphics.drawRoundRect(1, l, [r + o, r + s, t - o * 2, i, i * .5]);
  1120. p = new LSprite;
  1121. p.x = -(t - s * 2) * .5;
  1122. p.y = -i * .5;
  1123. p.graphics.drawRect(1, c, [0, 0, t - s * 2, i], true, c);
  1124. d = new LSprite;
  1125. d.y = -(t - s * 2) * .5;
  1126. d.x = -i * .5;
  1127. d.graphics.drawRect(1, c, [0, 0, i, t - s * 2], true, c);
  1128. v = new LSprite;
  1129. v.x = r + o + (t - o * 2) * .5;
  1130. v.y = r + u + (n - u * 2) * .5;
  1131. v.rotate = 45;
  1132. v.addChild(p);
  1133. v.addChild(d);
  1134. h.addChild(v);
  1135. m = new LSprite;
  1136. m.graphics.drawVertices(2, f, [
  1137. [0, 0],
  1138. [s, s],
  1139. [0, s * 2]
  1140. ], true, a);
  1141. m.x = r * 1.5 + n;
  1142. m.y = r * 1.5 + n * .5;
  1143. addChild(m);
  1144. h.arrow = m;
  1145. var g = function() {
  1146. setTimeout(function() {
  1147. location.href = location.href
  1148. }, 100)
  1149. };
  1150. window.onorientationchange = g;
  1151. return h
  1152. };
  1153. e.verticalError = function() {
  1154. var t = e.width * .3,
  1155. n = e.width * .05;
  1156. var r = e._ll_mobile();
  1157. var i = r.clone();
  1158. i.getChildAt(0).visible = false;
  1159. i.x = e.width * .5 + n;
  1160. addChild(i);
  1161. r.rotate = 90;
  1162. r.x = e.width * .5 + n;
  1163. r.y = t * .5
  1164. };
  1165. e.horizontalError = function() {
  1166. var t = e.width * .3,
  1167. n = e.width * .05;
  1168. var r = e._ll_mobile();
  1169. var i = r.clone();
  1170. i.getChildAt(0).visible = false;
  1171. i.rotate = 90;
  1172. i.x = e.width - n;
  1173. i.y = t * .5;
  1174. addChild(i);
  1175. r.arrow.x = n * 1.5 + t
  1176. };
  1177. e.onShow = function() {
  1178. if (e.canvas == null) {
  1179. return
  1180. }
  1181. if (e.stage.onresizeEvent) {
  1182. e.stage.onresizeListener(e.stage.onresizeEvent);
  1183. delete e.stage.onresizeEvent
  1184. }
  1185. if (e.forceRefresh) {
  1186. e.canvasObj.width = e.canvasObj.width;
  1187. e.forceRefresh = false
  1188. }
  1189. if (e.box2d != null) {
  1190. e.box2d.ll_show();
  1191. if (!e.traceDebug && e.keepClear) {
  1192. e.canvas.clearRect(0, 0, e.width + 1, e.height + 1)
  1193. }
  1194. } else {
  1195. if (e.keepClear) {
  1196. e.canvas.clearRect(0, 0, e.width + 1, e.height + 1)
  1197. }
  1198. if (e.backgroundColor !== null) {
  1199. e.canvas.fillStyle = e.backgroundColor;
  1200. e.canvas.fillRect(0, 0, e.width, e.height)
  1201. }
  1202. }
  1203. e.show(e.childList)
  1204. };
  1205. e.show = function(e) {
  1206. for (var t = 0, n = e.length; t < n; t++) {
  1207. if (e[t] && e[t].ll_show) {
  1208. e[t].ll_show()
  1209. }
  1210. }
  1211. };
  1212. e.divideCoordinate = function(e, t, n, r) {
  1213. var i, s, o = e / r,
  1214. u = t / n,
  1215. a = [],
  1216. f;
  1217. for (i = 0; i < n; i++) {
  1218. f = [];
  1219. for (s = 0; s < r; s++) {
  1220. f.push({
  1221. x: o * s,
  1222. y: u * i,
  1223. width: o,
  1224. height: u
  1225. })
  1226. }
  1227. a.push(f)
  1228. }
  1229. return a
  1230. };
  1231. e._create_loading_color = function() {
  1232. var t = e.canvas.createRadialGradient(e.width / 2, e.height, 0, e.width / 2, 0, e.height);
  1233. t.addColorStop(0, "red");
  1234. t.addColorStop(.3, "orange");
  1235. t.addColorStop(.4, "yellow");
  1236. t.addColorStop(.5, "green");
  1237. t.addColorStop(.8, "blue");
  1238. t.addColorStop(1, "violet");
  1239. return t
  1240. };
  1241. e.hitPolygon = function(e, t, n) {
  1242. var r = 0,
  1243. i = e[0],
  1244. s = t <= i[0],
  1245. o = n <= i[1],
  1246. u, a, f, l, c;
  1247. for (u = 1, a = e.length; u < a + 1; u++) {
  1248. f = e[u % a];
  1249. l = t <= f[0];
  1250. c = n <= f[1];
  1251. if (o != c) {
  1252. if (s == l) {
  1253. if (s) {
  1254. r += o ? -1 : 1
  1255. }
  1256. } else {
  1257. if (t <= i[0] + (f[0] - i[0]) * (n - i[1]) / (f[1] - i[1])) {
  1258. r += o ? -1 : 1
  1259. }
  1260. }
  1261. }
  1262. i = f;
  1263. s = l;
  1264. o = c
  1265. }
  1266. return 0 != r
  1267. };
  1268. e.hitTestPolygon = function(e, t) {
  1269. var n, r, i, s, o, u, a = [
  1270. [e, [],
  1271. []
  1272. ],
  1273. [t, [],
  1274. []
  1275. ]
  1276. ];
  1277. for (r = 0; r < a.length; r++) {
  1278. s = a[r][0], o = a[r][1];
  1279. for (n = 0, i = s.length; n < i; n++) {
  1280. a[r][2].push(new LVec2(s[n][0], s[n][1]));
  1281. if (n < i - 1) {
  1282. o.push((new LVec2(s[n + 1][0] - s[n][0], s[n + 1][1] - s[n][1])).normL())
  1283. }
  1284. }
  1285. o.push((new LVec2(s[0][0] - s[i - 1][0], s[0][1] - s[i - 1][1])).normL())
  1286. }
  1287. for (r = 0; r < a.length; r++) {
  1288. o = a[r][1];
  1289. for (n = 0, i = o.length; n < i; n++) {
  1290. var f = LVec2.getMinMax(a[0][2], o[n]);
  1291. var l = LVec2.getMinMax(a[1][2], o[n]);
  1292. if (f.max_o < l.min_o || f.min_o > l.max_o) {
  1293. return false
  1294. }
  1295. }
  1296. }
  1297. return true
  1298. };
  1299. e.hitTestPolygonArc = function(t, n) {
  1300. if (e.hitPolygon(t, n[0], n[1])) {
  1301. return true
  1302. }
  1303. var r, i, s, o, u, a, f, l, c, h;
  1304. for (r = 0, s = t.length; r < s; r++) {
  1305. i = r < s - 1 ? r + 1 : 0;
  1306. o = t[r], u = t[i];
  1307. a = new LVec2(n[0] - o[0], n[1] - o[1]), f = new LVec2(u[0] - o[0], u[1] - o[1]);
  1308. h = f.normalize();
  1309. c = LVec2.dot(a, h);
  1310. if (c <= 0) {
  1311. if (a.x * a.x + a.y * a.y < n[3]) {
  1312. return true
  1313. }
  1314. } else if (c * c < f.x * f.x + f.y * f.y) {
  1315. l = LVec2.cross(a, h);
  1316. if (l * l < n[3]) {
  1317. return true
  1318. }
  1319. }
  1320. }
  1321. return false
  1322. };
  1323. e.hitTestArc = function(e, t, n, r) {
  1324. var i = e.getWidth() * .5,
  1325. s = t.getWidth() * .5,
  1326. o = e._startX ? e._startX() : e.startX(),
  1327. u = t._startX ? t._startX() : t.startX(),
  1328. a = e._startY ? e._startY() : e.startY(),
  1329. f = t._startY ? t._startY() : t.startY();
  1330. if (typeof n != UNDEFINED) {
  1331. o += i - n;
  1332. a += i - n;
  1333. i = n
  1334. }
  1335. if (typeof r != UNDEFINED) {
  1336. u += s - r;
  1337. f += s - r;
  1338. s = r
  1339. }
  1340. var l = o + i - u - s,
  1341. c = a + i - f - s;
  1342. return l * l + c * c < (i + s) * (i + s)
  1343. };
  1344. e.hitTestRect = function(e, t, n, r) {
  1345. var i = e.getWidth(),
  1346. s = t.getWidth(),
  1347. o = e.getHeight(),
  1348. u = t.getHeight(),
  1349. a = e._startX ? e._startX() : e.startX(),
  1350. f = t._startX ? t._startX() : t.startX(),
  1351. l = e._startY ? e._startY() : e.startY(),
  1352. c = t._startY ? t._startY() : t.startY();
  1353. if (typeof n != UNDEFINED) {
  1354. a += (i - n[0]) * .5;
  1355. l += (o - n[1]) * .5;
  1356. i = n[0];
  1357. o = n[1]
  1358. }
  1359. if (typeof r != UNDEFINED) {
  1360. f += (s - r[0]) * .5;
  1361. c += (u - r[1]) * .5;
  1362. s = r[0];
  1363. u = r[1]
  1364. }
  1365. var h = a > f ? a : f,
  1366. p = l > c ? l : c,
  1367. d = a + i > f + s ? f + s : a + i,
  1368. v = l + o > c + u ? c + u : l + o;
  1369. return h <= d && p <= v
  1370. };
  1371. e.hitTest = e.hitTestRect;
  1372. e.setFrameRate = function(t) {
  1373. if (e.frameRate) {
  1374. clearInterval(e.frameRate)
  1375. }
  1376. e.speed = t;
  1377. e.frameRate = setInterval(function() {
  1378. e.onShow()
  1379. }, t)
  1380. };
  1381. e.ll_scaleX = function(t) {
  1382. return (t - e.left) * e.width / e.canvasStyleWidth
  1383. };
  1384. e.ll_scaleY = function(t) {
  1385. return (t - e.top) * e.height / e.canvasStyleHeight
  1386. };
  1387. e.ll_setStageSize = function(t, n) {
  1388. t = Math.ceil(t);
  1389. n = Math.ceil(n);
  1390. e.canvasObj.style.width = t + "px";
  1391. e.canvasObj.style.height = n + "px";
  1392. e.canvasStyleWidth = t;
  1393. e.canvasStyleHeight = n
  1394. };
  1395. e.resize = function(t, n) {
  1396. var r, i, s = 0,
  1397. o = 0,
  1398. u = window.innerWidth,
  1399. a = window.innerHeight;
  1400. if (t) {
  1401. r = t
  1402. }
  1403. if (n) {
  1404. i = n
  1405. }
  1406. if (e.stageScale == "noScale") {
  1407. r = t || e.width;
  1408. i = n || e.height
  1409. }
  1410. switch (e.stageScale) {
  1411. case "exactFit":
  1412. r = t || u;
  1413. i = n || a;
  1414. break;
  1415. case "noBorder":
  1416. r = t || u;
  1417. i = n || e.height * u / e.width;
  1418. switch (e.align) {
  1419. case LStageAlign.BOTTOM:
  1420. case LStageAlign.BOTTOM_LEFT:
  1421. case LStageAlign.BOTTOM_RIGHT:
  1422. case LStageAlign.BOTTOM_MIDDLE:
  1423. s = a - i;
  1424. break
  1425. }
  1426. break;
  1427. case "showAll":
  1428. if (u / a > e.width / e.height) {
  1429. i = n || a;
  1430. r = t || e.width * a / e.height
  1431. } else {
  1432. r = t || u;
  1433. i = n || e.height * u / e.width
  1434. };
  1435. case "noScale":
  1436. default:
  1437. switch (e.align) {
  1438. case LStageAlign.BOTTOM:
  1439. case LStageAlign.BOTTOM_LEFT:
  1440. s = a - i;
  1441. break;
  1442. case LStageAlign.RIGHT:
  1443. case LStageAlign.TOP_RIGHT:
  1444. o = u - r;
  1445. break;
  1446. case LStageAlign.TOP_MIDDLE:
  1447. o = (u - r) * .5;
  1448. break;
  1449. case LStageAlign.BOTTOM_RIGHT:
  1450. s = a - i;
  1451. o = u - r;
  1452. break;
  1453. case LStageAlign.BOTTOM_MIDDLE:
  1454. s = a - i;
  1455. o = (u - r) * .5;
  1456. break;
  1457. case LStageAlign.MIDDLE:
  1458. s = (a - i) * .5;
  1459. o = (u - r) * .5;
  1460. break;
  1461. case LStageAlign.TOP:
  1462. case LStageAlign.LEFT:
  1463. case LStageAlign.TOP_LEFT:
  1464. default:
  1465. }
  1466. }
  1467. e.canvasObj.style.marginTop = s + "px";
  1468. e.canvasObj.style.marginLeft = o + "px";
  1469. if (e.isFirefox) {
  1470. e.left = parseInt(e.canvasObj.style.marginLeft);
  1471. e.top = parseInt(e.canvasObj.style.marginTop)
  1472. }
  1473. e.ll_setStageSize(r, i)
  1474. };
  1475. e.sleep = function(e) {
  1476. var t = new Date;
  1477. while ((new Date).getTime() - t.getTime() < e) {}
  1478. };
  1479. e.screen = function(t) {
  1480. e.displayState = t;
  1481. if (e.stage) {
  1482. if (typeof e.displayState == "number") {
  1483. e.resize(e.width * e.displayState, e.height * e.displayState)
  1484. } else {
  1485. e.resize()
  1486. }
  1487. }
  1488. };
  1489. return e
  1490. }();
  1491. var LSystem = LGlobal;
  1492. var LStage = LGlobal;
  1493. if (!Array.prototype.indexOf) {
  1494. Array.prototype.indexOf = function(e) {
  1495. var t = this.length >>> 0;
  1496. var n = Number(arguments[1]) || 0;
  1497. n = n < 0 ? Math.ceil(n) : Math.floor(n);
  1498. if (n < 0) {
  1499. n += t
  1500. }
  1501. for (; n < t; n++) {
  1502. if (n in this && this[n] === e) {
  1503. return n
  1504. }
  1505. }
  1506. return -1
  1507. }
  1508. }
  1509. if (!Array.isArray) {
  1510. Array.isArray = function(e) {
  1511. return Object.prototype.toString.apply(e) == "[object Array]"
  1512. }
  1513. }
  1514. if (!Function.prototype.bind) {
  1515. Function.prototype.bind = function(e) {
  1516. if (typeof this !== "function") {
  1517. throw new TypeError("Function.prototype.bind-what is trying to be bound is not callable")
  1518. }
  1519. var t = Array.prototype.slice.call(arguments, 1),
  1520. n = this,
  1521. r = function() {},
  1522. i = function() {
  1523. return n.apply(this instanceof r && e ? this : e, t.concat(Array.prototype.slice.call(arguments)))
  1524. };
  1525. r.prototype = this.prototype;
  1526. i.prototype = new r;
  1527. return i
  1528. }
  1529. }
  1530. if (!Array.prototype.find) {
  1531. Array.prototype.find = function(e) {
  1532. if (this == null) {
  1533. throw new TypeError("Array.prototype.find called on null or undefined")
  1534. }
  1535. if (typeof e !== "function") {
  1536. throw new TypeError("predicate must be a function")
  1537. }
  1538. var t = Object(this);
  1539. var n = t.length >>> 0;
  1540. var r = arguments[1];
  1541. var i;
  1542. for (var s = 0; s < n; s++) {
  1543. i = t[s];
  1544. if (e.call(r, i, s, t)) {
  1545. return i
  1546. }
  1547. }
  1548. return undefined
  1549. }
  1550. }
  1551. if (!Array.prototype.findIndex) {
  1552. Array.prototype.findIndex = function(e) {
  1553. if (this == null) {
  1554. throw new TypeError("Array.prototype.find called on null or undefined")
  1555. }
  1556. if (typeof e !== "function") {
  1557. throw new TypeError("predicate must be a function")
  1558. }
  1559. var t = Object(this);
  1560. var n = t.length >>> 0;
  1561. var r = arguments[1];
  1562. var i;
  1563. for (var s = 0; s < n; s++) {
  1564. i = t[s];
  1565. if (e.call(r, i, s, t)) {
  1566. return s
  1567. }
  1568. }
  1569. return -1
  1570. }
  1571. }
  1572. if (!Array.prototype.forEach) {
  1573. Array.prototype.forEach = function(e, t) {
  1574. var n, r;
  1575. if (this == null) {
  1576. throw new TypeError(" this is null or not defined")
  1577. }
  1578. var i = Object(this);
  1579. var s = i.length >>> 0;
  1580. if (typeof e !== "function") {
  1581. throw new TypeError(e + " is not a function")
  1582. }
  1583. if (arguments.length > 1) {
  1584. n = t
  1585. }
  1586. r = 0;
  1587. while (r < s) {
  1588. var o;
  1589. if (r in i) {
  1590. o = i[r];
  1591. e.call(n, o, r, i)
  1592. }
  1593. r++
  1594. }
  1595. }
  1596. }
  1597. if (!Array.prototype.every) {
  1598. Array.prototype.every = function(e, t) {
  1599. "use strict";
  1600. var n, r;
  1601. if (this == null) {
  1602. throw new TypeError("this is null or not defined")
  1603. }
  1604. var i = Object(this);
  1605. var s = i.length >>> 0;
  1606. if (typeof e !== "function") {
  1607. throw new TypeError
  1608. }
  1609. if (arguments.length > 1) {
  1610. n = t
  1611. }
  1612. r = 0;
  1613. while (r < s) {
  1614. var o;
  1615. if (r in i) {
  1616. o = i[r];
  1617. var u = e.call(n, o, r, i);
  1618. if (!u) {
  1619. return false
  1620. }
  1621. }
  1622. r++
  1623. }
  1624. return true
  1625. }
  1626. }
  1627. if (!Array.prototype.some) {
  1628. Array.prototype.some = function(e) {
  1629. "use strict";
  1630. if (this == null) {
  1631. throw new TypeError("Array.prototype.some called on null or undefined")
  1632. }
  1633. if (typeof e !== "function") {
  1634. throw new TypeError
  1635. }
  1636. var t = Object(this);
  1637. var n = t.length >>> 0;
  1638. var r = arguments.length >= 2 ? arguments[1] : void 0;
  1639. for (var i = 0; i < n; i++) {
  1640. if (i in t && e.call(r, t[i], i, t)) {
  1641. return true
  1642. }
  1643. }
  1644. return false
  1645. }
  1646. }
  1647. if (!window.console) {
  1648. window.console = {
  1649. log: trace,
  1650. warn: trace
  1651. }
  1652. }
  1653. var LInit = init;
  1654. var LExtends = base;
  1655. var LObject = function() {
  1656. function e() {
  1657. this.type = "LObject";
  1658. this.objectIndex = ++LGlobal.objectIndex;
  1659. this.objectindex = this.objectIndex
  1660. }
  1661. e.prototype = {
  1662. callParent: function(e, t) {
  1663. if (!e || !t) {
  1664. return
  1665. }
  1666. var n = this,
  1667. r = false,
  1668. i, s = "__ll__parent_call" + e;
  1669. if (typeof n[s] == "undefined") {
  1670. r = true;
  1671. n[s] = 0
  1672. } else {
  1673. n[s]++
  1674. } if (n[s] >= n.__ll__parent__.length) {
  1675. return false
  1676. }
  1677. if (!n.__ll__parent__[n[s]][e]) {
  1678. i = n.callParent(e, t)
  1679. } else {
  1680. i = n.__ll__parent__[n[s]][e].apply(n, t)
  1681. } if (r) {
  1682. delete n[s]
  1683. }
  1684. return i
  1685. },
  1686. toString: function() {
  1687. return "[object " + this.constructor.name + "]"
  1688. }
  1689. };
  1690. return e
  1691. }();
  1692. var LColorTransform = function() {
  1693. function e(e, t, n, r, i, s, o, u) {
  1694. var a = this;
  1695. LExtends(a, LObject, []);
  1696. a.redMultiplier = e;
  1697. a.greenMultiplier = t;
  1698. a.blueMultiplier = n;
  1699. a.alphaMultiplier = r;
  1700. a.redOffset = i;
  1701. a.greenOffset = s;
  1702. a.blueOffset = o;
  1703. a.alphaOffset = u
  1704. }
  1705. return e
  1706. }();
  1707. var LMatrix = function() {
  1708. function e(e, t, n, r, i, s, o, u, a) {
  1709. var f = this;
  1710. f.a = 1;
  1711. f.b = 0;
  1712. f.u = 0;
  1713. f.c = 0;
  1714. f.d = 1;
  1715. f.v = 0;
  1716. f.tx = 0;
  1717. f.ty = 0;
  1718. f.w = 1;
  1719. if (typeof e != UNDEFINED) {
  1720. f.a = e
  1721. }
  1722. if (typeof t != UNDEFINED) {
  1723. f.b = t
  1724. }
  1725. if (typeof n != UNDEFINED) {
  1726. f.c = n
  1727. }
  1728. if (typeof r != UNDEFINED) {
  1729. f.d = r
  1730. }
  1731. if (typeof i != UNDEFINED) {
  1732. f.tx = i
  1733. }
  1734. if (typeof s != UNDEFINED) {
  1735. f.ty = s
  1736. }
  1737. if (typeof o != UNDEFINED) {
  1738. f.u = o
  1739. }
  1740. if (typeof u != UNDEFINED) {
  1741. f.v = u
  1742. }
  1743. if (typeof a != UNDEFINED) {
  1744. f.w = a
  1745. }
  1746. }
  1747. e.prototype = {
  1748. setTo: function(e, t, n, r, i, s, o, u, a) {
  1749. var f = this;
  1750. if (typeof e != UNDEFINED) {
  1751. f.a = e
  1752. }
  1753. if (typeof t != UNDEFINED) {
  1754. f.b = t
  1755. }
  1756. if (typeof n != UNDEFINED) {
  1757. f.c = n
  1758. }
  1759. if (typeof r != UNDEFINED) {
  1760. f.d = r
  1761. }
  1762. if (typeof i != UNDEFINED) {
  1763. f.tx = i
  1764. }
  1765. if (typeof s != UNDEFINED) {
  1766. f.ty = s
  1767. }
  1768. if (typeof o != UNDEFINED) {
  1769. f.u = o
  1770. }
  1771. if (typeof u != UNDEFINED) {
  1772. f.v = u
  1773. }
  1774. if (typeof a != UNDEFINED) {
  1775. f.w = a
  1776. }
  1777. return f
  1778. },
  1779. isIdentity: function() {
  1780. var e = this;
  1781. return e.a == 1 && e.b == 0 && e.c == 0 && e.d == 1 && e.tx == 0 && e.ty == 0 && u == 0 && v == 0 && w == 1
  1782. },
  1783. transform: function(e) {
  1784. var t = this;
  1785. e.transform(t.a, t.b, t.c, t.d, t.tx, t.ty);
  1786. return t
  1787. },
  1788. toString: function() {
  1789. return "[object LMatrix]"
  1790. },
  1791. identity: function() {
  1792. this.setTo(1, 0, 0, 1, 0, 0, 0, 0, 1)
  1793. },
  1794. rotate: function(t) {
  1795. var n = this,
  1796. r = t * Math.PI / 180,
  1797. i = Math.cos(r),
  1798. s = Math.sin(r),
  1799. o = new e(i, s, -s, i, 0, 0, 0, 0, 1);
  1800. n.add(o)
  1801. },
  1802. scale: function(t, n) {
  1803. var r = this,
  1804. i = new e(t, 0, 0, n, 0, 0, 0, 0, 1);
  1805. r.add(i)
  1806. },
  1807. translate: function(t, n) {
  1808. var r = this,
  1809. i = new e(1, 0, 0, 1, t, n, 0, 0, 1);
  1810. r.add(i)
  1811. },
  1812. skew: function(t, n) {
  1813. mtx = new e(0, n, t, 0, 0, 0, 0, 0, 1);
  1814. s.add(mtx)
  1815. },
  1816. add: function(e) {
  1817. var t = this,
  1818. n, r, i, s, o, u, a, f, l;
  1819. n = t.a * e.a + t.b * e.c + t.u * e.tx;
  1820. r = t.a * e.b + t.b * e.d + t.u * e.ty;
  1821. a = t.a * e.u + t.b * e.v + t.u * e.w;
  1822. i = t.c * e.a + t.d * e.c + t.v * e.tx;
  1823. s = t.c * e.b + t.d * e.d + t.v * e.ty;
  1824. f = t.c * e.u + t.d * e.v + t.v * e.w;
  1825. o = t.tx * e.a + t.ty * e.c + t.w * e.tx;
  1826. u = t.tx * e.b + t.ty * e.d + t.w * e.ty;
  1827. l = t.tx * e.u + t.ty * e.v + t.w * e.w;
  1828. t.setTo(n, r, i, s, o, u, a, f, l)
  1829. },
  1830. toArray: function(e) {
  1831. var t = this;
  1832. if (Array.isArray(e) && e.length == 3) {
  1833. var n = e[0] * t.a + e[1] * t.c + e[2] * t.tx,
  1834. r = e[0] * t.b + e[1] * t.d + e[2] * t.ty,
  1835. i = e[0] * t.u + e[1] * t.v + e[2] * t.w;
  1836. return [n, r, i]
  1837. } else {
  1838. var s = t.a * e.a + t.b * e.c + t.u * e.tx,
  1839. o = t.a * e.b + t.b * e.d + t.u * e.ty,
  1840. u = t.a * e.u + t.b * e.v + t.u * e.w,
  1841. a = t.c * e.a + t.d * e.c + t.v * e.tx,
  1842. f = t.c * e.b + t.d * e.d + t.v * e.ty,
  1843. l = t.c * e.u + t.d * e.v + t.v * e.w,
  1844. c = t.tx * e.a + t.ty * e.c + t.w * e.tx,
  1845. h = t.tx * e.b + t.ty * e.d + t.w * e.ty,
  1846. p = t.tx * e.u + t.ty * e.v + t.w * e.w;
  1847. return [s, o, a, f, c, h, u, l, p]
  1848. }
  1849. },
  1850. clone: function() {
  1851. var t = this;
  1852. return new e(t.a, t.b, t.c, t.d, t.tx, t.ty, t.u, t.v, t.w)
  1853. }
  1854. };
  1855. return e
  1856. }();
  1857. var LVec2 = function() {
  1858. function e(e, t) {
  1859. this.x = e || 0;
  1860. this.y = t || 0
  1861. }
  1862. e.dot = function(e, t) {
  1863. return e.x * t.x + e.y * t.y
  1864. };
  1865. e.cross = function(e, t) {
  1866. return e.x * t.y - e.y * t.x
  1867. };
  1868. e.distance = function(e, t) {
  1869. var n = e.x - t.x;
  1870. var r = e.y - t.y;
  1871. return Math.sqrt(n * n + r * r)
  1872. };
  1873. e.getMinMax = function(t, n) {
  1874. var r = e.dot(t[0], n);
  1875. var i = e.dot(t[0], n);
  1876. var s = 0;
  1877. var o = 0;
  1878. for (var u = 1; u < t.length; u++) {
  1879. var a = e.dot(t[u], n);
  1880. if (r > a) {
  1881. r = a;
  1882. s = u
  1883. }
  1884. if (i < a) {
  1885. i = a;
  1886. o = u
  1887. }
  1888. }
  1889. var f = {
  1890. min_o: r,
  1891. min_i: s,
  1892. max_o: i,
  1893. max_i: o
  1894. };
  1895. return f
  1896. };
  1897. e.prototype = {
  1898. length: function() {
  1899. var e = this;
  1900. return Math.sqrt(e.x * e.x + e.y * e.y)
  1901. },
  1902. normalize: function() {
  1903. var t = this,
  1904. n = t.length();
  1905. return new e(t.x / n, t.y / n)
  1906. },
  1907. normR: function() {
  1908. return new e(-this.y, this.x)
  1909. },
  1910. normL: function() {
  1911. return new e(this.y, -this.x)
  1912. }
  1913. };
  1914. return e
  1915. }();
  1916. var LEventDispatcher = function() {
  1917. function e() {
  1918. var e = this;
  1919. LExtends(e, LObject, []);
  1920. e._eventList = new Array
  1921. }
  1922. var t = {
  1923. addEventListener: function(e, t) {
  1924. this._eventList.push({
  1925. listener: t,
  1926. type: e
  1927. })
  1928. },
  1929. removeEventListener: function(e, t) {
  1930. var n = this,
  1931. r, i;
  1932. i = n._eventList.length;
  1933. for (r = 0; r < i; r++) {
  1934. if (!n._eventList[r]) {
  1935. continue
  1936. }
  1937. if (e == n._eventList[r].type && n._eventList[r].listener == t) {
  1938. n._eventList.splice(r, 1);
  1939. return
  1940. }
  1941. }
  1942. },
  1943. removeAllEventListener: function() {
  1944. this._eventList = []
  1945. },
  1946. dispatchEvent: function(e) {
  1947. var t = this,
  1948. n, r = t._eventList.length,
  1949. i = typeof e == "string" ? e : e.eventType;
  1950. for (n = 0; n < r; n++) {
  1951. if (!t._eventList[n]) {
  1952. continue
  1953. }
  1954. if (i == t._eventList[n].type) {
  1955. if (typeof e == "string") {
  1956. t.currentTarget = t.target = t;
  1957. t.eventType = t.event_type = i;
  1958. t._eventList[n].listener(t)
  1959. } else {
  1960. if (!e.target) {
  1961. e.target = t
  1962. }
  1963. if (!e.currentTarget) {
  1964. e.currentTarget = e.target
  1965. }
  1966. e._ll_preventDefault = false;
  1967. t._eventList[n].listener(e);
  1968. if (e._ll_preventDefault) {
  1969. return false
  1970. }
  1971. }
  1972. return true
  1973. }
  1974. }
  1975. return false
  1976. },
  1977. hasEventListener: function(e, t) {
  1978. var n = this,
  1979. r, i = n._eventList.length;
  1980. for (r = 0; r < i; r++) {
  1981. if (!n._eventList[r]) {
  1982. continue
  1983. }
  1984. if (e == n._eventList[r].type) {
  1985. if (typeof t == UNDEFINED || t == n._eventList[r].listener) {
  1986. return true
  1987. }
  1988. }
  1989. }
  1990. return false
  1991. }
  1992. };
  1993. for (var n in t) {
  1994. e.prototype[n] = t[n]
  1995. }
  1996. return e
  1997. }();
  1998. var LDisplayObject = function() {
  1999. function e() {
  2000. var e = this;
  2001. LExtends(e, LEventDispatcher, []);
  2002. e.name = "instance" + e.objectIndex;
  2003. e.x = 0;
  2004. e.y = 0;
  2005. e.width = 0;
  2006. e.height = 0;
  2007. e.scaleX = 1;
  2008. e.scaleY = 1;
  2009. e.alpha = 1;
  2010. e.visible = true;
  2011. e.rotate = 0;
  2012. e.mask = null;
  2013. e.blendMode = null;
  2014. e.filters = null
  2015. }
  2016. var t = {
  2017. _createCanvas: function() {
  2018. var e = this;
  2019. if (!e._canvas) {
  2020. e._canvas = document.createElement("canvas");
  2021. e._context = e._canvas.getContext("2d")
  2022. }
  2023. },
  2024. ll_show: function() {
  2025. var e = this,
  2026. t = LGlobal.canvas;
  2027. if (!e._canShow()) {
  2028. return
  2029. }
  2030. if (!LGlobal.box2d && typeof e._ll_loopframe == "function") {
  2031. e._ll_loopframe()
  2032. }
  2033. t.save();
  2034. e._showReady(t);
  2035. if (e.blendMode) {
  2036. t.globalCompositeOperation = e.blendMode
  2037. }
  2038. if (e.filters) {
  2039. e._ll_setShadow()
  2040. }
  2041. e._rotateReady();
  2042. if (e.mask != null && e.mask.ll_show) {
  2043. e.mask.ll_show();
  2044. t.clip()
  2045. }
  2046. e._transformRotate();
  2047. e._transformScale();
  2048. e._coordinate(t);
  2049. if (e.alpha < 1) {
  2050. t.globalAlpha = e.alpha
  2051. }
  2052. e._ll_show(t);
  2053. t.restore();
  2054. if (LGlobal.box2d != null && typeof e._ll_loopframe == "function") {
  2055. e._ll_loopframe()
  2056. }
  2057. },
  2058. _canShow: function() {
  2059. return this.visible
  2060. },
  2061. _coordinate: function(e) {
  2062. var t = this;
  2063. if (t.x != 0 || t.y != 0) {
  2064. e.transform(1, 0, 0, 1, t.x, t.y)
  2065. }
  2066. },
  2067. _rotateReady: function() {},
  2068. _showReady: function(e) {},
  2069. _ll_show: function(e) {},
  2070. _ll_setShadow: function() {
  2071. var e = this,
  2072. t = e.filters,
  2073. n, r;
  2074. if (!t) {
  2075. return
  2076. }
  2077. for (n = 0, r = t.length; n < r; n++) {
  2078. t[n].ll_show()
  2079. }
  2080. },
  2081. _transformRotate: function() {
  2082. var e = this,
  2083. t;
  2084. if (e.rotate == 0) {
  2085. return
  2086. }
  2087. t = LGlobal.canvas, rotateFlag = Math.PI / 180, rotateObj = new LMatrix;
  2088. if (typeof e.rotatex == UNDEFINED) {
  2089. e.rotatex = 0;
  2090. e.rotatey = 0
  2091. }
  2092. if (e.box2dBody) {
  2093. rotateFlag = 1
  2094. }
  2095. rotateObj.a = Math.cos(e.rotate * rotateFlag);
  2096. rotateObj.b = Math.sin(e.rotate * rotateFlag);
  2097. rotateObj.c = -rotateObj.b;
  2098. rotateObj.d = rotateObj.a;
  2099. rotateObj.tx = e.x + e.rotatex;
  2100. rotateObj.ty = e.y + e.rotatey;
  2101. rotateObj.transform(t).setTo(1, 0, 0, 1, -rotateObj.tx, -rotateObj.ty).transform(t)
  2102. },
  2103. _transformScale: function() {
  2104. var e = this,
  2105. t = LGlobal.canvas,
  2106. n;
  2107. if (e.scaleX == 1 && e.scaleY == 1) {
  2108. return
  2109. }
  2110. n = new LMatrix;
  2111. if (e.scaleX != 1) {
  2112. n.tx = e.x
  2113. }
  2114. if (e.scaleY != 1) {
  2115. n.ty = e.y
  2116. }
  2117. n.a = e.scaleX;
  2118. n.d = e.scaleY;
  2119. n.transform(t).setTo(1, 0, 0, 1, -n.tx, -n.ty).transform(t)
  2120. },
  2121. copyProperty: function(e) {
  2122. var t = this,
  2123. n;
  2124. for (n in e) {
  2125. if (typeof e[n] == "number" || typeof e[n] == "string" || typeof e[n] == "boolean") {
  2126. if (n == "objectindex" || n == "objectIndex") {
  2127. continue
  2128. }
  2129. t[n] = e[n]
  2130. } else if (Array.isArray(e[n])) {
  2131. t[n] = e[n].slice()
  2132. }
  2133. }
  2134. if (e.mask) {
  2135. t.mask = e.mask.clone()
  2136. }
  2137. },
  2138. getAbsoluteScale: function() {
  2139. var e = this,
  2140. t, n, r;
  2141. t = e.scaleX;
  2142. n = e.scaleY;
  2143. r = e.parent;
  2144. while (r && r != "root") {
  2145. t *= r.scaleX;
  2146. n *= r.scaleY;
  2147. r = r.parent
  2148. }
  2149. return {
  2150. scaleX: t,
  2151. scaleY: n
  2152. }
  2153. },
  2154. getRootCoordinate: function() {
  2155. var e = this,
  2156. t, n, r;
  2157. t = e.x;
  2158. n = e.y;
  2159. r = e.parent;
  2160. while (r && r != "root") {
  2161. t *= r.scaleX;
  2162. n *= r.scaleY;
  2163. t += r.x;
  2164. n += r.y;
  2165. r = r.parent
  2166. }
  2167. return new LPoint(t, n)
  2168. },
  2169. getBounds: function(e) {
  2170. if (typeof e == UNDEFINED) {
  2171. return new LRectangle(0, 0, 0, 0)
  2172. }
  2173. var t = this,
  2174. n = 0,
  2175. r = 0,
  2176. i = 0,
  2177. s = 0,
  2178. o, u;
  2179. if (t.objectIndex != e.objectIndex) {
  2180. o = t.getRootCoordinate();
  2181. u = e.getRootCoordinate();
  2182. n = o.x - u.x;
  2183. r = o.y - u.y
  2184. }
  2185. if (e.getWidth) {
  2186. i = e.getWidth()
  2187. }
  2188. if (e.getHeight) {
  2189. s = e.getHeight()
  2190. }
  2191. return new LRectangle(n, r, i, s)
  2192. },
  2193. getDataCanvas: function() {
  2194. var e = this,
  2195. t, n, r, i, s, o;
  2196. e._createCanvas();
  2197. n = LGlobal.canvasObj;
  2198. i = LGlobal.canvas;
  2199. t = e._canvas;
  2200. r = e._context;
  2201. e.width = e.getWidth();
  2202. e.height = e.getHeight();
  2203. t.width = e.width;
  2204. t.height = e.height;
  2205. r.clearRect(0, 0, e.width, e.height);
  2206. LGlobal.canvasObj = e._canvas;
  2207. LGlobal.canvas = e._context;
  2208. s = e.x;
  2209. o = e.y;
  2210. e.x = e.y = 0;
  2211. e.ll_show();
  2212. e.x = s;
  2213. e.y = o;
  2214. e._canvas = t;
  2215. e._context = r;
  2216. LGlobal.canvasObj = n;
  2217. LGlobal.canvas = i;
  2218. return e._canvas
  2219. },
  2220. getDataURL: function() {
  2221. var e = this,
  2222. t = e.getDataCanvas();
  2223. return t.toDataURL.apply(t, arguments)
  2224. },
  2225. ismouseonShapes: function(e, t, n) {
  2226. var r = this,
  2227. i = r,
  2228. s, o, u, a, f;
  2229. if (typeof e == UNDEFINED) {
  2230. e = r.shapes
  2231. }
  2232. s = r.getRootMatrix();
  2233. for (u = e.length - 1; u >= 0; u--) {
  2234. o = e[u];
  2235. f = o.arg;
  2236. a = r._changeShape(o.type, f, s);
  2237. if (o.type == LShape.VERTICES) {
  2238. if (LGlobal.hitPolygon(a, t, n)) {
  2239. return true
  2240. }
  2241. } else if (o.type == LShape.RECT) {
  2242. if (LGlobal.hitPolygon(a, t, n)) {
  2243. return true
  2244. }
  2245. } else if (o.type == LShape.ARC) {
  2246. if ((a[0] - t) * (a[0] - t) + (a[1] - n) * (a[1] - n) < a[3]) {
  2247. return true
  2248. }
  2249. }
  2250. }
  2251. return false
  2252. },
  2253. _changeShape: function(e, t, n) {
  2254. var r, t = t,
  2255. i, s, o, u, a;
  2256. if (e == LShape.VERTICES) {
  2257. r = [];
  2258. for (s = 0, o = t.length; s < o; s++) {
  2259. r[s] = n.toArray([t[s][0], t[s][1], 1])
  2260. }
  2261. } else if (e == LShape.RECT) {
  2262. r = [
  2263. [t[0], t[1]],
  2264. [t[0] + t[2], t[1]],
  2265. [t[0] + t[2], t[1] + t[3]],
  2266. [t[0], t[1] + t[3]]
  2267. ];
  2268. for (s = 0, o = r.length; s < o; s++) {
  2269. r[s] = n.toArray([r[s][0], r[s][1], 1])
  2270. }
  2271. } else if (e == LShape.ARC) {
  2272. u = n.toArray([t[0], t[1], 1]);
  2273. a = n.toArray([t[0] + t[2], t[1], 1]);
  2274. i = (u[0] - a[0]) * (u[0] - a[0]) + (u[1] - a[1]) * (u[1] - a[1]);
  2275. r = [u[0], u[1], Math.sqrt(i), i]
  2276. }
  2277. return r
  2278. },
  2279. getRootMatrix: function() {
  2280. var e = this,
  2281. t = new LMatrix;
  2282. while (e && e != "root") {
  2283. if (e.scaleX != 1 || e.scaleY != 1) {
  2284. t.scale(e.scaleX, e.scaleY)
  2285. }
  2286. if (e.rotate != 0) {
  2287. t.rotate(e.rotate)
  2288. }
  2289. if (e.x != 0 || e.y != 0) {
  2290. t.translate(e.x, e.y)
  2291. }
  2292. e = e.parent
  2293. }
  2294. return t
  2295. },
  2296. remove: function() {
  2297. var e = this,
  2298. t = e.parent;
  2299. if (!t || t == "root") {
  2300. return
  2301. }
  2302. t.removeChild(e)
  2303. }
  2304. };
  2305. for (var n in t) {
  2306. e.prototype[n] = t[n]
  2307. }
  2308. return e
  2309. }();
  2310. var LInteractiveObject = function() {
  2311. function e() {
  2312. var e = this;
  2313. LExtends(e, LDisplayObject, []);
  2314. e.type = "LInteractiveObject";
  2315. e.mouseEnabled = true;
  2316. e.mouseList = new Array
  2317. }
  2318. var t = {
  2319. addEventListener: function(e, t) {
  2320. var n = this;
  2321. if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
  2322. if (LMouseEventContainer.container[e] || (e == LMouseEvent.MOUSE_OVER || e == LMouseEvent.MOUSE_OUT) && LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
  2323. LMouseEventContainer.addMouseEvent(n, e, t);
  2324. return
  2325. }
  2326. n.mouseList.push({
  2327. listener: t,
  2328. type: e
  2329. })
  2330. } else {
  2331. n._eventList.push({
  2332. listener: t,
  2333. type: e
  2334. })
  2335. }
  2336. },
  2337. removeEventListener: function(e, t) {
  2338. var n = this,
  2339. r, i;
  2340. if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
  2341. if (LMouseEventContainer.container[e] || (e == LMouseEvent.MOUSE_OVER || e == LMouseEvent.MOUSE_OUT) && LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
  2342. LMouseEventContainer.removeMouseEvent(n, e, t);
  2343. return
  2344. }
  2345. i = n.mouseList.length;
  2346. for (r = 0; r < i; r++) {
  2347. if (!n.mouseList[r]) {
  2348. continue
  2349. }
  2350. if (e == n.mouseList[r].type && n.mouseList[r].listener == t) {
  2351. n.mouseList.splice(r, 1);
  2352. return
  2353. }
  2354. }
  2355. } else {
  2356. return n.callParent("removeEventListener", arguments)
  2357. }
  2358. },
  2359. removeAllEventListener: function() {
  2360. var e = this;
  2361. e.mouseList.length = 0;
  2362. e._eventList.length = 0;
  2363. if (LMouseEventContainer.container[LMouseEvent.MOUSE_DOWN]) {
  2364. LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_DOWN)
  2365. }
  2366. if (LMouseEventContainer.container[LMouseEvent.MOUSE_UP]) {
  2367. LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_UP)
  2368. }
  2369. if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
  2370. LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_MOVE);
  2371. LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_OVER);
  2372. LMouseEventContainer.removeMouseEvent(e, LMouseEvent.MOUSE_OUT)
  2373. }
  2374. },
  2375. hasEventListener: function(e) {
  2376. var t = this,
  2377. n, r;
  2378. if (e.indexOf("mouse") >= 0 || e.indexOf("touch") >= 0 || e == LMouseEvent.DOUBLE_CLICK) {
  2379. r = t.mouseList.length;
  2380. for (n = 0; n < r; n++) {
  2381. if (!t.mouseList[n]) {
  2382. continue
  2383. }
  2384. if (e == t.mouseList[n].type) {
  2385. return true
  2386. }
  2387. }
  2388. } else {
  2389. return t.callParent("hasEventListener", arguments)
  2390. }
  2391. return false
  2392. }
  2393. };
  2394. for (var n in t) {
  2395. e.prototype[n] = t[n]
  2396. }
  2397. return e
  2398. }();
  2399. var LDisplayObjectContainer = function() {
  2400. function e() {
  2401. var e = this;
  2402. LExtends(e, LInteractiveObject, []);
  2403. e.childList = new Array;
  2404. e.numChildren = 0;
  2405. e.mouseChildren = true
  2406. }
  2407. var t = {
  2408. addChild: function(e) {
  2409. var t = this,
  2410. n;
  2411. if (e.parent) {
  2412. n = LGlobal.destroy;
  2413. LGlobal.destroy = false;
  2414. e.parent.removeChild(e);
  2415. LGlobal.destroy = n
  2416. }
  2417. e.parent = t;
  2418. t.childList.push(e);
  2419. t.numChildren = t.childList.length;
  2420. return e
  2421. },
  2422. addChildAt: function(e, t) {
  2423. var n = this,
  2424. r;
  2425. if (t < 0 || t > n.childList.length) {
  2426. return
  2427. }
  2428. if (typeof e.remove == "function") {
  2429. r = LGlobal.destroy;
  2430. LGlobal.destroy = false;
  2431. e.remove();
  2432. LGlobal.destroy = r
  2433. }
  2434. e.parent = n;
  2435. n.childList.splice(t, 0, e);
  2436. n.numChildren = n.childList.length;
  2437. return e
  2438. },
  2439. removeChild: function(e) {
  2440. var t = this,
  2441. n = t.childList,
  2442. r, i;
  2443. for (r = 0, i = n.length; r < i; r++) {
  2444. if (e.objectIndex == n[r].objectIndex) {
  2445. if (LGlobal.destroy && e.die) {
  2446. e.die()
  2447. }
  2448. t.childList.splice(r, 1);
  2449. break
  2450. }
  2451. }
  2452. t.numChildren = t.childList.length;
  2453. delete e.parent
  2454. },
  2455. getChildAt: function(e) {
  2456. var t = this,
  2457. n = t.childList;
  2458. if (n.length == 0 || n.length <= e) {
  2459. return null
  2460. }
  2461. return n[e]
  2462. },
  2463. getChildByName: function(e) {
  2464. var t = this,
  2465. n = t.childList;
  2466. for (i = 0, l = n.length; i < l; i++) {
  2467. if (!n[i]) {
  2468. continue
  2469. }
  2470. if (n[i].name == e) {
  2471. return n[i]
  2472. }
  2473. }
  2474. return null
  2475. },
  2476. removeChildAt: function(e) {
  2477. var t = this,
  2478. n = t.childList;
  2479. if (n.length <= e) {
  2480. return
  2481. }
  2482. if (LGlobal.destroy && n[e].die) {
  2483. n[e].die()
  2484. }
  2485. var r = t.childList.splice(e, 1);
  2486. t.numChildren = t.childList.length;
  2487. return r
  2488. },
  2489. getChildIndex: function(e) {
  2490. if (!e) {
  2491. return -1
  2492. }
  2493. var t = this,
  2494. n = t.childList,
  2495. r, i = n.length;
  2496. for (r = 0; r < i; r++) {
  2497. if (n[r].objectIndex == e.objectIndex) {
  2498. return r
  2499. }
  2500. }
  2501. return -1
  2502. },
  2503. setChildIndex: function(e, t) {
  2504. var n = this,
  2505. r = n.childList,
  2506. i, s = r.length;
  2507. if (e.parent == "root" || e.parent.objectIndex != n.objectIndex || t < 0 || t >= s) {
  2508. return -1
  2509. }
  2510. for (i = 0; i < s; i++) {
  2511. if (r[i].objectIndex == e.objectIndex) {
  2512. break
  2513. }
  2514. }
  2515. n.childList.splice(i, 1);
  2516. n.childList.splice(t, 0, e);
  2517. return t
  2518. },
  2519. resize: function() {
  2520. var e = this;
  2521. e.width = e.getWidth();
  2522. e.height = e.getHeight()
  2523. },
  2524. removeAllChild: function() {
  2525. var e = this,
  2526. t = e.childList,
  2527. n, r;
  2528. for (n = 0, r = t.length; n < r; n++) {
  2529. if (LGlobal.destroy && t[n].die) {
  2530. t[n].die()
  2531. }
  2532. }
  2533. e.childList.length = 0;
  2534. e.width = 0;
  2535. e.height = 0;
  2536. e.numChildren = 0
  2537. }
  2538. };
  2539. for (var n in t) {
  2540. e.prototype[n] = t[n]
  2541. }
  2542. return e
  2543. }();
  2544. var LLoader = function() {
  2545. function e() {
  2546. var e = this;
  2547. LExtends(e, LEventDispatcher, []);
  2548. e.type = "LLoader"
  2549. }
  2550. e.TYPE_BITMAPDATE = "bitmapData";
  2551. e.prototype.load = function(t, n) {
  2552. var r = this;
  2553. if (!n) {
  2554. n = e.TYPE_BITMAPDATE
  2555. }
  2556. r.loadtype = n;
  2557. if (n == e.TYPE_BITMAPDATE) {
  2558. r.content = new Image;
  2559. r.content.onload = function() {
  2560. r.content.onload = null;
  2561. var e = new LEvent(LEvent.COMPLETE);
  2562. e.currentTarget = r;
  2563. e.target = r.content;
  2564. r.dispatchEvent(e);
  2565. delete r.content
  2566. };
  2567. r.content.src = t
  2568. }
  2569. };
  2570. return e
  2571. }();
  2572. var LURLLoader = function() {
  2573. function e() {
  2574. var e = this;
  2575. LExtends(e, LEventDispatcher, []);
  2576. e.type = "LURLLoader";
  2577. e.loadtype = "";
  2578. e.content = null;
  2579. e.event = {}
  2580. }
  2581. e.TYPE_TEXT = "text";
  2582. e.TYPE_JS = "js";
  2583. e.prototype.load = function(t, n) {
  2584. var r = this,
  2585. i, s;
  2586. if (!n) {
  2587. s = getExtension(t);
  2588. if (s == "txt") {
  2589. n = e.TYPE_TEXT
  2590. } else if (s == "js") {
  2591. n = e.TYPE_JS
  2592. }
  2593. }
  2594. r.loadtype = n;
  2595. if (n == e.TYPE_TEXT) {
  2596. LAjax.get(t, {}, function(e) {
  2597. i = new LEvent(LEvent.COMPLETE);
  2598. r.data = e;
  2599. i.currentTarget = r;
  2600. i.target = e;
  2601. r.dispatchEvent(i);
  2602. delete r.content;
  2603. delete r.data
  2604. })
  2605. } else if (n == e.TYPE_JS) {
  2606. var o = document.createElement("script");
  2607. o.onload = function() {
  2608. i = new LEvent(LEvent.COMPLETE);
  2609. i.currentTarget = r;
  2610. i.target = r;
  2611. r.dispatchEvent(i);
  2612. delete r.content
  2613. };
  2614. o.src = t;
  2615. o.type = "text/javascript";
  2616. document.querySelector("head").appendChild(o)
  2617. }
  2618. };
  2619. return e
  2620. }();
  2621. var LWebAudio = function() {
  2622. function e() {
  2623. var e = this;
  2624. LExtends(e, LEventDispatcher, []);
  2625. e.currentTime = 0;
  2626. e.currentStart = 0;
  2627. e.currentSave = 0;
  2628. e.length = 0;
  2629. e.loopStart = 0;
  2630. e.loopEnd = 0;
  2631. e.loopIndex = 0;
  2632. e.loopLength = 1;
  2633. e.playing = false;
  2634. e.volume = 1;
  2635. LSound.Container.add(e)
  2636. }
  2637. e.container = [];
  2638. e.containerCount = 0;
  2639. e.audioTag = new Audio;
  2640. e._context = null;
  2641. var t = {
  2642. getWebAudio: function() {
  2643. var t;
  2644. if (e.containerCount > 0) {
  2645. t = e.container.shift()
  2646. } else {
  2647. if (typeof webkitAudioContext !== UNDEFINED) {
  2648. try {
  2649. t = new webkitAudioContext
  2650. } catch (n) {
  2651. e.containerCount = e.container.length;
  2652. t = e.container.shift()
  2653. }
  2654. } else if (typeof AudioContext !== UNDEFINED) {
  2655. try {
  2656. t = new AudioContext
  2657. } catch (n) {
  2658. e.containerCount = e.container.length;
  2659. t = e.container.shift()
  2660. }
  2661. } else {
  2662. throw "AudioContext not supported.:("
  2663. }
  2664. } if (!t.createGainNode) {
  2665. t.createGainNode = t.createGain
  2666. }
  2667. e.container.push(t);
  2668. return t
  2669. },
  2670. onload: function(e) {
  2671. var t = this;
  2672. if (Object.prototype.toString.apply(e) !== "[object AudioBuffer]") {
  2673. t.load(e);
  2674. return
  2675. }
  2676. if (!t.data) {
  2677. t.data = t.getWebAudio()
  2678. }
  2679. t.buffer = e;
  2680. t.length = t.buffer.duration;
  2681. var n = new LEvent(LEvent.COMPLETE);
  2682. n.currentTarget = t;
  2683. n.target = t.buffer;
  2684. t.dispatchEvent(n)
  2685. },
  2686. _onended: function() {
  2687. var e = this;
  2688. e.dispatchEvent(LEvent.SOUND_COMPLETE);
  2689. if (++e.loopIndex < e.loopLength) {
  2690. e.play(e.currentStart, undefined, e.currentTimeTo)
  2691. } else {
  2692. e.close()
  2693. }
  2694. },
  2695. load: function(t) {
  2696. var n = this;
  2697. if (typeof t !== "string") {
  2698. if (Object.prototype.toString.apply(t) == "[object AudioBuffer]") {
  2699. n.onload(t)
  2700. } else if (Object.prototype.toString.apply(t) == "[object ArrayBuffer]") {
  2701. if (!n.data) {
  2702. n.data = n.getWebAudio()
  2703. }
  2704. n.data.decodeAudioData(t, n.onload.bind(n), function(e) {
  2705. throw "AudioContext decodeAudioData error:" + e.toString()
  2706. })
  2707. }
  2708. return
  2709. }
  2710. var r, i, s, o, u, a = {
  2711. mov: ["quicktime"],
  2712. "3gp": ["3gpp"],
  2713. midi: ["midi"],
  2714. mid: ["midi"],
  2715. ogv: ["ogg"],
  2716. m4a: ["acc"],
  2717. mp3: ["mpeg"],
  2718. wav: ["wav", "x-wav", "wave"],
  2719. wave: ["wav", "x-wav", "wave"],
  2720. aac: ["mp4", "aac"]
  2721. };
  2722. r = t.split(",");
  2723. for (o = 0; o < r.length; o++) {
  2724. i = r[o].split(".");
  2725. u = i[i.length - 1];
  2726. if (a[u]) {
  2727. u = a[u]
  2728. } else {
  2729. u = [u]
  2730. }
  2731. s = u.some(function(t, r, i) {
  2732. return e.audioTag.canPlayType(n._type + "/" + t)
  2733. });
  2734. if (s) {
  2735. LAjax.responseType = LAjax.ARRAY_BUFFER;
  2736. LAjax.get(r[o], {}, n.onload.bind(n));
  2737. return
  2738. } else {
  2739. console.warn("Not support " + i[i.length - 1] + ":" + r[o]);
  2740. var f = new LEvent(LEvent.COMPLETE);
  2741. f.currentTarget = f.target = n;
  2742. n.dispatchEvent(f)
  2743. }
  2744. }
  2745. },
  2746. getCurrentTime: function() {
  2747. var e = this;
  2748. if (e.playing) {
  2749. return e.data.currentTime - e.currentSave + e.currentTime
  2750. } else {
  2751. return e.currentSave
  2752. }
  2753. },
  2754. setVolume: function(e) {
  2755. var t = this;
  2756. t.volume = e;
  2757. if (t.playing) {
  2758. t.volumeNode.gain.value = e
  2759. }
  2760. },
  2761. getVolume: function() {
  2762. return this.volume
  2763. },
  2764. play: function(e, t, n) {
  2765. var r = this;
  2766. if (r.length == 0) {
  2767. return
  2768. }
  2769. if (typeof t !== UNDEFINED) {
  2770. r.loopIndex = 0;
  2771. r.loopLength = t
  2772. }
  2773. if (typeof e !== UNDEFINED) {
  2774. r.currentTime = e;
  2775. r.currentStart = e
  2776. }
  2777. if (typeof n !== UNDEFINED) {
  2778. r.currentTimeTo = n > r.length ? r.length : n
  2779. } else {
  2780. r.currentTimeTo = r.length
  2781. }
  2782. r.data.loop = false;
  2783. r.playing = true;
  2784. if (r.timeout) {
  2785. clearTimeout(r.timeout);
  2786. delete r.timeout
  2787. }
  2788. r.timeout = setTimeout(r._onended.bind(r), (r.currentTimeTo - r.currentTime) * 1e3);
  2789. r.bufferSource = r.data.createBufferSource();
  2790. r.bufferSource.buffer = r.buffer;
  2791. r.volumeNode = r.data.createGainNode();
  2792. r.volumeNode.gain.value = r.volume;
  2793. r.volumeNode.connect(r.data.destination);
  2794. r.bufferSource.connect(r.volumeNode);
  2795. r.currentSave = r.data.currentTime;
  2796. if (r.bufferSource.start) {
  2797. r.bufferSource.start(0, r.currentTime, r.length - r.currentTime)
  2798. } else {
  2799. r.bufferSource.noteGrainOn(0, r.currentTime, r.length - r.currentTime)
  2800. }
  2801. },
  2802. playSegment: function(e, t, n) {
  2803. this.playTo(e, e + t, n)
  2804. },
  2805. playTo: function(e, t, n) {
  2806. this.play(e, n, t)
  2807. },
  2808. stop: function() {
  2809. var e = this;
  2810. if (!e.playing) {
  2811. return
  2812. }
  2813. if (e.timeout) {
  2814. clearTimeout(e.timeout);
  2815. delete e.timeout
  2816. }
  2817. if (e.bufferSource.stop) {
  2818. e.bufferSource.stop(0)
  2819. } else {
  2820. e.bufferSource.noteOff(0)
  2821. }
  2822. e.currentSave = e.getCurrentTime();
  2823. e.currentTime = e.currentSave;
  2824. e.playing = false
  2825. },
  2826. close: function() {
  2827. var e = this;
  2828. if (!e.playing) {
  2829. return
  2830. }
  2831. if (e.timeout) {
  2832. clearTimeout(e.timeout);
  2833. delete e.timeout
  2834. }
  2835. if (e.bufferSource.stop) {
  2836. e.bufferSource.stop(0)
  2837. } else {
  2838. e.bufferSource.noteOff(0)
  2839. }
  2840. e.playing = false;
  2841. e.currentTime = 0;
  2842. e.currentSave = 0
  2843. },
  2844. ll_check: function() {
  2845. var e = this;
  2846. if (!e.playing) {
  2847. return
  2848. }
  2849. if (e.currentTimeTo < e.data.currentTime - e.currentSave + LSound.Container.time * .001) {
  2850. e._onended()
  2851. }
  2852. },
  2853. die: function() {
  2854. LSound.Container.remove(this)
  2855. }
  2856. };
  2857. for (var n in t) {
  2858. e.prototype[n] = t[n]
  2859. }
  2860. return e
  2861. }();
  2862. var LMedia = function() {
  2863. function e() {
  2864. var e = this;
  2865. LExtends(e, LDisplayObject, []);
  2866. e.length = 0;
  2867. e.loopIndex = 0;
  2868. e.loopLength = 1;
  2869. e.playing = false;
  2870. e.oncomplete = null;
  2871. e.onsoundcomplete = null;
  2872. e.currentStart = 0;
  2873. LSound.Container.add(this)
  2874. }
  2875. var t = {
  2876. onload: function() {
  2877. var e = this;
  2878. if (e.data.readyState) {
  2879. e.length = e.data.duration - (LGlobal.android ? .1 : 0);
  2880. var t = new LEvent(LEvent.COMPLETE);
  2881. t.currentTarget = e;
  2882. t.target = e.data;
  2883. e.dispatchEvent(t);
  2884. return
  2885. }
  2886. e.data.addEventListener("canplaythrough", function() {
  2887. e.onload()
  2888. }, false)
  2889. },
  2890. _onended: function() {
  2891. var e = this,
  2892. t, n;
  2893. e.dispatchEvent(LEvent.SOUND_COMPLETE);
  2894. if (++e.loopIndex < e.loopLength) {
  2895. t = e.loopIndex;
  2896. n = e.loopLength;
  2897. e.close();
  2898. e.play(e.currentStart, e.loopLength, e.currentTimeTo);
  2899. e.loopIndex = t
  2900. } else {
  2901. e.close()
  2902. }
  2903. },
  2904. load: function(e) {
  2905. var t = this;
  2906. if (Object.prototype.toString.apply(e) == "[object HTMLAudioElement]") {
  2907. t.data = e;
  2908. t.onload();
  2909. return
  2910. }
  2911. var n, r, i, s, o, u = {
  2912. mov: ["quicktime"],
  2913. "3gp": ["3gpp"],
  2914. midi: ["midi"],
  2915. mid: ["midi"],
  2916. ogv: ["ogg"],
  2917. m4a: ["acc"],
  2918. mp3: ["mpeg"],
  2919. wav: ["wav", "x-wav", "wave"],
  2920. wave: ["wav", "x-wav", "wave"],
  2921. aac: ["mp4", "aac"]
  2922. };
  2923. n = e.split(",");
  2924. for (s = 0; s < n.length; s++) {
  2925. r = n[s].split(".");
  2926. o = r[r.length - 1];
  2927. if (u[o]) {
  2928. o = u[o]
  2929. } else {
  2930. o = [o]
  2931. }
  2932. i = o.some(function(e, n, r) {
  2933. return t.data.canPlayType(t._type + "/" + e)
  2934. });
  2935. if (i) {
  2936. t.data.src = n[s];
  2937. t.onload();
  2938. t.data.load();
  2939. return
  2940. } else {
  2941. console.warn("Not support " + r[r.length - 1] + ":" + n[s]);
  2942. var a = new LEvent(LEvent.COMPLETE);
  2943. a.currentTarget = a.target = t;
  2944. t.dispatchEvent(a)
  2945. }
  2946. }
  2947. if (t.oncomplete) {
  2948. t.oncomplete({})
  2949. }
  2950. },
  2951. getCurrentTime: function() {
  2952. return this.data.currentTime
  2953. },
  2954. setVolume: function(e) {
  2955. this.data.volume = e
  2956. },
  2957. getVolume: function() {
  2958. return this.data.volume
  2959. },
  2960. play: function(e, t, n) {
  2961. var r = this;
  2962. if (r.length == 0) {
  2963. return
  2964. }
  2965. if (LGlobal.android) {
  2966. LSound.Container.stopOther(this)
  2967. }
  2968. if (typeof e != UNDEFINED) {
  2969. r.data.currentTime = e;
  2970. r.currentStart = e
  2971. }
  2972. if (typeof t != UNDEFINED) {
  2973. r.loopLength = t
  2974. }
  2975. if (typeof n !== UNDEFINED) {
  2976. r.currentTimeTo = n > r.length ? r.length : n
  2977. } else {
  2978. r.currentTimeTo = r.length
  2979. } if (r.timeout) {
  2980. clearTimeout(r.timeout);
  2981. delete r.timeout
  2982. }
  2983. r.timeout = setTimeout(function() {
  2984. r._onended()
  2985. }, (r.currentTimeTo - r.data.currentTime) * 1e3);
  2986. r.data.loop = false;
  2987. r.loopIndex = 0;
  2988. r.playing = true;
  2989. r.data.play()
  2990. },
  2991. playSegment: function(e, t, n) {
  2992. this.playTo(e, e + t, n)
  2993. },
  2994. playTo: function(e, t, n) {
  2995. this.play(e, n, t)
  2996. },
  2997. stop: function() {
  2998. var e = this;
  2999. if (!e.playing) {
  3000. return
  3001. }
  3002. if (e.timeout) {
  3003. clearTimeout(e.timeout);
  3004. delete e.timeout
  3005. }
  3006. e.playing = false;
  3007. e.data.pause()
  3008. },
  3009. close: function() {
  3010. var e = this;
  3011. if (!e.playing) {
  3012. return
  3013. }
  3014. if (e.timeout) {
  3015. clearTimeout(e.timeout);
  3016. delete e.timeout
  3017. }
  3018. e.playing = false;
  3019. e.data.pause();
  3020. e.data.currentTime = 0;
  3021. e.currentSave = 0
  3022. },
  3023. ll_check: function() {
  3024. var e = this;
  3025. if (!e.playing) {
  3026. return
  3027. }
  3028. if (e.currentTimeTo < e.data.currentTime + LSound.Container.time * .005) {
  3029. e._onended()
  3030. }
  3031. },
  3032. die: function() {
  3033. LSound.Container.remove(this)
  3034. }
  3035. };
  3036. for (var n in t) {
  3037. e.prototype[n] = t[n]
  3038. }
  3039. return e
  3040. }();
  3041. var LSound = function() {
  3042. function e(t) {
  3043. var n = this;
  3044. n.type = "LSound";
  3045. n._type = "audio";
  3046. if (e.webAudioEnabled && LGlobal.webAudio) {
  3047. LExtends(n, LWebAudio, [])
  3048. } else {
  3049. LExtends(n, LMedia, []);
  3050. n.data = new Audio;
  3051. n.data.loop = false;
  3052. n.data.autoplay = false
  3053. } if (t) {
  3054. n.load(t)
  3055. }
  3056. }
  3057. e.TYPE_SOUND = "sound";
  3058. e.webAudioEnabled = false;
  3059. var t = location.protocol;
  3060. if (t == "http:" || t == "https:") {
  3061. if (typeof webkitAudioContext !== UNDEFINED) {
  3062. try {
  3063. LWebAudio._context = new webkitAudioContext
  3064. } catch (n) {}
  3065. } else if (typeof AudioContext !== UNDEFINED) {
  3066. try {
  3067. LWebAudio._context = new AudioContext
  3068. } catch (n) {}
  3069. }
  3070. if (LWebAudio._context) {
  3071. LWebAudio.container.push(LWebAudio._context);
  3072. e.webAudioEnabled = true
  3073. }
  3074. }
  3075. e.Container = {
  3076. ll_save: 0,
  3077. time: 0,
  3078. list: [],
  3079. ll_show: function() {
  3080. var t = e.Container;
  3081. var n = (new Date).getTime();
  3082. t.time = n - (t.ll_save ? t.ll_save : n);
  3083. t.ll_save = n;
  3084. var r = t.list;
  3085. for (var i = r.length - 1; i >= 0; i--) {
  3086. if (r[i]) {
  3087. r[i].ll_check()
  3088. }
  3089. }
  3090. },
  3091. add: function(t) {
  3092. if (e.Container.list.indexOf(t) >= 0) {
  3093. return
  3094. }
  3095. e.Container.list.push(t)
  3096. },
  3097. remove: function(t) {
  3098. var n = e.Container.list;
  3099. for (var r = n.length - 1; r >= 0; r--) {
  3100. if (n[r].objectIndex == t.objectIndex) {
  3101. n.splice(r, 1);
  3102. break
  3103. }
  3104. }
  3105. },
  3106. stopOther: function(t) {
  3107. var n = e.Container.list;
  3108. for (var r = n.length - 1; r >= 0; r--) {
  3109. if (n[r].objectIndex != t.objectIndex) {
  3110. n[r].stop()
  3111. }
  3112. }
  3113. }
  3114. };
  3115. LGlobal.childList.push(e.Container);
  3116. return e
  3117. }();
  3118. var LVideo = function() {
  3119. function e(e) {
  3120. var t = this;
  3121. LExtends(t, LMedia, []);
  3122. t.type = "LVideo";
  3123. t._type = "video";
  3124. t.rotatex = 0;
  3125. t.rotatey = 0;
  3126. t.data = document.createElement("video");
  3127. t.data.style.display = "none";
  3128. document.body.appendChild(t.data);
  3129. t.data.id = "video_" + t.objectIndex;
  3130. t.data.loop = false;
  3131. t.data.autoplay = false;
  3132. if (e) {
  3133. t.load(e)
  3134. }
  3135. }
  3136. var t = {
  3137. _ll_show: function(e) {
  3138. var t = this;
  3139. e.drawImage(t.data, t.x, t.y)
  3140. },
  3141. die: function() {
  3142. var e = this;
  3143. document.body.removeChild(e.data);
  3144. delete e.data
  3145. },
  3146. getWidth: function() {
  3147. return this.data.width
  3148. },
  3149. getHeight: function() {
  3150. return this.data.height
  3151. }
  3152. };
  3153. for (var n in t) {
  3154. e.prototype[n] = t[n]
  3155. }
  3156. return e
  3157. }();
  3158. var LPoint = function() {
  3159. function e(e, t) {
  3160. var n = this;
  3161. n.x = e;
  3162. n.y = t
  3163. }
  3164. e.distance = function(t, n) {
  3165. return e.distance2(t.x, t.y, n.x, n.y)
  3166. };
  3167. e.distance2 = function(e, t, n, r) {
  3168. var i = e - n,
  3169. s = e - n;
  3170. return Math.sqrt(i * i + s * s)
  3171. };
  3172. e.interpolate = function(t, n, r) {
  3173. return new e(t.x + (n.x - t.x) * (1 - r), t.y + (n.y - t.y) * (1 - r))
  3174. };
  3175. e.polar = function(t, n) {
  3176. return new e(t * Math.cos(n), t * Math.sin(n))
  3177. };
  3178. e.prototype = {
  3179. toString: function() {
  3180. return "[object LPoint(" + this.x + "," + this.y + ")]"
  3181. },
  3182. length: function() {
  3183. return e.distance2(this.x, this.y, 0, 0)
  3184. },
  3185. add: function(t) {
  3186. return e(this.x + t.x, this.y + t.y)
  3187. },
  3188. clone: function() {
  3189. return new e(this.x, this.y)
  3190. },
  3191. setTo: function(e, t) {
  3192. this.x = e, this.y = t
  3193. },
  3194. copyFrom: function(e) {
  3195. this.setTo(e.x, e.y)
  3196. },
  3197. equals: function(e) {
  3198. return this.x == e.x && this.y == e.y
  3199. },
  3200. normalize: function(e) {
  3201. var t = this,
  3202. n = e / t.length();
  3203. t.x *= n, t.y *= n
  3204. },
  3205. offset: function(e, t) {
  3206. this.x += e;
  3207. this.y += t
  3208. },
  3209. subtract: function(t) {
  3210. return new e(this.x - t.x, this.y - t.y)
  3211. }
  3212. };
  3213. return e
  3214. }();
  3215. var LRectangle = function() {
  3216. function e(e, t, n, r) {
  3217. var i = this;
  3218. i.x = e;
  3219. i.y = t;
  3220. i.width = n;
  3221. i.height = r;
  3222. i.setRectangle()
  3223. }
  3224. e.prototype = {
  3225. setRectangle: function() {
  3226. var e = this;
  3227. e.bottom = e.y + e.height;
  3228. e.right = e.x + e.width;
  3229. e.left = e.x;
  3230. e.top = e.y
  3231. },
  3232. clone: function() {
  3233. var t = this;
  3234. return new e(t.x, t.y, t.width, t.height)
  3235. },
  3236. contains: function(e, t) {
  3237. var n = this;
  3238. return e >= n.x && e <= n.right && t >= n.y && t <= n.bottom
  3239. },
  3240. containsRect: function(e) {
  3241. var t = this;
  3242. return e.x >= t.x && e.right <= t.right && e.y >= t.y && e.bottom <= t.bottom
  3243. },
  3244. equals: function(e) {
  3245. var t = this;
  3246. return e.x == t.x && e.width == t.width && e.y == t.y && e.height == t.height
  3247. },
  3248. inflate: function(e, t) {
  3249. var n = this;
  3250. n.width += e;
  3251. n.height += t;
  3252. n.setRectangle()
  3253. },
  3254. intersection: function(t) {
  3255. var n = this;
  3256. var r = n.x > t.x ? n.x : t.x;
  3257. var i = n.y > t.y ? n.y : t.y;
  3258. var s = n.right > t.right ? t.right : n.right;
  3259. var o = n.bottom > t.bottom ? t.bottom : n.bottom;
  3260. if (r <= s && i <= o) {
  3261. return new e(r, i, s, o)
  3262. } else {
  3263. return new e(0, 0, 0, 0)
  3264. }
  3265. },
  3266. intersects: function(e) {
  3267. var t = this;
  3268. var n = t.x > e.x ? t.x : e.x;
  3269. var r = t.y > e.y ? t.y : e.y;
  3270. var i = t.right > e.right ? e.right : t.right;
  3271. var s = t.bottom > e.bottom ? e.bottom : t.bottom;
  3272. return n <= i && r <= s
  3273. },
  3274. isEmpty: function() {
  3275. var e = this;
  3276. return e.x == 0 && e.y == 0 && e.width == 0 && e.height == 0
  3277. },
  3278. offset: function(e, t) {
  3279. var n = this;
  3280. n.x += e;
  3281. n.y += t;
  3282. n.setRectangle()
  3283. },
  3284. setEmpty: function() {
  3285. var e = this;
  3286. e.x = 0;
  3287. e.y = 0;
  3288. e.width = 0;
  3289. e.height = 0;
  3290. e.setRectangle()
  3291. },
  3292. setTo: function(e, t, n, r) {
  3293. var i = this;
  3294. i.x = e;
  3295. i.y = t;
  3296. i.width = n;
  3297. i.height = r;
  3298. i.setRectangle()
  3299. },
  3300. toString: function() {
  3301. var e = this;
  3302. return "[object LRectangle(" + e.x + "," + e.y + "," + e.width + "," + e.height + ")]"
  3303. },
  3304. union: function(t) {
  3305. var n = this;
  3306. return new e(n.x > t.x ? t.x : n.x, n.y > t.y ? t.y : n.y, n.right > t.right ? n.right : t.right, n.bottom > t.bottom ? n.bottom : t.bottom)
  3307. }
  3308. };
  3309. return e
  3310. }();
  3311. var LGraphics = function() {
  3312. function e() {
  3313. var e = this;
  3314. LExtends(e, LObject, []);
  3315. e.type = "LGraphics";
  3316. e.color = "#000000";
  3317. e.alpha = 1;
  3318. e.bitmap = null;
  3319. e.setList = new Array;
  3320. e.showList = new Array
  3321. }
  3322. var t = {
  3323. ll_show: function() {
  3324. var e = this,
  3325. t, n = e.setList.length;
  3326. if (n == 0) {
  3327. return
  3328. }
  3329. for (t = 0; t < n; t++) {
  3330. e.setList[t]()
  3331. }
  3332. },
  3333. clone: function() {
  3334. var t = this,
  3335. n = new e,
  3336. r, i, s;
  3337. n.color = t.color;
  3338. n.alpha = t.alpha;
  3339. n.bitmap = t.bitmap;
  3340. for (r = 0, i = t.setList.length; r < i; r++) {
  3341. s = t.setList[r];
  3342. n.setList.push(s)
  3343. }
  3344. for (r = 0, i = t.showList.length; r < i; r++) {
  3345. s = t.showList[r];
  3346. n.showList.push(s)
  3347. }
  3348. return n
  3349. },
  3350. lineCap: function(e) {
  3351. var t = this;
  3352. t.setList.push(function() {
  3353. LGlobal.canvas.lineCap = e
  3354. })
  3355. },
  3356. lineJoin: function(e) {
  3357. var t = this;
  3358. t.setList.push(function() {
  3359. LGlobal.canvas.lineJoin = e
  3360. })
  3361. },
  3362. lineWidth: function(e) {
  3363. var t = this;
  3364. t.setList.push(function() {
  3365. LGlobal.canvas.lineWidth = e
  3366. })
  3367. },
  3368. strokeStyle: function(e) {
  3369. var t = this;
  3370. t.setList.push(function() {
  3371. LGlobal.canvas.strokeStyle = e
  3372. })
  3373. },
  3374. stroke: function() {
  3375. var e = this;
  3376. e.setList.push(function() {
  3377. LGlobal.canvas.stroke()
  3378. })
  3379. },
  3380. beginPath: function() {
  3381. var e = this;
  3382. e.setList.push(function() {
  3383. LGlobal.canvas.beginPath()
  3384. })
  3385. },
  3386. closePath: function() {
  3387. var e = this;
  3388. e.setList.push(function() {
  3389. LGlobal.canvas.closePath()
  3390. })
  3391. },
  3392. moveTo: function(e, t) {
  3393. var n = this;
  3394. n.setList.push(function() {
  3395. LGlobal.canvas.moveTo(e, t)
  3396. });
  3397. n.showList.push({
  3398. type: LShape.POINT,
  3399. arg: [e, t]
  3400. })
  3401. },
  3402. lineTo: function(e, t) {
  3403. var n = this;
  3404. n.setList.push(function() {
  3405. LGlobal.canvas.lineTo(e, t)
  3406. });
  3407. n.showList.push({
  3408. type: LShape.POINT,
  3409. arg: [e, t]
  3410. })
  3411. },
  3412. rect: function(e, t, n, r) {
  3413. var i = this;
  3414. i.setList.push(function() {
  3415. LGlobal.canvas.rect(e, t, n, r)
  3416. });
  3417. i.showList.push({
  3418. type: LShape.RECT,
  3419. arg: [e, t, n, r]
  3420. })
  3421. },
  3422. fillStyle: function(e) {
  3423. var t = this;
  3424. t.setList.push(function() {
  3425. LGlobal.canvas.fillStyle = e
  3426. })
  3427. },
  3428. fill: function() {
  3429. var e = this;
  3430. e.setList.push(function() {
  3431. LGlobal.canvas.fill()
  3432. })
  3433. },
  3434. arc: function(e, t, n, r, i, s) {
  3435. var o = this;
  3436. o.setList.push(function() {
  3437. LGlobal.canvas.arc(e, t, n, r, i, s)
  3438. });
  3439. o.showList.push({
  3440. type: LShape.ARC,
  3441. arg: r
  3442. })
  3443. },
  3444. lineStyle: function(e, t) {
  3445. var n = this,
  3446. r;
  3447. if (t == null) {
  3448. t = n.color
  3449. }
  3450. n.color = t;
  3451. n.setList.push(function() {
  3452. r = LGlobal.canvas;
  3453. r.lineWidth = e;
  3454. r.strokeStyle = t
  3455. })
  3456. },
  3457. clear: function() {
  3458. var e = this;
  3459. e.bitmap = null;
  3460. e.setList.length = 0;
  3461. e.showList.length = 0
  3462. },
  3463. beginBitmapFill: function(e) {
  3464. var t = this;
  3465. t.setList.push(function() {
  3466. t.bitmap = e
  3467. })
  3468. },
  3469. drawEllipse: function(e, t, n, r, i) {
  3470. var s = this;
  3471. s.setList.push(function() {
  3472. var o, u, a, f, l, c, h, p, d, v, m, g;
  3473. o = LGlobal.canvas;
  3474. o.beginPath();
  3475. c = .5522848;
  3476. u = n[0];
  3477. a = n[1];
  3478. f = n[2];
  3479. l = n[3];
  3480. h = f / 2 * c;
  3481. p = l / 2 * c;
  3482. d = u + f;
  3483. v = a + l;
  3484. m = u + f / 2;
  3485. g = a + l / 2;
  3486. o.moveTo(u, g);
  3487. o.bezierCurveTo(u, g - p, m - h, a, m, a);
  3488. o.bezierCurveTo(m + h, a, d, g - p, d, g);
  3489. o.bezierCurveTo(d, g + p, m + h, v, m, v);
  3490. o.bezierCurveTo(m - h, v, u, g + p, u, g);
  3491. if (s.bitmap) {
  3492. o.save();
  3493. o.clip();
  3494. o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
  3495. o.restore();
  3496. s.bitmap = null;
  3497. return
  3498. }
  3499. if (r) {
  3500. o.fillStyle = i;
  3501. o.fill()
  3502. }
  3503. if (e > 0) {
  3504. o.lineWidth = e;
  3505. o.strokeStyle = t;
  3506. o.stroke()
  3507. }
  3508. });
  3509. s.showList.push({
  3510. type: LShape.RECT,
  3511. arg: n
  3512. })
  3513. },
  3514. drawArc: function(e, t, n, r, i) {
  3515. var s = this;
  3516. s.setList.push(function() {
  3517. var o = LGlobal.canvas;
  3518. o.beginPath();
  3519. if (n.length > 6 && n[6]) {
  3520. o.moveTo(n[0], n[1])
  3521. }
  3522. o.arc(n[0], n[1], n[2], n[3], n[4], n[5]);
  3523. if (n.length > 6 && n[6]) {
  3524. o.lineTo(n[0], n[1])
  3525. }
  3526. if (s.bitmap) {
  3527. o.save();
  3528. o.clip();
  3529. o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
  3530. o.restore();
  3531. s.bitmap = null;
  3532. return
  3533. }
  3534. if (r) {
  3535. o.fillStyle = i;
  3536. o.fill()
  3537. }
  3538. if (e > 0) {
  3539. o.lineWidth = e;
  3540. o.strokeStyle = t;
  3541. o.stroke()
  3542. }
  3543. });
  3544. s.showList.push({
  3545. type: LShape.ARC,
  3546. arg: n
  3547. })
  3548. },
  3549. drawRect: function(e, t, n, r, i) {
  3550. var s = this;
  3551. s.setList.push(function() {
  3552. var o = LGlobal.canvas;
  3553. o.beginPath();
  3554. o.rect(n[0], n[1], n[2], n[3]);
  3555. o.closePath();
  3556. if (s.bitmap) {
  3557. o.save();
  3558. o.clip();
  3559. o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
  3560. o.restore();
  3561. s.bitmap = null;
  3562. return
  3563. }
  3564. if (r) {
  3565. o.fillStyle = i;
  3566. o.fill()
  3567. }
  3568. if (e > 0) {
  3569. o.lineWidth = e;
  3570. o.strokeStyle = t;
  3571. o.stroke()
  3572. }
  3573. });
  3574. s.showList.push({
  3575. type: LShape.RECT,
  3576. arg: n
  3577. })
  3578. },
  3579. drawRoundRect: function(e, t, n, r, i) {
  3580. var s = this;
  3581. s.setList.push(function() {
  3582. var o = LGlobal.canvas;
  3583. o.beginPath();
  3584. o.moveTo(n[0] + n[4], n[1]);
  3585. o.lineTo(n[0] + n[2] - n[4], n[1]);
  3586. o.arcTo(n[0] + n[2], n[1], n[0] + n[2], n[1] + n[4], n[4]);
  3587. o.lineTo(n[0] + n[2], n[1] + n[3] - n[4]);
  3588. o.arcTo(n[0] + n[2], n[1] + n[3], n[0] + n[2] - n[4], n[1] + n[3], n[4]);
  3589. o.lineTo(n[0] + n[4], n[1] + n[3]);
  3590. o.arcTo(n[0], n[1] + n[3], n[0], n[1] + n[3] - n[4], n[4]);
  3591. o.lineTo(n[0], n[1] + n[4]);
  3592. o.arcTo(n[0], n[1], n[0] + n[4], n[1], n[4]);
  3593. o.closePath();
  3594. if (s.bitmap) {
  3595. o.save();
  3596. o.clip();
  3597. o.drawImage(s.bitmap.image, 0, 0, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
  3598. o.restore();
  3599. s.bitmap = null;
  3600. return
  3601. }
  3602. if (r) {
  3603. o.fillStyle = i;
  3604. o.fill()
  3605. }
  3606. if (e > 0) {
  3607. o.lineWidth = e;
  3608. o.strokeStyle = t;
  3609. o.stroke()
  3610. }
  3611. });
  3612. s.showList.push({
  3613. type: LShape.RECT,
  3614. arg: n
  3615. })
  3616. },
  3617. drawVertices: function(e, t, n, r, i) {
  3618. var s = this;
  3619. if (n.length < 3) {
  3620. return
  3621. }
  3622. s.setList.push(function() {
  3623. var o = LGlobal.canvas;
  3624. o.beginPath();
  3625. o.moveTo(n[0][0], n[0][1]);
  3626. var u, a = n.length,
  3627. f;
  3628. for (u = 1; u < a; u++) {
  3629. f = n[u];
  3630. o.lineTo(f[0], f[1])
  3631. }
  3632. o.lineTo(n[0][0], n[0][1]);
  3633. o.closePath();
  3634. if (s.bitmap) {
  3635. o.save();
  3636. o.clip();
  3637. o.drawImage(s.bitmap.image, s.bitmap.x, s.bitmap.y, s.bitmap.width, s.bitmap.height, 0, 0, s.bitmap.width, s.bitmap.height);
  3638. o.restore();
  3639. s.bitmap = null;
  3640. return
  3641. }
  3642. if (r) {
  3643. o.fillStyle = i;
  3644. o.fill()
  3645. }
  3646. if (e > 0) {
  3647. o.lineWidth = e;
  3648. o.strokeStyle = t;
  3649. o.closePath();
  3650. o.stroke()
  3651. }
  3652. });
  3653. s.showList.push({
  3654. type: LShape.VERTICES,
  3655. arg: n
  3656. })
  3657. },
  3658. drawTriangles: function(e, t, n, r, i) {
  3659. var s = this;
  3660. var o, u, a = t.length,
  3661. f;
  3662. s.setList.push(function() {
  3663. f = LGlobal.canvas;
  3664. var h = e,
  3665. p, d, v;
  3666. for (o = 0, u = 0; o < a; o += 3) {
  3667. p = 0;
  3668. f.save();
  3669. f.beginPath();
  3670. f.moveTo(h[t[o] * 2], h[t[o] * 2 + 1]);
  3671. f.lineTo(h[t[o + 1] * 2], h[t[o + 1] * 2 + 1]);
  3672. f.lineTo(h[t[o + 2] * 2], h[t[o + 2] * 2 + 1]);
  3673. f.lineTo(h[t[o] * 2], h[t[o] * 2 + 1]);
  3674. f.closePath();
  3675. if (r) {
  3676. f.lineWidth = r;
  3677. f.strokeStyle = i;
  3678. f.stroke()
  3679. }
  3680. f.clip();
  3681. if (o % 6 == 0) {
  3682. v = -1;
  3683. var m = (n[t[o + 1 + u] * 2] - n[t[o + u] * 2]) * s.bitmap.width;
  3684. var g = (n[t[o + 2] * 2 + 1] - n[t[o] * 2 + 1]) * s.bitmap.height;
  3685. if (u == 0 && m < 0) {
  3686. for (d = o + 9; d < a; d += 3) {
  3687. if (n[t[o + 2] * 2 + 1] == n[t[d + 2] * 2 + 1]) {
  3688. u = d - o;
  3689. break
  3690. }
  3691. }
  3692. if (u == 0) {
  3693. u = a - o
  3694. }
  3695. m = (n[t[o + 1 + u] * 2] - n[t[o + u] * 2]) * s.bitmap.width
  3696. }
  3697. if (o + u >= a) {
  3698. m = (n[t[o + u - a] * 2] - n[t[o + 1] * 2]) * s.bitmap.width;
  3699. v = n[t[o] * 2] == 1 ? 0 : s.bitmap.width * n[t[o] * 2] + m;
  3700. if (v > s.bitmap.width) {
  3701. v -= s.bitmap.width
  3702. }
  3703. } else {
  3704. v = s.bitmap.width * n[t[o + u] * 2]
  3705. }
  3706. sh = s.bitmap.height * n[t[o] * 2 + 1];
  3707. if (g < 0) {
  3708. g = (n[t[o + 2 - (o > 0 ? 6 : -6)] * 2 + 1] - n[t[o - (o > 0 ? 6 : -6)] * 2 + 1]) * s.bitmap.height;
  3709. sh = 0
  3710. }
  3711. var y = (h[t[o + 1] * 2] - h[t[o] * 2]) / m;
  3712. var b = (h[t[o + 1] * 2 + 1] - h[t[o] * 2 + 1]) / m;
  3713. var w = (h[t[o + 2] * 2] - h[t[o] * 2]) / g;
  3714. var E = (h[t[o + 2] * 2 + 1] - h[t[o] * 2 + 1]) / g;
  3715. f.transform(y, b, w, E, h[t[o] * 2], h[t[o] * 2 + 1]);
  3716. f.drawImage(s.bitmap.image, s.bitmap.x + v, s.bitmap.y + sh, m, g, 0, 0, m, g)
  3717. } else {
  3718. var m = (n[t[o + 2 + u] * 2] - n[t[o + 1 + u] * 2]) * s.bitmap.width;
  3719. var g = (n[t[o + 2] * 2 + 1] - n[t[o] * 2 + 1]) * s.bitmap.height;
  3720. if (u == 0 && m < 0) {
  3721. for (d = o + 9; d < a; d += 3) {
  3722. if (n[t[o + 2] * 2 + 1] == n[t[d + 2] * 2 + 1]) {
  3723. u = d - o;
  3724. break
  3725. }
  3726. }
  3727. if (u == 0) {
  3728. u = a - o
  3729. }
  3730. m = (n[t[o + 2 + u] * 2] - n[t[o + 1 + u] * 2]) * s.bitmap.width
  3731. }
  3732. if (o + 1 + u >= a) {
  3733. m = (n[t[o + 1 + u - a] * 2] - n[t[o + 2] * 2]) * s.bitmap.width;
  3734. v = n[t[o + 1] * 2] == 1 ? 0 : s.bitmap.width * n[t[o + 1] * 2] + m;
  3735. if (v > s.bitmap.width) {
  3736. v -= s.bitmap.width
  3737. }
  3738. } else {
  3739. v = s.bitmap.width * n[t[o + 1 + u] * 2]
  3740. }
  3741. sh = s.bitmap.height * n[t[o] * 2 + 1];
  3742. if (g < 0) {
  3743. g = (n[t[o + 2 - (o > 0 ? 6 : -6)] * 2 + 1] - n[t[o - (o > 0 ? 6 : -6)] * 2 + 1]) * s.bitmap.height;
  3744. sh = 0
  3745. }
  3746. var y = (h[t[o + 2] * 2] - h[t[o + 1] * 2]) / m;
  3747. var b = (h[t[o + 2] * 2 + 1] - h[t[o + 1] * 2 + 1]) / m;
  3748. var w = (h[t[o + 2] * 2] - h[t[o] * 2]) / g;
  3749. var E = (h[t[o + 2] * 2 + 1] - h[t[o] * 2 + 1]) / g;
  3750. f.transform(y, b, w, E, h[t[o + 1] * 2], h[t[o + 1] * 2 + 1]);
  3751. f.drawImage(s.bitmap.image, s.bitmap.x + v, s.bitmap.y + sh, m, g, 0, -g, m, g)
  3752. }
  3753. f.restore()
  3754. }
  3755. })
  3756. },
  3757. drawLine: function(e, t, n) {
  3758. var r = this;
  3759. r.setList.push(function() {
  3760. var r = LGlobal.canvas;
  3761. r.beginPath();
  3762. r.moveTo(n[0], n[1]);
  3763. r.lineTo(n[2], n[3]);
  3764. r.lineWidth = e;
  3765. r.strokeStyle = t;
  3766. r.closePath();
  3767. r.stroke()
  3768. });
  3769. r.showList.push({
  3770. type: LShape.LINE,
  3771. arg: n
  3772. })
  3773. },
  3774. add: function(e) {
  3775. this.setList.push(e)
  3776. },
  3777. ismouseon: function(e, t) {
  3778. var n = this;
  3779. if (e == null || e == UNDEFINED || n.showList.length == 0 || !n.parent) {
  3780. return false
  3781. }
  3782. return n.parent.ismouseonShapes(n.showList, e.offsetX, e.offsetY)
  3783. },
  3784. getWidth: function() {
  3785. var e = this,
  3786. t, n, r, i, s, o, u;
  3787. for (t = 0, o = e.showList.length; t < o; t++) {
  3788. if (e.showList[t].type == LShape.RECT) {
  3789. if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
  3790. r = e.showList[t].arg[0]
  3791. }
  3792. if (i < e.showList[t].arg[0] + e.showList[t].arg[2] || typeof i == UNDEFINED) {
  3793. i = e.showList[t].arg[0] + e.showList[t].arg[2]
  3794. }
  3795. } else if (e.showList[t].type == LShape.ARC) {
  3796. if (r > e.showList[t].arg[0] - e.showList[t].arg[2] || typeof r == UNDEFINED) {
  3797. r = e.showList[t].arg[0] - e.showList[t].arg[2]
  3798. }
  3799. if (i < e.showList[t].arg[0] + e.showList[t].arg[2] || typeof i == UNDEFINED) {
  3800. i = e.showList[t].arg[0] + e.showList[t].arg[2]
  3801. }
  3802. } else if (e.showList[t].type == LShape.VERTICES) {
  3803. for (n = 0, u = e.showList[t].arg.length; n < u; n++) {
  3804. s = e.showList[t].arg[n];
  3805. if (r > s[0] || typeof r == UNDEFINED) {
  3806. r = s[0]
  3807. }
  3808. if (i < s[0] || typeof i == UNDEFINED) {
  3809. i = s[0]
  3810. }
  3811. }
  3812. } else if (e.showList[t].type == LShape.LINE) {
  3813. if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
  3814. r = e.showList[t].arg[0]
  3815. }
  3816. if (r > e.showList[t].arg[2] || typeof r == UNDEFINED) {
  3817. r = e.showList[t].arg[2]
  3818. }
  3819. if (i < e.showList[t].arg[0] || typeof i == UNDEFINED) {
  3820. i = e.showList[t].arg[0]
  3821. }
  3822. if (i < e.showList[t].arg[2] || typeof i == UNDEFINED) {
  3823. i = e.showList[t].arg[2]
  3824. }
  3825. } else if (e.showList[t].type == LShape.POINT) {
  3826. if (r > e.showList[t].arg[0] || typeof r == UNDEFINED) {
  3827. r = e.showList[t].arg[0]
  3828. }
  3829. if (i < e.showList[t].arg[0] || typeof i == UNDEFINED) {
  3830. i = e.showList[t].arg[0]
  3831. }
  3832. }
  3833. }
  3834. if (typeof r == UNDEFINED) {
  3835. r = i = 0
  3836. }
  3837. e.left = r;
  3838. if (o > 0 && i == r) {
  3839. i = r + 1
  3840. }
  3841. return i - r
  3842. },
  3843. getHeight: function() {
  3844. var e = this,
  3845. t = null,
  3846. n = null,
  3847. r, i, s, o, u;
  3848. for (t = 0, r = e.showList.length; t < r; t++) {
  3849. if (e.showList[t].type == LShape.RECT) {
  3850. if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
  3851. s = e.showList[t].arg[1]
  3852. }
  3853. if (o < e.showList[t].arg[1] + e.showList[t].arg[3] || typeof o == UNDEFINED) {
  3854. o = e.showList[t].arg[1] + e.showList[t].arg[3]
  3855. }
  3856. } else if (e.showList[t].type == LShape.ARC) {
  3857. if (s > e.showList[t].arg[1] - e.showList[t].arg[2] || typeof s == UNDEFINED) {
  3858. s = e.showList[t].arg[1] - e.showList[t].arg[2]
  3859. }
  3860. if (o < e.showList[t].arg[1] + e.showList[t].arg[2] || typeof o == UNDEFINED) {
  3861. o = e.showList[t].arg[1] + e.showList[t].arg[2]
  3862. }
  3863. } else if (e.showList[t].type == LShape.VERTICES) {
  3864. for (n = 0, i = e.showList[t].arg.length; n < i; n++) {
  3865. u = e.showList[t].arg[n];
  3866. if (s > u[1] || typeof s == UNDEFINED) {
  3867. s = u[1]
  3868. }
  3869. if (o < u[1] || typeof o == UNDEFINED) {
  3870. o = u[1]
  3871. }
  3872. }
  3873. } else if (e.showList[t].type == LShape.LINE) {
  3874. if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
  3875. s = e.showList[t].arg[1]
  3876. }
  3877. if (s > e.showList[t].arg[3] || typeof s == UNDEFINED) {
  3878. s = e.showList[t].arg[3]
  3879. }
  3880. if (o < e.showList[t].arg[1] || typeof o == UNDEFINED) {
  3881. o = e.showList[t].arg[1]
  3882. }
  3883. if (o < e.showList[t].arg[3] || typeof o == UNDEFINED) {
  3884. o = e.showList[t].arg[3]
  3885. }
  3886. } else if (e.showList[t].type == LShape.POINT) {
  3887. if (s > e.showList[t].arg[1] || typeof s == UNDEFINED) {
  3888. s = e.showList[t].arg[1]
  3889. }
  3890. if (o < e.showList[t].arg[1] || typeof o == UNDEFINED) {
  3891. o = e.showList[t].arg[1]
  3892. }
  3893. }
  3894. }
  3895. if (typeof s == UNDEFINED) {
  3896. s = o = 0
  3897. }
  3898. e.top = s;
  3899. if (r > 0 && o == s) {
  3900. o = s + 1
  3901. }
  3902. return o - s
  3903. },
  3904. startX: function() {
  3905. var e = this;
  3906. e.getWidth();
  3907. return e.left
  3908. },
  3909. startY: function() {
  3910. var e = this;
  3911. e.getHeight();
  3912. return e.top
  3913. }
  3914. };
  3915. for (var n in t) {
  3916. e.prototype[n] = t[n]
  3917. }
  3918. return e
  3919. }();
  3920. var LShape = function() {
  3921. function e() {
  3922. var e = this;
  3923. LExtends(e, LInteractiveObject, []);
  3924. e.type = "LShape";
  3925. e.graphics = new LGraphics;
  3926. e.graphics.parent = e
  3927. }
  3928. e.POINT = "point";
  3929. e.LINE = "line";
  3930. e.ARC = "arc";
  3931. e.RECT = "rect";
  3932. e.VERTICES = "vertices";
  3933. var t = {
  3934. _ll_show: function(e) {
  3935. var t = this;
  3936. t.graphics.ll_show()
  3937. },
  3938. getWidth: function(e) {
  3939. var t = this,
  3940. n, r, i = t.graphics.startX(),
  3941. s = i + t.graphics.getWidth();
  3942. if (e && t.mask) {
  3943. n = t.mask._startX ? t.mask._startX() : t.mask.startX();
  3944. r = t.mask.getWidth();
  3945. if (i < n) {
  3946. i = n
  3947. }
  3948. if (s > n + r) {
  3949. s = n + r
  3950. }
  3951. }
  3952. t.ll_left = t.x + i;
  3953. t.ll_right = t.x + s;
  3954. return (s - i) * t.scaleX
  3955. },
  3956. getHeight: function(e) {
  3957. var t = this,
  3958. n, r, i = t.graphics.startY(),
  3959. s = i + t.graphics.getHeight();
  3960. if (e && t.mask) {
  3961. n = t.mask._startY ? t.mask._startY() : t.mask.startY();
  3962. r = t.mask.getHeight();
  3963. if (i < n) {
  3964. i = n
  3965. }
  3966. if (s > n + r) {
  3967. s = n + r
  3968. }
  3969. }
  3970. t.ll_top = t.y + i;
  3971. t.ll_bottom = t.y + s;
  3972. return (s - i) * t.scaleY
  3973. },
  3974. _startX: function() {
  3975. var e = this;
  3976. e.getWidth();
  3977. return e.ll_left
  3978. },
  3979. startX: function() {
  3980. var e = this;
  3981. return e._startX() * e.scaleX
  3982. },
  3983. _startY: function() {
  3984. var e = this;
  3985. e.getHeight();
  3986. return e.ll_top
  3987. },
  3988. startY: function() {
  3989. var e = this;
  3990. return e._startY() * e.scaleY
  3991. },
  3992. clone: function() {
  3993. var t = this,
  3994. n = new e,
  3995. r, i;
  3996. n.copyProperty(t);
  3997. n.graphics = t.graphics.clone();
  3998. n.graphics.parent = n;
  3999. return n
  4000. },
  4001. ismouseon: function(e, t) {
  4002. var n = this,
  4003. r = false,
  4004. i;
  4005. if (!n.visible || e == null) {
  4006. return false
  4007. }
  4008. if (n.mask) {
  4009. if (!n.mask.parent) {
  4010. n.mask.parent = n.parent
  4011. }
  4012. if (!n.mask.ismouseon(e, t)) {
  4013. return false
  4014. }
  4015. }
  4016. i = {
  4017. x: n.x * t.scaleX + t.x,
  4018. y: n.y * t.scaleY + t.y,
  4019. scaleX: t.scaleX * n.scaleX,
  4020. scaleY: t.scaleY * n.scaleY
  4021. };
  4022. if (n.graphics) {
  4023. r = n.graphics.ismouseon(e, i)
  4024. }
  4025. return r
  4026. },
  4027. die: function() {
  4028. var e = this;
  4029. e.graphics.clear()
  4030. }
  4031. };
  4032. for (var n in t) {
  4033. e.prototype[n] = t[n]
  4034. }
  4035. return e
  4036. }();
  4037. var LSprite = function() {
  4038. function e() {
  4039. var e = this;
  4040. LExtends(e, LDisplayObjectContainer, []);
  4041. e.type = "LSprite";
  4042. e.rotatex;
  4043. e.rotatey;
  4044. e.graphics = new LGraphics;
  4045. e.graphics.parent = e;
  4046. e.box2dBody = null;
  4047. e.shapes = new Array
  4048. }
  4049. var t = {
  4050. setRotate: function(e) {
  4051. var t = this;
  4052. if (t.box2dBody) {
  4053. t.box2dBody.SetAngle(e)
  4054. } else {
  4055. t.rotate = e
  4056. }
  4057. },
  4058. _rotateReady: function() {
  4059. var e = this;
  4060. if (e.box2dBody) {
  4061. if (typeof e.rotatex == UNDEFINED) {
  4062. e.getRotateXY()
  4063. }
  4064. e.x = e.box2dBody.GetPosition().x * LGlobal.box2d.drawScale - e.parent.x - e.rotatex;
  4065. e.y = e.box2dBody.GetPosition().y * LGlobal.box2d.drawScale - e.parent.y - e.rotatey;
  4066. e.rotate = e.box2dBody.GetAngle()
  4067. }
  4068. },
  4069. _ll_show: function(e) {
  4070. var t = this;
  4071. t.graphics.ll_show();
  4072. LGlobal.show(t.childList);
  4073. t._ll_debugShape()
  4074. },
  4075. startDrag: function(e) {
  4076. var t = this,
  4077. n, r;
  4078. if (t.ll_dragStart) {
  4079. return
  4080. }
  4081. t.ll_touchPointID = e;
  4082. t.ll_dragStartX = t.x;
  4083. t.ll_dragStartY = t.y;
  4084. t.ll_dragMX = mouseX;
  4085. t.ll_dragMY = mouseY;
  4086. t.ll_dragStart = true;
  4087. LGlobal.dragList.push(t)
  4088. },
  4089. stopDrag: function() {
  4090. var e = this,
  4091. t, n;
  4092. for (t = 0, n = LGlobal.dragList.length; t < n; t++) {
  4093. if (e.objectIndex == LGlobal.dragList[t].objectIndex) {
  4094. e.ll_dragStart = false;
  4095. LGlobal.dragList.splice(t, 1);
  4096. break
  4097. }
  4098. }
  4099. },
  4100. getRotateXY: function(e, t) {
  4101. var n = this;
  4102. if (!e || !t) {
  4103. e = n.getWidth();
  4104. t = n.getHeight()
  4105. }
  4106. n.rotatex = e / 2;
  4107. n.rotatey = t / 2
  4108. },
  4109. getWidth: function(e) {
  4110. var t = this,
  4111. n, r, i, s, o, u, a, f = t.graphics.startX(),
  4112. l = f + t.graphics.getWidth();
  4113. for (n = 0, r = t.childList.length; n < r; n++) {
  4114. i = t.childList[n];
  4115. if (typeof i.visible == UNDEFINED || !i.visible) {
  4116. continue
  4117. }
  4118. s = i.x;
  4119. if (typeof i._startX == "function") {
  4120. s = i._startX()
  4121. }
  4122. o = s + i.getWidth(e);
  4123. if (s < f) {
  4124. f = s
  4125. }
  4126. if (o > l) {
  4127. l = o
  4128. }
  4129. }
  4130. if (e && t.mask) {
  4131. u = t.mask._startX ? t.mask._startX() : t.mask.startX();
  4132. a = t.mask.getWidth();
  4133. if (f < u) {
  4134. f = u
  4135. }
  4136. if (l > u + a) {
  4137. l = u + a
  4138. }
  4139. }
  4140. t.ll_left = t.x + f;
  4141. t.ll_right = t.x + l;
  4142. return (l - f) * t.scaleX
  4143. },
  4144. getHeight: function(e) {
  4145. var t = this,
  4146. n, r, i, s, o, u, a, f = t.graphics.startY(),
  4147. l = f + t.graphics.getHeight();
  4148. for (n = 0, r = t.childList.length; n < r; n++) {
  4149. i = t.childList[n];
  4150. if (typeof i.visible == UNDEFINED || !i.visible) {
  4151. continue
  4152. }
  4153. s = i.y;
  4154. if (typeof i._startY == "function") {
  4155. s = i._startY()
  4156. }
  4157. o = s + i.getHeight(e);
  4158. if (s < f) {
  4159. f = s
  4160. }
  4161. if (o > l) {
  4162. l = o
  4163. }
  4164. }
  4165. if (e && t.mask) {
  4166. u = t.mask._startY ? t.mask._startY() : t.mask.startY();
  4167. a = t.mask.getHeight();
  4168. if (f < u) {
  4169. f = u
  4170. }
  4171. if (l > u + a) {
  4172. l = u + a
  4173. }
  4174. }
  4175. t.ll_top = t.y + f;
  4176. t.ll_bottom = t.y + l;
  4177. return (l - f) * t.scaleY
  4178. },
  4179. _startX: function() {
  4180. var e = this;
  4181. e.getWidth();
  4182. return e.ll_left
  4183. },
  4184. startX: function() {
  4185. var e = this;
  4186. return e._startX() * e.scaleX
  4187. },
  4188. _startY: function() {
  4189. var e = this;
  4190. e.getHeight();
  4191. return e.ll_top
  4192. },
  4193. startY: function() {
  4194. var e = this;
  4195. return e._startY() * e.scaleY
  4196. },
  4197. _ll_loopframe: function() {
  4198. this.dispatchEvent(LEvent.ENTER_FRAME)
  4199. },
  4200. clone: function() {
  4201. var t = this,
  4202. n = new e,
  4203. r, i, s, o;
  4204. n.copyProperty(t);
  4205. n.graphics = t.graphics.clone();
  4206. n.graphics.parent = n;
  4207. n.childList.length = 0;
  4208. for (s = 0, o = t.childList.length; s < o; s++) {
  4209. r = t.childList[s];
  4210. if (r.clone) {
  4211. i = r.clone();
  4212. i.parent = n;
  4213. n.childList.push(i)
  4214. }
  4215. }
  4216. return n
  4217. },
  4218. _mevent: function(e) {
  4219. var t = this,
  4220. n;
  4221. for (n = 0; n < t.mouseList.length; n++) {
  4222. var r = t.mouseList[n];
  4223. if (r.type == e) {
  4224. return true
  4225. }
  4226. }
  4227. return false
  4228. },
  4229. ll_dispatchMouseEvent: function(e, t, r, i, s) {
  4230. var o = this;
  4231. for (n = 0; n < o.mouseList.length; n++) {
  4232. var u = o.mouseList[n];
  4233. if (u.type == e) {
  4234. t.selfX = (i - (o.x * r.scaleX + r.x)) / (r.scaleX * o.scaleX);
  4235. t.selfY = (s - (o.y * r.scaleY + r.y)) / (r.scaleY * o.scaleY);
  4236. t.currentTarget = t.clickTarget = o;
  4237. if (!t.target) {
  4238. t.target = o
  4239. }
  4240. u.listener(t, o)
  4241. }
  4242. }
  4243. },
  4244. ll_mouseout: function(e, t, n, r, i) {
  4245. var s = this;
  4246. if (t == LMouseEvent.MOUSE_MOVE && s.ll_mousein) {
  4247. s.ll_mousein = false;
  4248. if (s._mevent(LMouseEvent.MOUSE_OUT)) {
  4249. s.ll_dispatchMouseEvent(LMouseEvent.MOUSE_OUT, e, n, r, i)
  4250. }
  4251. if (s.mouseChildren) {
  4252. for (var o = s.childList.length - 1; o >= 0; o--) {
  4253. if (s.childList[o].mouseEvent && s.childList[o].ll_mouseout) {
  4254. s.childList[o].ll_mouseout(e, t, n, r, i)
  4255. }
  4256. }
  4257. }
  4258. }
  4259. },
  4260. mouseEvent: function(e, t, n) {
  4261. if (!e) {
  4262. return false
  4263. }
  4264. var r = this,
  4265. i, s, o = e.offsetX,
  4266. u = e.offsetY,
  4267. a, f;
  4268. if (!r.mouseEnabled || !r.visible) {
  4269. return false
  4270. }
  4271. if (n == null) {
  4272. n = {
  4273. x: 0,
  4274. y: 0,
  4275. scaleX: 1,
  4276. scaleY: 1
  4277. }
  4278. }
  4279. a = r.ismouseon(e, n);
  4280. if (a) {
  4281. if (t == LMouseEvent.MOUSE_MOVE && !r.ll_mousein) {
  4282. r.ll_mousein = true;
  4283. if (r._mevent(LMouseEvent.MOUSE_OVER)) {
  4284. r.ll_dispatchMouseEvent(LMouseEvent.MOUSE_OVER, e, n, o, u)
  4285. }
  4286. }
  4287. if (r.mouseChildren) {
  4288. f = {
  4289. x: r.x * n.scaleX + n.x,
  4290. y: r.y * n.scaleY + n.y,
  4291. scaleX: n.scaleX * r.scaleX,
  4292. scaleY: n.scaleY * r.scaleY
  4293. };
  4294. for (s = r.childList.length - 1; s >= 0; s--) {
  4295. if (r.childList[s].mouseEvent) {
  4296. i = r.childList[s].mouseEvent(e, t, f);
  4297. if (i) {
  4298. e.target = r.childList[s];
  4299. if (t != LMouseEvent.MOUSE_MOVE) {
  4300. break
  4301. }
  4302. }
  4303. }
  4304. }
  4305. if (r._mevent(t)) {
  4306. r.ll_dispatchMouseEvent(t, e, n, o, u)
  4307. }
  4308. }
  4309. return true
  4310. } else {
  4311. r.ll_mouseout(e, t, n, o, u)
  4312. }
  4313. return false
  4314. },
  4315. hitTestPoint: function(e, t) {
  4316. var n = this,
  4317. r = n.shapes;
  4318. if (!r || r.length == 0) {
  4319. n.getWidth();
  4320. n.getHeight();
  4321. r = [{
  4322. type: LShape.RECT,
  4323. arg: [n.ll_left - n.x, n.ll_top - n.y, n.ll_right - n.ll_left, n.ll_bottom - n.ll_top]
  4324. }]
  4325. }
  4326. return n.ismouseonShapes(r, e, t)
  4327. },
  4328. hitTestObject: function(e) {
  4329. var t = this,
  4330. n = t.shapes,
  4331. r = e.shapes,
  4332. i, s, o, u, a, f, l, c;
  4333. if (!n || n.length == 0) {
  4334. t.getWidth();
  4335. t.getHeight();
  4336. n = [{
  4337. type: LShape.RECT,
  4338. arg: [t.ll_left - t.x, t.ll_top - t.y, t.ll_right - t.ll_left, t.ll_bottom - t.ll_top]
  4339. }]
  4340. }
  4341. if (!r || r.length == 0) {
  4342. e.getWidth();
  4343. e.getHeight();
  4344. r = [{
  4345. type: LShape.RECT,
  4346. arg: [e.ll_left - e.x, e.ll_top - e.y, e.ll_right - e.ll_left, e.ll_bottom - e.ll_top]
  4347. }]
  4348. }
  4349. i = t.getRootMatrix();
  4350. s = e.getRootMatrix();
  4351. for (o = n.length - 1; o >= 0; o--) {
  4352. u = n[o];
  4353. c = t._changeShape(u.type, u.arg, i);
  4354. for (a = r.length - 1; a >= 0; a--) {
  4355. f = r[a];
  4356. l = e._changeShape(f.type, f.arg, s);
  4357. if (u.type == LShape.VERTICES || u.type == LShape.RECT) {
  4358. if (f.type == LShape.VERTICES || f.type == LShape.RECT) {
  4359. if (LGlobal.hitTestPolygon(c, l)) {
  4360. return true
  4361. }
  4362. } else if (f.type == LShape.ARC) {
  4363. if (LGlobal.hitTestPolygonArc(c, l)) {
  4364. return true
  4365. }
  4366. }
  4367. } else {
  4368. if (f.type == LShape.VERTICES || f.type == LShape.RECT) {
  4369. if (LGlobal.hitTestPolygonArc(l, c)) {
  4370. return true
  4371. }
  4372. } else if (f.type == LShape.ARC) {
  4373. if (Math.sqrt((c[0] - l[0]) * (c[0] - l[0]) + (c[1] - l[1]) * (c[1] - l[1])) < c[2] + l[2]) {
  4374. return true
  4375. }
  4376. }
  4377. }
  4378. }
  4379. }
  4380. return false
  4381. },
  4382. addShape: function(e, t) {
  4383. var n = this;
  4384. if (e == LShape.VERTICES && t.length < 3) {
  4385. return
  4386. }
  4387. n.shapes.push({
  4388. type: e,
  4389. arg: t
  4390. })
  4391. },
  4392. clearShape: function() {
  4393. var e = this;
  4394. e.shapes.length = 0
  4395. },
  4396. _ll_debugShape: function() {
  4397. var e = this,
  4398. t, n, r, i, s, o, u;
  4399. if (!LGlobal.traceDebug || e.shapes.length == 0) {
  4400. return
  4401. }
  4402. for (t = 0, n = e.shapes.length; t < n; t++) {
  4403. r = e.shapes[t];
  4404. i = LGlobal.canvas;
  4405. s = r.arg;
  4406. i.beginPath();
  4407. if (r.type == LShape.RECT) {
  4408. i.rect(s[0], s[1], s[2], s[3])
  4409. } else if (r.type == LShape.ARC) {
  4410. i.arc(s[0], s[1], s[2], 0, 2 * Math.PI)
  4411. } else if (r.type == LShape.VERTICES) {
  4412. i.moveTo(s[0][0], s[0][1]);
  4413. for (o = 1, u = s.length; o < u; o++) {
  4414. i.lineTo(s[o][0], s[o][1])
  4415. }
  4416. i.lineTo(s[0][0], s[0][1])
  4417. }
  4418. i.closePath();
  4419. i.strokeStyle = "#00FF00";
  4420. i.stroke()
  4421. }
  4422. },
  4423. ismouseon: function(e, t) {
  4424. var n = this;
  4425. if (!n.visible || e == null) {
  4426. return false
  4427. }
  4428. if (n.mask) {
  4429. if (!n.mask.parent) {
  4430. n.mask.parent = n.parent
  4431. }
  4432. if (!n.mask.ismouseon(e, t)) {
  4433. return false
  4434. }
  4435. }
  4436. if (n.shapes && n.shapes.length > 0) {
  4437. return n.ismouseonShapes(n.shapes, e.offsetX, e.offsetY)
  4438. }
  4439. var r, i = false,
  4440. s = n.childList,
  4441. o = {
  4442. x: n.x * t.scaleX + t.x,
  4443. y: n.y * t.scaleY + t.y,
  4444. scaleX: t.scaleX * n.scaleX,
  4445. scaleY: t.scaleY * n.scaleY
  4446. };
  4447. if (n.graphics) {
  4448. i = n.graphics.ismouseon(e, o)
  4449. }
  4450. if (!i) {
  4451. for (r = s.length - 1; r >= 0; r--) {
  4452. if (s[r].ismouseon) {
  4453. i = s[r].ismouseon(e, o)
  4454. }
  4455. if (i) {
  4456. e.target = n.childList[r];
  4457. break
  4458. }
  4459. }
  4460. }
  4461. return i
  4462. },
  4463. die: function() {
  4464. var e = this,
  4465. t, n, r;
  4466. e.graphics.clear();
  4467. e.removeAllEventListener();
  4468. e.stopDrag();
  4469. if (e.box2dBody) {
  4470. e.clearBody()
  4471. }
  4472. for (t = 0, n = e.childList, r = n.length; t < r; t++) {
  4473. if (n[t].die) {
  4474. n[t].die()
  4475. }
  4476. }
  4477. }
  4478. };
  4479. for (var n in t) {
  4480. e.prototype[n] = t[n]
  4481. }
  4482. return e
  4483. }();
  4484. var LButton = function() {
  4485. function e(t, n, r, i) {
  4486. var s = this;
  4487. LExtends(s, LSprite, []);
  4488. s.type = "LButton";
  4489. s.addChild(t);
  4490. if (!n) {
  4491. n = t
  4492. } else {
  4493. s.addChild(n)
  4494. } if (!r) {
  4495. r = n
  4496. } else {
  4497. s.addChild(r)
  4498. } if (!i) {
  4499. i = t
  4500. } else {
  4501. s.addChild(i)
  4502. }
  4503. s.upState = s.bitmap_up = t;
  4504. s.overState = s.bitmap_over = n;
  4505. s.downState = r;
  4506. s.disableState = i;
  4507. s._ll_down_sx = s.downState.scaleX;
  4508. s._ll_down_sy = s.downState.scaleY;
  4509. s.overState.visible = false;
  4510. s.downState.visible = false;
  4511. s.upState.visible = true;
  4512. s.buttonMode = true;
  4513. s.staticMode = false;
  4514. s._ll_cursorEnabled = true;
  4515. s.setState(e.STATE_ENABLE);
  4516. if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
  4517. LMouseEventContainer.pushButton(s)
  4518. }
  4519. s.addEventListener(LMouseEvent.MOUSE_DOWN, s.ll_modeDown)
  4520. }
  4521. e.STATE_DISABLE = "disable";
  4522. e.STATE_ENABLE = "enable";
  4523. var t = {
  4524. setState: function(t) {
  4525. var n = this;
  4526. if (t == e.STATE_DISABLE) {
  4527. n.upState.visible = false;
  4528. n.overState.visible = false;
  4529. n.downState.visible = false;
  4530. n.disableState.visible = true;
  4531. n.mouseEnabled = false
  4532. } else if (t == e.STATE_ENABLE) {
  4533. n.overState.visible = false;
  4534. n.downState.visible = false;
  4535. n.disableState.visible = false;
  4536. n.upState.visible = true;
  4537. n.mouseEnabled = true
  4538. } else {
  4539. return
  4540. }
  4541. n.state = t
  4542. },
  4543. ll_mouseout: function(e, t, n, r, i) {
  4544. var s = this;
  4545. if (!s.ll_mousein) {
  4546. return
  4547. }
  4548. e.clickTarget = s;
  4549. s.ll_modeOut(e);
  4550. s.ll_mousein = false
  4551. },
  4552. mouseEvent: function(e, t, n) {
  4553. if (!e) {
  4554. return false
  4555. }
  4556. var r = this;
  4557. if (t == LMouseEvent.MOUSE_MOVE && r.ll_button_mode) {
  4558. r.ll_button_mode(e)
  4559. }
  4560. return this.callParent("mouseEvent", arguments)
  4561. },
  4562. ll_button_mode: function(e) {
  4563. var t = this;
  4564. if (!t.visible) {
  4565. return
  4566. }
  4567. e.clickTarget = t;
  4568. if (t.hitTestPoint(e.offsetX, e.offsetY)) {
  4569. t.ll_modeOver(e)
  4570. } else {
  4571. t.ll_modeOut(e)
  4572. }
  4573. },
  4574. ll_modeDown: function(t) {
  4575. var n = t.clickTarget,
  4576. r, i, s, o, u, a, f, l, c;
  4577. if (!n.buttonMode || n.tween) {
  4578. return
  4579. }
  4580. if (n.state == e.STATE_DISABLE) {
  4581. n.upState.visible = false;
  4582. n.overState.visible = false;
  4583. n.downState.visible = false;
  4584. n.disableState.visible = true;
  4585. return
  4586. }
  4587. n.upState.visible = false;
  4588. n.overState.visible = false;
  4589. n.downState.visible = true;
  4590. n._tweenOver = n.ll_modeOver;
  4591. c = function(e) {
  4592. var t = e.parent;
  4593. delete t.tween;
  4594. t._tweenOver({
  4595. clickTarget: t
  4596. });
  4597. delete t._tweenOver
  4598. };
  4599. if (n.staticMode) {
  4600. n.tween = LTweenLiteTimeline.to(n.downState, .3, {}).to(n.downState, .1, {
  4601. onComplete: c
  4602. })
  4603. } else {
  4604. r = n.downState.getWidth();
  4605. i = n.downState.getHeight();
  4606. s = r * 1.1;
  4607. o = i * 1.1;
  4608. u = n.downState.x;
  4609. a = n.downState.y;
  4610. f = u + (r - s) * .5;
  4611. l = a + (i - o) * .5;
  4612. n.tween = LTweenLiteTimeline.to(n.downState, .3, {
  4613. x: f,
  4614. y: l,
  4615. scaleX: n._ll_down_sx * 1.1,
  4616. scaleY: n._ll_down_sy * 1.1,
  4617. ease: Quart.easeOut
  4618. }).to(n.downState, .1, {
  4619. x: u,
  4620. y: a,
  4621. scaleX: n._ll_down_sx,
  4622. scaleY: n._ll_down_sy,
  4623. ease: Quart.easeOut,
  4624. onComplete: c
  4625. })
  4626. }
  4627. },
  4628. ll_modeOver: function(t) {
  4629. var n = t.clickTarget;
  4630. if (!n.buttonMode) {
  4631. return
  4632. }
  4633. if (n.tween) {
  4634. n._tweenOver = n.ll_modeOver;
  4635. return
  4636. }
  4637. if (n.state == e.STATE_DISABLE) {
  4638. n.upState.visible = false;
  4639. n.overState.visible = false;
  4640. n.downState.visible = false;
  4641. n.disableState.visible = true;
  4642. return
  4643. }
  4644. n.upState.visible = false;
  4645. n.downState.visible = false;
  4646. n.overState.visible = true;
  4647. if (LGlobal.os == OS_PC && n._ll_cursorEnabled && n.parent) {
  4648. LGlobal.cursor = "pointer"
  4649. }
  4650. },
  4651. ll_modeOut: function(t) {
  4652. var n = t.clickTarget;
  4653. if (!n.buttonMode) {
  4654. return
  4655. }
  4656. if (n.tween) {
  4657. n._tweenOver = n.ll_modeOut;
  4658. return
  4659. }
  4660. if (n.state == e.STATE_DISABLE) {
  4661. n.upState.visible = false;
  4662. n.overState.visible = false;
  4663. n.downState.visible = false;
  4664. n.disableState.visible = true;
  4665. return
  4666. }
  4667. n.overState.visible = false;
  4668. n.downState.visible = false;
  4669. n.upState.visible = true
  4670. },
  4671. setCursorEnabled: function(e) {
  4672. this._ll_cursorEnabled = e
  4673. },
  4674. clone: function() {
  4675. var t = this;
  4676. return new e(t.upState.clone(), t.overState.clone(), t.downState.clone(), t.disableState.clone())
  4677. },
  4678. die: function() {
  4679. var e = this;
  4680. if (LMouseEventContainer.container[LMouseEvent.MOUSE_MOVE]) {
  4681. LMouseEventContainer.removeButton(e)
  4682. }
  4683. e.callParent("die", arguments)
  4684. }
  4685. };
  4686. for (var n in t) {
  4687. e.prototype[n] = t[n]
  4688. }
  4689. return e
  4690. }();
  4691. LBlendMode.SOURCE_OVER = "source-over";
  4692. LBlendMode.SOURCE_ATOP = "source-atop";
  4693. LBlendMode.SOURCE_IN = "source-in";
  4694. LBlendMode.SOURCE_OUT = "source-out";
  4695. LBlendMode.DESTINATION_OVER = "destination-over";
  4696. LBlendMode.DESTINATION_ATOP = "destination-atop";
  4697. LBlendMode.DESTINATION_IN = "destination-in";
  4698. LBlendMode.DESTINATION_OUT = "destination-out";
  4699. LBlendMode.LIGHTER = "lighter";
  4700. LBlendMode.COPY = "copy";
  4701. LBlendMode.XOR = "xor";
  4702. LBlendMode.NONE = null;
  4703. LBlendMode.NORMAL = null;
  4704. var LTextFieldType = function() {
  4705. throw "LTextFieldType cannot be instantiated"
  4706. };
  4707. LTextFieldType.INPUT = "input";
  4708. LTextFieldType.DYNAMIC = null;
  4709. var LTextField = function() {
  4710. function e() {
  4711. var t = this;
  4712. LExtends(t, LInteractiveObject, []);
  4713. t.type = "LTextField";
  4714. t.texttype = null;
  4715. t.text = "";
  4716. t.font = "Arial";
  4717. t.size = "11";
  4718. t.color = "#000000";
  4719. t.weight = "normal";
  4720. t.textAlign = "left";
  4721. t.textBaseline = "top";
  4722. t.heightMode = e.HEIGHT_MODE_BOTTOM;
  4723. t.stroke = false;
  4724. t.lineWidth = 1;
  4725. t.lineColor = "#000000";
  4726. t.width = 150;
  4727. t.height = t.size;
  4728. t.displayAsPassword = false;
  4729. t.wordWrap = false;
  4730. t.multiline = false;
  4731. t.numLines = 1;
  4732. t.speed = 0;
  4733. t._speedIndex = 100
  4734. }
  4735. e.HEIGHT_MODE_BOTTOM = "bottom";
  4736. e.HEIGHT_MODE_BASELINE = "baseline";
  4737. var t = {
  4738. _showReady: function(e) {
  4739. var t = this;
  4740. e.font = t.weight + " " + t.size + "pt " + t.font;
  4741. e.textAlign = t.textAlign;
  4742. e.textBaseline = t.textBaseline
  4743. },
  4744. _ll_show: function(e) {
  4745. var t = this,
  4746. n, r, i, s, o, u, a, f, l, c;
  4747. if (t.texttype == LTextFieldType.INPUT) {
  4748. t.inputBackLayer.ll_show();
  4749. s = t.getRootCoordinate();
  4750. if (LGlobal.inputBox.name == "input" + t.objectIndex) {
  4751. LGlobal.inputBox.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + ((s.y + t.inputBackLayer.startY()) * parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >>> 0) + "px";
  4752. LGlobal.inputBox.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + ((s.x + t.inputBackLayer.startX()) * parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width >>> 0) + "px"
  4753. }
  4754. if (LGlobal.inputTextField && LGlobal.inputTextField.objectIndex == t.objectIndex) {
  4755. return
  4756. }
  4757. }
  4758. r = t.text;
  4759. if (t.displayAsPassword) {
  4760. r = "";
  4761. for (i = 0, u = t.text.length; i < u; i++) {
  4762. r += "*"
  4763. }
  4764. }
  4765. e.fillStyle = t.color;
  4766. if (t.stroke) {
  4767. e.strokeStyle = t.lineColor;
  4768. e.lineWidth = t.lineWidth + 1
  4769. }
  4770. if (t.wordWrap || t.multiline) {
  4771. o = 0, a = 0, f = 0, l = 0;
  4772. for (i = 0, u = t.text.length; i < u; i++) {
  4773. c = /(?:\r\n|\r|\n|¥n)/.exec(r.substr(i, 1));
  4774. if (c) {
  4775. o = 0;
  4776. a = i + 1;
  4777. f++
  4778. }
  4779. if (!c) {
  4780. if (t.stroke) {
  4781. e.strokeText(r.substr(i, 1), o, f * t.wordHeight)
  4782. }
  4783. e.fillText(r.substr(i, 1), o, f * t.wordHeight)
  4784. }
  4785. t.numLines = f;
  4786. o = e.measureText(t.text.substr(a, i + 1 - a)).width;
  4787. if (t.wordWrap && o + e.measureText(r.substr(i, 1)).width > t.width) {
  4788. o = 0;
  4789. a = i + 1;
  4790. f++
  4791. }
  4792. }
  4793. t.height = (f + 1) * t.wordHeight
  4794. } else {
  4795. t.numLines = 1;
  4796. if (t.stroke) {
  4797. e.strokeText(r, 0, 0, e.measureText(r).width)
  4798. }
  4799. e.fillText(r, 0, 0, e.measureText(r).width)
  4800. } if (t.windRunning) {
  4801. t._ll_windRun()
  4802. }
  4803. },
  4804. _wordHeight: function(e) {
  4805. var t = this;
  4806. if (e > 0) {
  4807. t.wordHeight = e
  4808. } else {
  4809. t.wordWrap = false;
  4810. t.wordHeight = t.getHeight()
  4811. }
  4812. t.height = 0
  4813. },
  4814. setMultiline: function(e, t) {
  4815. var n = this;
  4816. if (e) {
  4817. n._wordHeight(t)
  4818. }
  4819. n.multiline = e
  4820. },
  4821. setWordWrap: function(e, t) {
  4822. var n = this;
  4823. if (e) {
  4824. n._wordHeight(t)
  4825. }
  4826. n.wordWrap = e
  4827. },
  4828. setType: function(e, t) {
  4829. var n = this;
  4830. if (n.texttype != e && e == LTextFieldType.INPUT) {
  4831. if (t == null || t.type != "LSprite") {
  4832. n.inputBackLayer = new LSprite;
  4833. n.inputBackLayer.graphics.drawRect(1, "#000000", [0, -n.getHeight() * .4, n.width, n.getHeight() * 1.5])
  4834. } else {
  4835. n.inputBackLayer = t
  4836. }
  4837. n.inputBackLayer.parent = n;
  4838. if (LMouseEventContainer.container[LMouseEvent.MOUSE_DOWN]) {
  4839. LMouseEventContainer.pushInputBox(n)
  4840. }
  4841. } else {
  4842. n.inputBackLayer = null;
  4843. LMouseEventContainer.removeInputBox(n)
  4844. }
  4845. n.texttype = e
  4846. },
  4847. ismouseon: function(e, t) {
  4848. var n = this;
  4849. if (!e) {
  4850. return false
  4851. }
  4852. if (!n.visible) {
  4853. return false
  4854. }
  4855. if (!t) {
  4856. t = {
  4857. x: 0,
  4858. y: 0,
  4859. scaleX: 1,
  4860. scaleY: 1
  4861. }
  4862. }
  4863. if (n.mask) {
  4864. if (!n.mask.parent) {
  4865. n.mask.parent = n.parent
  4866. }
  4867. if (!n.mask.ismouseon(e, t)) {
  4868. return false
  4869. }
  4870. }
  4871. if (n.inputBackLayer) {
  4872. return n.inputBackLayer.ismouseon(e, {
  4873. x: n.x * t.scaleX + t.x,
  4874. y: n.y * t.scaleY + t.y,
  4875. scaleX: t.scaleX * n.scaleX,
  4876. scaleY: t.scaleY * n.scaleY
  4877. })
  4878. }
  4879. return n.ismouseonShapes([{
  4880. type: LShape.RECT,
  4881. arg: [0, 0, n._getWidth(), n._getHeight()]
  4882. }], e.offsetX, e.offsetY)
  4883. },
  4884. clone: function() {
  4885. var e = this,
  4886. t = new e.constructor;
  4887. t.copyProperty(e);
  4888. t.texttype = null;
  4889. if (e.texttype == LTextFieldType.INPUT) {
  4890. t.setType(LTextFieldType.INPUT)
  4891. }
  4892. return t
  4893. },
  4894. mouseEvent: function(e, t, n) {
  4895. var r = this,
  4896. i;
  4897. if (r.inputBackLayer == null) {
  4898. return
  4899. }
  4900. i = r.ismouseon(e, n);
  4901. if (t != LMouseEvent.MOUSE_DOWN || !i) {
  4902. return
  4903. }
  4904. r.focus()
  4905. },
  4906. _ll_getValue: function() {
  4907. if (LGlobal.inputBox.style.display != NONE) {
  4908. LGlobal.inputTextField.text = LGlobal.inputTextBox.value;
  4909. LEvent.removeEventListener(LGlobal.inputTextBox, LKeyboardEvent.KEY_DOWN, LGlobal.inputTextField._ll_input);
  4910. LGlobal.inputBox.style.display = NONE;
  4911. LGlobal.inputTextField.dispatchEvent(LFocusEvent.FOCUS_OUT);
  4912. LGlobal.inputTextField = null
  4913. }
  4914. },
  4915. updateInput: function() {
  4916. var e = this;
  4917. if (e.texttype == LTextFieldType.INPUT && LGlobal.inputTextField.objectIndex == e.objectIndex) {
  4918. LGlobal.inputTextBox.value = LGlobal.inputTextField.text
  4919. }
  4920. },
  4921. _ll_input: function(e) {
  4922. var t = new LEvent(LTextEvent.TEXT_INPUT);
  4923. t.keyCode = e.keyCode;
  4924. LGlobal.inputTextField.text = LGlobal.inputTextBox.value;
  4925. if (LGlobal.inputTextField.hasEventListener(LTextEvent.TEXT_INPUT)) {
  4926. e.returnValue = LGlobal.inputTextField.dispatchEvent(t)
  4927. } else {
  4928. e.returnValue = true
  4929. }
  4930. },
  4931. focus: function() {
  4932. var e = this,
  4933. t, n;
  4934. if (!e.parent) {
  4935. return
  4936. }
  4937. if (e.texttype != LTextFieldType.INPUT) {
  4938. return
  4939. }
  4940. if (LGlobal.inputTextField && LGlobal.inputTextField.objectIndex != e.objectIndex) {
  4941. e._ll_getValue()
  4942. }
  4943. e.dispatchEvent(LFocusEvent.FOCUS_IN);
  4944. t = e.getAbsoluteScale();
  4945. LGlobal.inputBox.style.display = "";
  4946. LGlobal.inputBox.name = "input" + e.objectIndex;
  4947. LGlobal.inputTextField = e;
  4948. LGlobal.inputTextareaBoxObj.style.display = NONE;
  4949. LGlobal.inputTextBoxObj.style.display = NONE;
  4950. LGlobal.passwordBoxObj.style.display = NONE;
  4951. if (e.displayAsPassword) {
  4952. LGlobal.inputTextBox = LGlobal.passwordBoxObj
  4953. } else if (e.multiline) {
  4954. LGlobal.inputTextBox = LGlobal.inputTextareaBoxObj
  4955. } else {
  4956. LGlobal.inputTextBox = LGlobal.inputTextBoxObj
  4957. }
  4958. n = parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width;
  4959. sy = parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height;
  4960. LGlobal.inputTextBox.style.display = "";
  4961. LGlobal.inputTextBox.value = e.text;
  4962. LGlobal.inputTextBox.style.height = e.inputBackLayer.getHeight() * t.scaleY * e.scaleY * sy + "px";
  4963. LGlobal.inputTextBox.style.width = e.inputBackLayer.getWidth() * t.scaleX * e.scaleX * n + "px";
  4964. LGlobal.inputTextBox.style.color = e.color;
  4965. LGlobal.inputTextBox.style.fontSize = (e.size * parseFloat(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >> 0) + "px";
  4966. LGlobal.inputTextBox.style.fontFamily = e.font;
  4967. LEvent.addEventListener(LGlobal.inputTextBox, LKeyboardEvent.KEY_DOWN, LGlobal.inputTextField._ll_input);
  4968. if (e.texttype == LTextFieldType.INPUT) {
  4969. rc = e.getRootCoordinate();
  4970. if (LGlobal.inputBox.name == "input" + e.objectIndex) {
  4971. LGlobal.inputBox.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + ((rc.y + e.inputBackLayer.startY()) * parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height >>> 0) + "px";
  4972. LGlobal.inputBox.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + ((rc.x + e.inputBackLayer.startX()) * parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width >>> 0) + "px"
  4973. }
  4974. }
  4975. setTimeout(function() {
  4976. LGlobal.inputTextBox.focus()
  4977. }, 0)
  4978. },
  4979. _getWidth: function() {
  4980. var e = this;
  4981. if (e.wordWrap) {
  4982. return e.width
  4983. }
  4984. LGlobal.canvas.font = e.size + "pt " + e.font;
  4985. return LGlobal.canvas.measureText(e.text).width
  4986. },
  4987. getWidth: function(e) {
  4988. var t = this,
  4989. n, r, i;
  4990. n = t._getWidth() * t.scaleX;
  4991. if (e && t.mask) {
  4992. r = t.mask._startX ? t.mask._startX() : t.mask.startX();
  4993. if (r > n) {
  4994. return 0
  4995. }
  4996. i = t.mask.getWidth();
  4997. if (r + i > n) {
  4998. return n - r
  4999. } else {
  5000. return i
  5001. }
  5002. }
  5003. return n
  5004. },
  5005. _getHeight: function() {
  5006. var t = this,
  5007. n = LGlobal.canvas,
  5008. r, i, s, o, u, a;
  5009. if (t.wordWrap) {
  5010. n.font = t.weight + " " + t.size + "pt " + t.font;
  5011. if (t.height == 0) {
  5012. s = 0, o = 0, u = 0;
  5013. for (r = 0, i = t.text.length; r < i; r++) {
  5014. s = n.measureText(t.text.substr(o, r - o)).width;
  5015. a = /(?:\r\n|\r|\n|¥n)/.exec(t.text.substr(r, 1));
  5016. if (t.wordWrap && s > t.width || a) {
  5017. s = 0;
  5018. o = r;
  5019. u++;
  5020. if (a) {
  5021. o++
  5022. }
  5023. }
  5024. }
  5025. t.height = (u + 1) * t.wordHeight
  5026. }
  5027. return t.height
  5028. }
  5029. n.font = t.weight + " " + t.size + "pt " + t.font;
  5030. i = n.measureText("O").width * 1.2;
  5031. if (t.heightMode == e.HEIGHT_MODE_BASELINE) {
  5032. i = i * 1.2
  5033. }
  5034. return i
  5035. },
  5036. getHeight: function(e) {
  5037. var t = this,
  5038. n, r, i;
  5039. n = t._getHeight() * t.scaleY;
  5040. if (e && t.mask) {
  5041. r = t.mask._startY ? t.mask._startY() : t.mask.startY();
  5042. if (r > n) {
  5043. return 0
  5044. }
  5045. i = t.mask.getHeight();
  5046. if (r + i > n) {
  5047. return n - r
  5048. } else {
  5049. return i
  5050. }
  5051. }
  5052. return n
  5053. },
  5054. wind: function(e) {
  5055. var t = this;
  5056. t.wind_over_function = e;
  5057. t.windRunning = true;
  5058. t._ll_wind_text = t.text;
  5059. t.text = "";
  5060. t._ll_wind_length = 0
  5061. },
  5062. _ll_windRun: function() {
  5063. var e = this;
  5064. if (e._speedIndex++ < e.speed) {
  5065. return
  5066. }
  5067. e._speedIndex = 0;
  5068. if (e._ll_wind_length > e._ll_wind_text.length) {
  5069. e.windRunning = false;
  5070. if (e.wind_over_function) {
  5071. e.wind_over_function()
  5072. }
  5073. e.dispatchEvent(new LEvent(LTextEvent.WIND_COMPLETE));
  5074. return
  5075. }
  5076. e.text = e._ll_wind_text.substring(0, e._ll_wind_length);
  5077. e._ll_wind_length++
  5078. },
  5079. die: function() {
  5080. LMouseEventContainer.removeInputBox(this)
  5081. }
  5082. };
  5083. for (var n in t) {
  5084. e.prototype[n] = t[n]
  5085. }
  5086. return e
  5087. }();
  5088. var LBitmap = function() {
  5089. function e(e) {
  5090. var t = this;
  5091. LExtends(t, LDisplayObject, []);
  5092. t.type = "LBitmap";
  5093. t.rotateCenter = true;
  5094. t.bitmapData = e;
  5095. if (t.bitmapData) {
  5096. t.width = t.bitmapData.width;
  5097. t.height = t.bitmapData.height
  5098. }
  5099. }
  5100. var t = {
  5101. _canShow: function() {
  5102. return this.visible && this.bitmapData
  5103. },
  5104. _rotateReady: function() {
  5105. var e = this;
  5106. if (e.rotate != 0 && e.rotateCenter) {
  5107. e.rotatex = e.getWidth() * .5;
  5108. e.rotatey = e.getHeight() * .5
  5109. } else {
  5110. e.rotatex = e.rotatey = 0
  5111. }
  5112. },
  5113. _coordinate: function(e) {},
  5114. _ll_show: function() {
  5115. this.ll_draw()
  5116. },
  5117. ll_draw: function() {
  5118. var e = this;
  5119. LGlobal.canvas.drawImage(e.bitmapData.image, e.bitmapData.x, e.bitmapData.y, e.bitmapData.width, e.bitmapData.height, e.x, e.y, e.bitmapData.width, e.bitmapData.height)
  5120. },
  5121. clone: function() {
  5122. var t = this,
  5123. n = new e(t.bitmapData.clone());
  5124. n.copyProperty(t);
  5125. n.rotateCenter = t.rotateCenter;
  5126. return n
  5127. },
  5128. ismouseon: function(e, t) {
  5129. var n = this;
  5130. if (!e) {
  5131. return false
  5132. }
  5133. if (!n.visible || !n.bitmapData) {
  5134. return false
  5135. }
  5136. if (n.mask) {
  5137. if (!n.mask.parent) {
  5138. n.mask.parent = n.parent
  5139. }
  5140. if (!n.mask.ismouseon(e, t)) {
  5141. return false
  5142. }
  5143. }
  5144. return n.ismouseonShapes([{
  5145. type: LShape.RECT,
  5146. arg: [0, 0, n.bitmapData.width, n.bitmapData.height]
  5147. }], e.offsetX, e.offsetY)
  5148. },
  5149. getWidth: function(e) {
  5150. var t = this,
  5151. n, r, i;
  5152. n = t.bitmapData != null ? t.bitmapData.width * (t.scaleX > 0 ? t.scaleX : -t.scaleX) : 0;
  5153. if (e && t.mask) {
  5154. r = t.mask._startX ? t.mask._startX() : t.mask.startX();
  5155. if (r > n) {
  5156. return 0
  5157. }
  5158. i = t.mask.getWidth();
  5159. if (r + i > n) {
  5160. return n - r
  5161. } else {
  5162. return i
  5163. }
  5164. }
  5165. return n
  5166. },
  5167. getHeight: function(e) {
  5168. var t = this,
  5169. n, r, i;
  5170. n = t.bitmapData != null ? t.bitmapData.height * (t.scaleY > 0 ? t.scaleY : -t.scaleY) : 0;
  5171. if (e && t.mask) {
  5172. r = t.mask._startY ? t.mask._startY() : t.mask.startY();
  5173. if (r > n) {
  5174. return 0
  5175. }
  5176. i = t.mask.getHeight();
  5177. if (r + i > n) {
  5178. return n - r
  5179. } else {
  5180. return i
  5181. }
  5182. }
  5183. return n
  5184. },
  5185. startX: function() {
  5186. return this.x
  5187. },
  5188. startY: function() {
  5189. return this.y
  5190. },
  5191. die: function() {}
  5192. };
  5193. for (var n in t) {
  5194. e.prototype[n] = t[n]
  5195. }
  5196. return e
  5197. }();
  5198. var LBitmapData = function() {
  5199. function e(t, n, r, i, s, o) {
  5200. var u = this;
  5201. LExtends(u, LObject, []);
  5202. u.type = "LBitmapData";
  5203. if (typeof o == UNDEFINED) {
  5204. o = e.DATA_IMAGE
  5205. }
  5206. u.oncomplete = null;
  5207. u._locked = false;
  5208. u._setPixel = false;
  5209. u.x = n == null ? 0 : n;
  5210. u.y = r == null ? 0 : r;
  5211. u.width = 0;
  5212. u.height = 0;
  5213. u.dataType = null;
  5214. if (t && typeof t == "object") {
  5215. u.image = t;
  5216. u.dataType = e.DATA_IMAGE;
  5217. u.width = i == null ? u.image.width : i;
  5218. u.height = s == null ? u.image.height : s;
  5219. u._setDataType(o)
  5220. } else {
  5221. u._createCanvas();
  5222. u.dataType = e.DATA_CANVAS;
  5223. u._canvas.width = u.width = i == null ? 1 : i;
  5224. u._canvas.height = u.height = s == null ? 1 : s;
  5225. if (typeof t == "string") {
  5226. t = parseInt(t.replace("#", "0x"))
  5227. }
  5228. if (typeof t == "number") {
  5229. var a = u._context.createImageData(u.width, u.height);
  5230. for (var f = 0; f < a.data.length; f += 4) {
  5231. a.data[f + 0] = t >> 16 & 255;
  5232. a.data[f + 1] = t >> 8 & 255;
  5233. a.data[f + 2] = t & 255;
  5234. a.data[f + 3] = 255
  5235. }
  5236. u._context.putImageData(a, 0, 0)
  5237. }
  5238. u.image = u._canvas;
  5239. if (o == e.DATA_IMAGE) {
  5240. u._setDataType(o)
  5241. }
  5242. }
  5243. u.resize()
  5244. }
  5245. e.DATA_IMAGE = "data_image";
  5246. e.DATA_CANVAS = "data_canvas";
  5247. var t = {
  5248. _setDataType: function(t) {
  5249. var n = this;
  5250. if (n.dataType == t) {
  5251. return
  5252. }
  5253. if (t == e.DATA_CANVAS) {
  5254. n._createCanvas();
  5255. n._canvas.width = n.image.width;
  5256. n._canvas.height = n.image.height;
  5257. n._context.clearRect(0, 0, n._canvas.width, n._canvas.height);
  5258. n._context.drawImage(n.image, 0, 0);
  5259. n.image = n._canvas
  5260. } else if (t == e.DATA_IMAGE) {
  5261. n.image = new Image;
  5262. n.image.width = n._canvas.width;
  5263. n.image.height = n._canvas.height;
  5264. n.image.src = n._canvas.toDataURL()
  5265. }
  5266. n.dataType = t
  5267. },
  5268. _createCanvas: function() {
  5269. var e = this;
  5270. if (!e._canvas) {
  5271. e._canvas = document.createElement("canvas");
  5272. e._context = e._canvas.getContext("2d")
  5273. }
  5274. },
  5275. clear: function() {
  5276. var t = this;
  5277. t._createCanvas();
  5278. t._canvas.width = t.image.width;
  5279. if (t.dataType == e.DATA_IMAGE) {
  5280. t.image.src = t._canvas.toDataURL()
  5281. }
  5282. },
  5283. setProperties: function(e, t, n, r) {
  5284. var i = this;
  5285. i.x = e;
  5286. i.y = t;
  5287. i.width = n;
  5288. i.height = r;
  5289. i.resize()
  5290. },
  5291. setCoordinate: function(e, t) {
  5292. var n = this;
  5293. n.x = e;
  5294. n.y = t;
  5295. n.resize()
  5296. },
  5297. clone: function() {
  5298. var t = this;
  5299. return new e(t.image, t.x, t.y, t.width, t.height, t.dataType)
  5300. },
  5301. _ready: function() {
  5302. var t = this;
  5303. t._dataType = t.dataType;
  5304. t._setDataType(e.DATA_CANVAS);
  5305. t._data = t._context.getImageData(t.x, t.y, t.width, t.height)
  5306. },
  5307. _update: function() {
  5308. var e = this;
  5309. e._context.putImageData(e._data, e.x, e.y, 0, 0, e.width, e.height);
  5310. e._setDataType(e._dataType);
  5311. e._data = null
  5312. },
  5313. getPixel: function(e, t, n) {
  5314. var r = this,
  5315. i, s;
  5316. e = e >> 0;
  5317. t = t >> 0;
  5318. if (!r._locked) {
  5319. r._ready()
  5320. }
  5321. i = r.width * 4 * t + e * 4;
  5322. s = r._data.data;
  5323. if (!r._locked) {
  5324. r._update()
  5325. }
  5326. if (n == "number") {
  5327. return s[i] << 16 | s[i + 1] << 8 | s[i + 2]
  5328. } else {
  5329. return [s[i], s[i + 1], s[i + 2], s[i + 3]]
  5330. }
  5331. },
  5332. setPixel: function(e, t, n) {
  5333. var r = this;
  5334. e = e >> 0;
  5335. t = t >> 0;
  5336. if (!r._locked) {
  5337. r._ready()
  5338. }
  5339. var i = r._data,
  5340. s = r.width * 4 * t + e * 4;
  5341. if (typeof n == "object") {
  5342. i.data[s + 0] = n[0];
  5343. i.data[s + 1] = n[1];
  5344. i.data[s + 2] = n[2];
  5345. i.data[s + 3] = n[3]
  5346. } else {
  5347. if (typeof n == "string") {
  5348. n = parseInt(n.replace("#", "0x"))
  5349. }
  5350. i.data[s + 0] = n >> 16 & 255;
  5351. i.data[s + 1] = n >> 8 & 255;
  5352. i.data[s + 2] = n & 255;
  5353. i.data[s + 3] = 255
  5354. } if (!r._locked) {
  5355. r._update()
  5356. }
  5357. },
  5358. getPixels: function(e) {
  5359. var t = this,
  5360. n;
  5361. if (!t._locked) {
  5362. t._ready()
  5363. }
  5364. n = t._context.getImageData(t.x + e.x, t.y + e.y, e.width, e.height);
  5365. if (!t._locked) {
  5366. t._update()
  5367. }
  5368. return n
  5369. },
  5370. setPixels: function(e, t) {
  5371. var n = this,
  5372. r, i, s, o, u, a, f;
  5373. if (!n._locked) {
  5374. n._ready()
  5375. }
  5376. s = n._data;
  5377. if (typeof t == "object") {
  5378. o = n._canvas.width;
  5379. for (a = e.x; a < e.right; a++) {
  5380. for (f = e.y; f < e.bottom; f++) {
  5381. r = o * 4 * (n.y + f) + (n.x + a) * 4;
  5382. i = t.width * 4 * (f - e.y) + (a - e.x) * 4;
  5383. s.data[r + 0] = t.data[i + 0];
  5384. s.data[r + 1] = t.data[i + 1];
  5385. s.data[r + 2] = t.data[i + 2];
  5386. s.data[r + 3] = t.data[i + 3]
  5387. }
  5388. }
  5389. } else {
  5390. if (typeof t == "string") {
  5391. t = parseInt(t.replace("#", "0x"))
  5392. }
  5393. t = [t >> 16 & 255, t >> 8 & 255, t & 255];
  5394. o = n._canvas.width;
  5395. for (a = e.x; a < e.right; a++) {
  5396. for (f = e.y; f < e.bottom; f++) {
  5397. r = o * 4 * (n.y + f) + (n.x + a) * 4;
  5398. s.data[r + 0] = t[0];
  5399. s.data[r + 1] = t[1];
  5400. s.data[r + 2] = t[2];
  5401. s.data[r + 3] = 255
  5402. }
  5403. }
  5404. } if (!n._locked) {
  5405. n._update()
  5406. }
  5407. },
  5408. putPixels: function(t, n) {
  5409. var r = this;
  5410. if (r.dataType != e.DATA_CANVAS || typeof n != "object") {
  5411. return
  5412. }
  5413. r._context.putImageData(n, r.x + t.x, r.y + t.y, 0, 0, t.width, t.height)
  5414. },
  5415. lock: function() {
  5416. var e = this;
  5417. e._locked = true;
  5418. e._ready()
  5419. },
  5420. unlock: function() {
  5421. var e = this;
  5422. e._locked = false;
  5423. e._update()
  5424. },
  5425. draw: function(t, n, r, i, s) {
  5426. var o = this,
  5427. u, a = t,
  5428. f, l, c, h, p = false;
  5429. var d = o.dataType;
  5430. o._setDataType(e.DATA_CANVAS);
  5431. if (n || r || i || s) {
  5432. o._context.save();
  5433. p = true
  5434. }
  5435. if (s) {
  5436. if (!(a instanceof e)) {
  5437. f = l = 0
  5438. } else {
  5439. f = a.x;
  5440. l = a.y
  5441. }
  5442. a = new e(a.getDataCanvas(), f + s.x, l + s.y, s.width, s.height, e.DATA_CANVAS)
  5443. }
  5444. c = a.getWidth() >>> 0;
  5445. h = a.getHeight() >>> 0;
  5446. if (c == 0 || h == 0) {
  5447. o._setDataType(d);
  5448. return
  5449. }
  5450. u = a.getDataCanvas();
  5451. if (r) {
  5452. a.colorTransform(new LRectangle(0, 0, c, h), r);
  5453. u = a.image
  5454. }
  5455. if (n) {
  5456. o._context.setTransform(n.a, n.b, n.c, n.d, n.tx, n.ty)
  5457. }
  5458. if (i) {
  5459. o._context.globalCompositeOperation = i
  5460. }
  5461. o._context.drawImage(u, a.x, a.y, c, h, 0, 0, c, h);
  5462. if (p) {
  5463. o._context.restore()
  5464. }
  5465. o._setDataType(d);
  5466. o.resize()
  5467. },
  5468. getDataCanvas: function() {
  5469. var t = this;
  5470. var n = t.dataType;
  5471. t._setDataType(e.DATA_CANVAS);
  5472. t._setDataType(n);
  5473. return t._canvas
  5474. },
  5475. getWidth: function() {
  5476. return this.width
  5477. },
  5478. getHeight: function() {
  5479. return this.height
  5480. },
  5481. resize: function() {
  5482. var e = this,
  5483. t = e.image.width - e.x,
  5484. n = e.image.height - e.y;
  5485. e.width = e.width < t ? e.width : t;
  5486. e.height = e.height < n ? e.height : n
  5487. },
  5488. colorTransform: function(t, n) {
  5489. var r = this;
  5490. if (r.dataType != e.DATA_CANVAS) {
  5491. return
  5492. }
  5493. var i = t.x >> 0,
  5494. s = t.y >> 0,
  5495. o = t.width >> 0,
  5496. u = t.height >> 0;
  5497. var a = r._context.getImageData(r.x + t.x, r.y + t.y, t.width, t.height);
  5498. var f = a.data;
  5499. for (var l = 0, c = f.length; l < c; l += 4) {
  5500. var h = l,
  5501. p = l + 1,
  5502. d = l + 2,
  5503. v = l + 3;
  5504. f[h] = f[h] * n.redMultiplier + n.redOffset;
  5505. f[p] = f[p] * n.greenMultiplier + n.greenOffset;
  5506. f[d] = f[d] * n.blueMultiplier + n.blueOffset;
  5507. f[v] = f[v] * n.alphaMultiplier + n.alphaOffset
  5508. }
  5509. r._context.putImageData(a, r.x + t.x, r.y + t.y, 0, 0, t.width, t.height)
  5510. },
  5511. copyPixels: function(t, n, r) {
  5512. var i = this,
  5513. s, o, u, a, f = t;
  5514. if (i.dataType != e.DATA_CANVAS) {
  5515. return
  5516. }
  5517. s = f.x;
  5518. o = f.y;
  5519. u = f.width;
  5520. a = f.height;
  5521. f.setProperties(n.x + f.x, n.y + f.y, n.width, n.height);
  5522. i._context.drawImage(f.image, f.x, f.y, f.width, f.height, r.x, r.y, f.width, f.height);
  5523. f.x = s;
  5524. f.y = o;
  5525. f.width = u;
  5526. f.height = a
  5527. }
  5528. };
  5529. for (var n in t) {
  5530. e.prototype[n] = t[n]
  5531. }
  5532. return e
  5533. }();
  5534. var LDropShadowFilter = function() {
  5535. function e(e, t, n, r) {
  5536. var i = this;
  5537. LExtends(i, LObject, []);
  5538. i.type = "LDropShadowFilter";
  5539. i.distance = e ? e : 0;
  5540. i.angle = t ? t : 0;
  5541. i.shadowColor = n ? n : "#000000";
  5542. i.shadowBlur = r ? r : 20;
  5543. i.setShadowOffset()
  5544. }
  5545. var t = {
  5546. setShadowOffset: function() {
  5547. var e = this;
  5548. var t = e.angle * Math.PI / 180;
  5549. e.shadowOffsetX = e.distance * Math.cos(t);
  5550. e.shadowOffsetY = e.distance * Math.sin(t)
  5551. },
  5552. ll_show: function() {
  5553. var e = this,
  5554. t = LGlobal.canvas;
  5555. t.shadowColor = e.shadowColor;
  5556. t.shadowBlur = e.shadowBlur;
  5557. t.shadowOffsetX = e.shadowOffsetX;
  5558. t.shadowOffsetY = e.shadowOffsetY
  5559. },
  5560. setDistance: function(e) {
  5561. this.distance = e;
  5562. this.setShadowOffset()
  5563. },
  5564. setAngle: function(e) {
  5565. this.angle = e;
  5566. this.setShadowOffset()
  5567. },
  5568. setColor: function(e) {
  5569. this.shadowColor = e
  5570. },
  5571. setBlur: function(e) {
  5572. this.shadowBlur = e
  5573. }
  5574. };
  5575. for (var n in t) {
  5576. e.prototype[n] = t[n]
  5577. }
  5578. return e
  5579. }();
  5580. var LAnimation = function() {
  5581. function e(e, t, n) {
  5582. var r = this;
  5583. LExtends(r, LSprite, []);
  5584. r.type = "LAnimation";
  5585. r.rowIndex = 0;
  5586. r.colIndex = 0;
  5587. r._ll_stepIndex = 0;
  5588. r._ll_stepArray = [];
  5589. r.mode = 1;
  5590. r.isMirror = false;
  5591. r.bitmap = new LBitmap(t);
  5592. r.imageArray = n;
  5593. r.addChild(r.bitmap);
  5594. if (e != null) {
  5595. e.addChild(r)
  5596. }
  5597. r.onframe();
  5598. r.colIndex = 0
  5599. }
  5600. var t = {
  5601. setAction: function(e, t, n, r) {
  5602. var i = this,
  5603. s = false;
  5604. if (e != null && e >= 0 && e < i.imageArray.length) {
  5605. i.rowIndex = e;
  5606. s = true
  5607. }
  5608. if (t != null && t >= 0 && t < i.imageArray[e].length) {
  5609. i.colIndex = t;
  5610. s = true
  5611. }
  5612. if (n != null) {
  5613. i.mode = n;
  5614. s = true
  5615. }
  5616. if (r != null) {
  5617. i.isMirror = r;
  5618. if (i.isMirror) {
  5619. i.bitmap.x = i.bitmap.getWidth();
  5620. i.bitmap.scaleX = -1 * Math.abs(i.bitmap.scaleX)
  5621. } else {
  5622. i.bitmap.x = 0;
  5623. i.bitmap.scaleX = Math.abs(i.bitmap.scaleX)
  5624. }
  5625. s = true
  5626. }
  5627. if (s) {
  5628. i._ll_stepIndex = 0
  5629. }
  5630. },
  5631. getAction: function() {
  5632. var e = this;
  5633. return [e.rowIndex, e.colIndex, e.mode, e.isMirror]
  5634. },
  5635. onframe: function() {
  5636. var e = this,
  5637. t, n = null;
  5638. if (e.colIndex >= e.imageArray[e.rowIndex].length) {
  5639. e.colIndex = 0
  5640. }
  5641. t = e.imageArray[e.rowIndex][e.colIndex];
  5642. if (e._ll_stepArray[e.rowIndex] && e._ll_stepArray[e.rowIndex][e.colIndex]) {
  5643. n = e._ll_stepArray[e.rowIndex][e.colIndex]
  5644. } else {
  5645. n = 0
  5646. } if (e._ll_stepIndex == 0) {
  5647. if (typeof t.script == "function") {
  5648. t.script(e, t.params)
  5649. }
  5650. if (typeof t.width != UNDEFINED && typeof t.height != UNDEFINED) {
  5651. e.bitmap.bitmapData.setProperties(t.x, t.y, t.width, t.height)
  5652. } else {
  5653. e.bitmap.bitmapData.setCoordinate(t.x, t.y)
  5654. } if (typeof t.sx != UNDEFINED) {
  5655. e.bitmap.x = t.sx
  5656. }
  5657. if (typeof t.sy != UNDEFINED) {
  5658. e.bitmap.y = t.sy
  5659. }
  5660. if (typeof t.mirror != UNDEFINED) {
  5661. e.bitmap.rotateCenter = false;
  5662. if (t.mirror) {
  5663. e.bitmap.x = e.bitmap.getWidth();
  5664. e.bitmap.scaleX = -1 * Math.abs(e.bitmap.scaleX)
  5665. } else {
  5666. e.bitmap.x = 0;
  5667. e.bitmap.scaleX = Math.abs(e.bitmap.scaleX)
  5668. }
  5669. }
  5670. }
  5671. if (e._ll_stepIndex++ < n) {
  5672. return
  5673. }
  5674. e._ll_stepIndex = 0;
  5675. e.colIndex += e.mode;
  5676. if (e.colIndex >= e.imageArray[e.rowIndex].length || e.colIndex < 0) {
  5677. e.colIndex = e.mode > 0 ? 0 : e.imageArray[e.rowIndex].length - 1;
  5678. e.dispatchEvent(LEvent.COMPLETE)
  5679. }
  5680. },
  5681. clone: function() {
  5682. var t = this,
  5683. n = new e(null, t.bitmap.bitmapData, t.imageArray.slice(0));
  5684. n.copyProperty(t);
  5685. n.childList.length = 0;
  5686. n.bitmap = t.bitmap.clone();
  5687. n.addChild(n.bitmap);
  5688. return n
  5689. }
  5690. };
  5691. for (var n in t) {
  5692. e.prototype[n] = t[n]
  5693. }
  5694. return e
  5695. }();
  5696. var LAnimationTimeline = function() {
  5697. function e(e, t) {
  5698. var n = this;
  5699. LExtends(n, LAnimation, [null, e, t]);
  5700. n.type = "LAnimationTimeline";
  5701. n.speed = 0;
  5702. n._speedIndex = 0;
  5703. n.ll_labelList = {};
  5704. for (var r = 0, i, s, o; r < t.length; r++) {
  5705. i = t[r];
  5706. for (s = 0; s < i.length; s++) {
  5707. o = i[s];
  5708. if (o.label) {
  5709. n.setLabel(o.label, r, s, 1, o.isMirror ? true : false)
  5710. }
  5711. }
  5712. }
  5713. n.addEventListener(LEvent.ENTER_FRAME, n._ll_onframe)
  5714. }
  5715. var t = {
  5716. clone: function() {
  5717. var e = this,
  5718. t, n, r = new LAnimation(null, e.bitmap.bitmapData, e.imageArray.slice(0));
  5719. r.copyProperty(e);
  5720. r.childList.length = 0;
  5721. r.bitmap = e.bitmap.clone();
  5722. r.addChild(r.bitmap);
  5723. for (t in e.ll_labelList) {
  5724. n = e.ll_labelList[t];
  5725. r.ll_labelList[t] = {
  5726. rowIndex: n.rowIndex,
  5727. colIndex: n.colIndex,
  5728. mode: n.mode,
  5729. isMirror: n.isMirror
  5730. }
  5731. }
  5732. return r
  5733. },
  5734. setFrameSpeedAt: function(e, t, n) {
  5735. var r = this;
  5736. if (!r._ll_stepArray[e]) {
  5737. r._ll_stepArray[e] = []
  5738. }
  5739. r._ll_stepArray[e][t] = n
  5740. },
  5741. _ll_onframe: function(e) {
  5742. var t = e.target;
  5743. if (t._ll_stop) {
  5744. return
  5745. }
  5746. if (t._speedIndex++ < t.speed) {
  5747. return
  5748. }
  5749. t._speedIndex = 0;
  5750. t.onframe()
  5751. },
  5752. setLabel: function(e, t, n, r, i) {
  5753. this.ll_labelList[e] = {
  5754. rowIndex: t,
  5755. colIndex: n,
  5756. mode: r,
  5757. isMirror: i
  5758. }
  5759. },
  5760. play: function() {
  5761. this._ll_stop = false
  5762. },
  5763. stop: function() {
  5764. this._ll_stop = true
  5765. },
  5766. gotoAndPlay: function(e) {
  5767. var t = this,
  5768. n = t.ll_labelList[e];
  5769. t.setAction(n.rowIndex, n.colIndex, n.mode, n.isMirror);
  5770. t.onframe();
  5771. t.play()
  5772. },
  5773. gotoAndStop: function(e) {
  5774. var t = this,
  5775. n = t.ll_labelList[e];
  5776. t.setAction(n.rowIndex, n.colIndex, n.mode, n.isMirror);
  5777. t.onframe();
  5778. t.stop()
  5779. },
  5780. addFrameScript: function(e, t, n) {
  5781. var r = this.ll_labelList[e];
  5782. var i = this.imageArray[r.rowIndex][r.colIndex];
  5783. i.script = t;
  5784. i.params = n ? n : null
  5785. },
  5786. removeFrameScript: function(e) {
  5787. var t = this.ll_labelList[e];
  5788. this.imageArray[t.rowIndex][t.colIndex].script = null
  5789. }
  5790. };
  5791. for (var n in t) {
  5792. e.prototype[n] = t[n]
  5793. }
  5794. return e
  5795. }();
  5796. var LLoadManage = function() {
  5797. function e() {
  5798. this.llname = "ll.file.";
  5799. this.llload = "ll.load."
  5800. }
  5801. e.prototype = {
  5802. load: function(e, t, n) {
  5803. var r = this;
  5804. r.list = e, r.onupdate = t, r.oncomplete = n;
  5805. r.loader = r, r.index = 0, r.loadIndex = 0, r.result = [], r.lresult = [];
  5806. r.loadInit()
  5807. },
  5808. loadInit: function() {
  5809. var e = this;
  5810. if (e.index >= e.list.length) {
  5811. return
  5812. }
  5813. e.loadIndex = 0;
  5814. e.loadStart();
  5815. e.reloadtime = setTimeout(e.loadInit.bind(e), 1e4)
  5816. },
  5817. loadStart: function() {
  5818. var e = this,
  5819. t, n, r, i;
  5820. if (e.loadIndex >= e.list.length) {
  5821. return
  5822. }
  5823. t = e.list[e.loadIndex];
  5824. if (!t.name) {
  5825. t.name = e.llname + e.loadIndex
  5826. }
  5827. if (!e.lresult[e.llload + t.name]) {
  5828. if (!t["type"]) {
  5829. i = getExtension(t.path);
  5830. if (i == "txt") {
  5831. t["type"] = LURLLoader.TYPE_TEXT
  5832. } else if (i == "js") {
  5833. t["type"] = LURLLoader.TYPE_JS
  5834. } else if ((new Array("mp3", "ogg", "wav", "m4a")).indexOf(i) >= 0) {
  5835. t["type"] = LSound.TYPE_SOUND
  5836. }
  5837. }
  5838. if (t["type"] == LURLLoader.TYPE_TEXT || t["type"] == LURLLoader.TYPE_JS) {
  5839. e.loader = new LURLLoader;
  5840. e.loader.name = t.name;
  5841. e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
  5842. e.loader.load(e.url(t.path), t["type"])
  5843. } else if (t["type"] == LSound.TYPE_SOUND) {
  5844. e.loader = new LSound;
  5845. e.loader.name = t.name;
  5846. e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
  5847. e.loader.load(t.path)
  5848. } else {
  5849. e.loader = new LLoader;
  5850. e.loader.name = t.name;
  5851. e.loader.addEventListener(LEvent.COMPLETE, e.loadComplete.bind(e));
  5852. e.loader.load(e.url(t.path), LLoader.TYPE_BITMAPDATE)
  5853. }
  5854. }
  5855. e.loadIndex++;
  5856. e.loadStart()
  5857. },
  5858. loadComplete: function(e) {
  5859. var t = this;
  5860. if (e && e.currentTarget && e.currentTarget.name) {
  5861. e.currentTarget.removeEventListener(LEvent.COMPLETE, t.loadComplete);
  5862. if (e.currentTarget.name.indexOf(t.llname) >= 0) {
  5863. e.target = 1
  5864. }
  5865. if (t.lresult[t.llload + e.currentTarget.name]) {
  5866. return
  5867. }
  5868. t.result[e.currentTarget.name] = e.target;
  5869. t.lresult[t.llload + e.currentTarget.name] = 1
  5870. }
  5871. t.index++;
  5872. if (t.onupdate) {
  5873. t.onupdate(Math.floor(t.index * 100 / t.list.length))
  5874. }
  5875. if (t.index >= t.list.length) {
  5876. if (t.reloadtime) {
  5877. clearTimeout(t.reloadtime)
  5878. }
  5879. t.loader = null;
  5880. var n = t.result;
  5881. LGlobal.forceRefresh = true;
  5882. t.oncomplete(n)
  5883. }
  5884. },
  5885. url: function(e) {
  5886. if (!LGlobal.traceDebug) {
  5887. return e
  5888. }
  5889. return e + (e.indexOf("?") >= 0 ? "&" : "?") + "t=" + (new Date).getTime()
  5890. }
  5891. };
  5892. return new e
  5893. }();
  5894. var LEasing = {
  5895. None: {
  5896. easeIn: function(e, t, n, r) {
  5897. return t + e * n / r
  5898. },
  5899. easeOut: function(e, t, n, r) {
  5900. return t + e * n / r
  5901. },
  5902. easeInOut: function(e, t, n, r) {
  5903. return t + e * n / r
  5904. }
  5905. },
  5906. Quad: {
  5907. easeIn: function(e, t, n, r) {
  5908. return n * (e /= r) * e + t
  5909. },
  5910. easeOut: function(e, t, n, r) {
  5911. return -n * (e /= r) * (e - 2) + t
  5912. },
  5913. easeInOut: function(e, t, n, r) {
  5914. if ((e /= r / 2) < 1) {
  5915. return n / 2 * e * e + t
  5916. }
  5917. return -n / 2 * (--e * (e - 2) - 1) + t
  5918. }
  5919. },
  5920. Cubic: {
  5921. easeIn: function(e, t, n, r) {
  5922. return n * (e /= r) * e * e + t
  5923. },
  5924. easeOut: function(e, t, n, r) {
  5925. return n * ((e = e / r - 1) * e * e + 1) + t
  5926. },
  5927. easeInOut: function(e, t, n, r) {
  5928. if ((e /= r / 2) < 1) {
  5929. return n / 2 * e * e * e + t
  5930. }
  5931. return n / 2 * ((e -= 2) * e * e + 2) + t
  5932. }
  5933. },
  5934. Quart: {
  5935. easeIn: function(e, t, n, r) {
  5936. return n * (e /= r) * e * e * e + t
  5937. },
  5938. easeOut: function(e, t, n, r) {
  5939. return -n * ((e = e / r - 1) * e * e * e - 1) + t
  5940. },
  5941. easeInOut: function(e, t, n, r) {
  5942. if ((e /= r / 2) < 1) {
  5943. return n / 2 * e * e * e * e + t
  5944. }
  5945. return -n / 2 * ((e -= 2) * e * e * e - 2) + t
  5946. }
  5947. },
  5948. Quint: {
  5949. easeIn: function(e, t, n, r) {
  5950. return n * (e /= r) * e * e * e * e + t
  5951. },
  5952. easeOut: function(e, t, n, r) {
  5953. return n * ((e = e / r - 1) * e * e * e * e + 1) + t
  5954. },
  5955. easeInOut: function(e, t, n, r) {
  5956. if ((e /= r / 2) < 1) {
  5957. return n / 2 * e * e * e * e * e + t
  5958. }
  5959. return n / 2 * ((e -= 2) * e * e * e * e + 2) + t
  5960. }
  5961. },
  5962. Sine: {
  5963. easeIn: function(e, t, n, r) {
  5964. return -n * Math.cos(e / r * (Math.PI / 2)) + n + t
  5965. },
  5966. easeOut: function(e, t, n, r) {
  5967. return n * Math.sin(e / r * (Math.PI / 2)) + t
  5968. },
  5969. easeInOut: function(e, t, n, r) {
  5970. return -n / 2 * (Math.cos(Math.PI * e / r) - 1) + t
  5971. }
  5972. },
  5973. Strong: {
  5974. easeIn: function(e, t, n, r) {
  5975. return n * (e /= r) * e * e * e * e + t
  5976. },
  5977. easeOut: function(e, t, n, r) {
  5978. return n * ((e = e / r - 1) * e * e * e * e + 1) + t
  5979. },
  5980. easeInOut: function(e, t, n, r) {
  5981. if ((e /= r / 2) < 1) {
  5982. return n / 2 * e * e * e * e * e + t
  5983. }
  5984. return n / 2 * ((e -= 2) * e * e * e * e + 2) + t
  5985. }
  5986. },
  5987. Expo: {
  5988. easeIn: function(e, t, n, r) {
  5989. return e == 0 ? t : n * Math.pow(2, 10 * (e / r - 1)) + t
  5990. },
  5991. easeOut: function(e, t, n, r) {
  5992. return e == r ? t + n : n * (-Math.pow(2, -10 * e / r) + 1) + t
  5993. },
  5994. easeInOut: function(e, t, n, r) {
  5995. if (e == 0) {
  5996. return t
  5997. }
  5998. if (e == r) {
  5999. return t + n
  6000. }
  6001. if ((e /= r / 2) < 1) {
  6002. return n / 2 * Math.pow(2, 10 * (e - 1)) + t
  6003. }
  6004. return n / 2 * (-Math.pow(2, -10 * --e) + 2) + t
  6005. }
  6006. },
  6007. Circ: {
  6008. easeIn: function(e, t, n, r) {
  6009. return -n * (Math.sqrt(1 - (e /= r) * e) - 1) + t
  6010. },
  6011. easeOut: function(e, t, n, r) {
  6012. return n * Math.sqrt(1 - (e = e / r - 1) * e) + t
  6013. },
  6014. easeInOut: function(e, t, n, r) {
  6015. if ((e /= r / 2) < 1) {
  6016. return -n / 2 * (Math.sqrt(1 - e * e) - 1) + t
  6017. }
  6018. return n / 2 * (Math.sqrt(1 - (e -= 2) * e) + 1) + t
  6019. }
  6020. },
  6021. Elastic: {
  6022. easeIn: function(e, t, n, r, i, s) {
  6023. var o;
  6024. if (e == 0) {
  6025. return t
  6026. }
  6027. if ((e /= r) == 1) {
  6028. return t + n
  6029. }
  6030. if (!s) {
  6031. s = r * .3
  6032. }
  6033. if (!i || i < Math.abs(n)) {
  6034. i = n;
  6035. o = s / 4
  6036. } else {
  6037. o = s / (2 * Math.PI) * Math.asin(n / i)
  6038. }
  6039. return -(i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s)) + t
  6040. },
  6041. easeOut: function(e, t, n, r, i, s) {
  6042. var o;
  6043. if (e == 0) {
  6044. return t
  6045. }
  6046. if ((e /= r) == 1) {
  6047. return t + n
  6048. }
  6049. if (!s) {
  6050. s = r * .3
  6051. }
  6052. if (!i || i < Math.abs(n)) {
  6053. i = n;
  6054. o = s / 4
  6055. } else {
  6056. o = s / (2 * Math.PI) * Math.asin(n / i)
  6057. }
  6058. return i * Math.pow(2, -10 * e) * Math.sin((e * r - o) * 2 * Math.PI / s) + n + t
  6059. },
  6060. easeInOut: function(e, t, n, r, i, s) {
  6061. var o;
  6062. if (e == 0) {
  6063. return t
  6064. }
  6065. if ((e /= r / 2) == 2) {
  6066. return t + n
  6067. }
  6068. if (!s) {
  6069. s = r * .3 * 1.5
  6070. }
  6071. if (!i || i < Math.abs(n)) {
  6072. i = n;
  6073. o = s / 4
  6074. } else {
  6075. o = s / (2 * Math.PI) * Math.asin(n / i)
  6076. } if (e < 1) {
  6077. return -.5 * i * Math.pow(2, 10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s) + t
  6078. }
  6079. return i * Math.pow(2, -10 * (e -= 1)) * Math.sin((e * r - o) * 2 * Math.PI / s) * .5 + n + t
  6080. }
  6081. },
  6082. Back: {
  6083. easeIn: function(e, t, n, r, i) {
  6084. if (typeof i == UNDEFINED) {
  6085. i = 1.70158
  6086. }
  6087. return n * (e /= r) * e * ((i + 1) * e - i) + t
  6088. },
  6089. easeOut: function(e, t, n, r, i) {
  6090. if (typeof i == UNDEFINED) {
  6091. i = 1.70158
  6092. }
  6093. return n * ((e = e / r - 1) * e * ((i + 1) * e + i) + 1) + t
  6094. },
  6095. easeInOut: function(e, t, n, r, i) {
  6096. if (typeof i == UNDEFINED) {
  6097. i = 1.70158
  6098. }
  6099. if ((e /= r / 2) < 1) {
  6100. return n / 2 * e * e * (((i *= 1.525) + 1) * e - i) + t
  6101. }
  6102. return n / 2 * ((e -= 2) * e * (((i *= 1.525) + 1) * e + i) + 2) + t
  6103. }
  6104. },
  6105. Bounce: {
  6106. easeIn: function(e, t, n, r) {
  6107. return n - LEasing.Bounce.easeOut(r - e, 0, n, r) + t
  6108. },
  6109. easeOut: function(e, t, n, r) {
  6110. if ((e /= r) < 1 / 2.75) {
  6111. return n * 7.5625 * e * e + t
  6112. } else if (e < 2 / 2.75) {
  6113. return n * (7.5625 * (e -= 1.5 / 2.75) * e + .75) + t
  6114. } else if (e < 2.5 / 2.75) {
  6115. return n * (7.5625 * (e -= 2.25 / 2.75) * e + .9375) + t
  6116. } else {
  6117. return n * (7.5625 * (e -= 2.625 / 2.75) * e + .984375) + t
  6118. }
  6119. },
  6120. easeInOut: function(e, t, n, r) {
  6121. if (e < r / 2) {
  6122. return LEasing.Bounce.easeIn(e * 2, 0, n, r) * .5 + t
  6123. }
  6124. return LEasing.Bounce.easeOut(e * 2 - r, 0, n, r) * .5 + n * .5 + t
  6125. }
  6126. }
  6127. };
  6128. var Quad = LEasing.Quad,
  6129. Cubic = LEasing.Cubic,
  6130. Quart = LEasing.Quart,
  6131. Quint = LEasing.Quint,
  6132. Sine = LEasing.Sine,
  6133. Strong = LEasing.Strong,
  6134. Expo = LEasing.Expo,
  6135. Circ = LEasing.Circ,
  6136. Elastic = LEasing.Elastic,
  6137. Back = LEasing.Back,
  6138. Bounce = LEasing.Bounce;
  6139. var LTweenLiteTimeline;
  6140. var LTweenLite = function() {
  6141. function e(e, t, n) {
  6142. var r = this;
  6143. LExtends(r, LObject, []);
  6144. r.type = "LTweenLiteChild";
  6145. r.toNew = [];
  6146. r.init(e, t, n)
  6147. }
  6148. function r() {
  6149. LExtends(this, LObject, []);
  6150. this.type = "LTweenLite"
  6151. }
  6152. var t = {
  6153. init: function(e, t, n) {
  6154. var i = this,
  6155. s = null;
  6156. if (typeof n["tweenTimeline"] == UNDEFINED) {
  6157. n["tweenTimeline"] = r.TYPE_FRAME
  6158. }
  6159. i.target = e;
  6160. i.duration = t || .001;
  6161. i.vars = n;
  6162. i.delay = i.vars.delay || 0;
  6163. if (i.vars["tweenTimeline"] == r.TYPE_TIMER) {
  6164. i.currentTime = (new Date).getTime() / 1e3;
  6165. i.initTime = i.currentTime;
  6166. i.startTime = i.initTime + i.delay
  6167. } else {
  6168. i.currentTime = 0;
  6169. i.duration *= 1e3;
  6170. i.currentTime -= i.delay * 1e3
  6171. }
  6172. i.combinedTimeScale = i.vars.timeScale || 1;
  6173. i.active = i.duration == 0 && i.delay == 0;
  6174. i.varsto = {};
  6175. i.varsfrom = {};
  6176. i.stop = false;
  6177. if (typeof i.vars.ease != "function") {
  6178. i.vars.ease = LEasing.None.easeIn
  6179. }
  6180. i.ease = i.vars.ease;
  6181. delete i.vars.ease;
  6182. if (i.vars.onComplete) {
  6183. i.onComplete = i.vars.onComplete;
  6184. delete i.vars.onComplete
  6185. }
  6186. if (i.vars.onUpdate) {
  6187. i.onUpdate = i.vars.onUpdate;
  6188. delete i.vars.onUpdate
  6189. }
  6190. if (i.vars.onStart) {
  6191. i.onStart = i.vars.onStart;
  6192. delete i.vars.onStart
  6193. }
  6194. for (s in i.vars) {
  6195. i.varsto[s] = i.vars[s];
  6196. i.varsfrom[s] = i.target[s]
  6197. }
  6198. },
  6199. pause: function() {
  6200. this.stop = true
  6201. },
  6202. resume: function() {
  6203. this.stop = false
  6204. },
  6205. tween: function() {
  6206. var e = this,
  6207. t;
  6208. var n = e.vars["tweenTimeline"] == r.TYPE_TIMER;
  6209. if (n) {
  6210. var i = (new Date).getTime() / 1e3,
  6211. s = i - e.startTime;
  6212. if (s < 0) {
  6213. return
  6214. }
  6215. } else {
  6216. if (e.stop) {
  6217. return
  6218. }
  6219. e.currentTime += LGlobal.speed;
  6220. if (e.currentTime < 0) {
  6221. return
  6222. }
  6223. }
  6224. for (t in e.varsto) {
  6225. if (t == "tweenTimeline") {
  6226. continue
  6227. }
  6228. if (n) {
  6229. e.target[t] = e.ease(s, e.varsfrom[t], e.varsto[t] - e.varsfrom[t], e.duration)
  6230. } else {
  6231. e.target[t] = e.ease(e.currentTime, e.varsfrom[t], e.varsto[t] - e.varsfrom[t], e.duration)
  6232. }
  6233. }
  6234. if (e.onStart) {
  6235. e.onStart(e.target);
  6236. delete e.onStart
  6237. }
  6238. var o;
  6239. if (n) {
  6240. o = s >= e.duration
  6241. } else {
  6242. o = e.currentTime >= e.duration
  6243. } if (o) {
  6244. for (t in e.varsto) {
  6245. e.target[t] = e.varsto[t]
  6246. }
  6247. if (e.onComplete) {
  6248. e.target.target = e.target;
  6249. e.target.currentTarget = e;
  6250. e.onComplete(e.target);
  6251. delete e.target.currentTarget;
  6252. delete e.target.target
  6253. }
  6254. return true
  6255. } else if (e.onUpdate) {
  6256. e.onUpdate(e.target)
  6257. }
  6258. return false
  6259. },
  6260. to: function(e, t, n) {
  6261. var r = this;
  6262. r.toNew.push({
  6263. target: e,
  6264. duration: t,
  6265. vars: n
  6266. });
  6267. return r
  6268. },
  6269. keep: function() {
  6270. var e = this,
  6271. t, n, r;
  6272. if (e.toNew.length > 0) {
  6273. t = e.toNew.shift();
  6274. if (t.vars.loop) {
  6275. e.loop = true
  6276. }
  6277. if (e.loop) {
  6278. n = {};
  6279. for (r in t.vars) {
  6280. n[r] = t.vars[r]
  6281. }
  6282. e.to(t.target, t.duration, n)
  6283. }
  6284. e.init(t.target, t.duration, t.vars);
  6285. return true
  6286. }
  6287. return false
  6288. }
  6289. };
  6290. for (var n in t) {
  6291. e.prototype[n] = t[n]
  6292. }
  6293. r.TYPE_FRAME = "type_frame";
  6294. r.TYPE_TIMER = "type_timer";
  6295. t = {
  6296. tweens: [],
  6297. ll_show: null,
  6298. frame: function() {
  6299. var e = this;
  6300. var t, n = e.tweens.length,
  6301. r;
  6302. for (t = 0; t < n; t++) {
  6303. r = e.tweens[t];
  6304. if (r && r.tween && r.tween()) {
  6305. e.tweens.splice(t, 1);
  6306. t--;
  6307. n = e.tweens.length;
  6308. if (r.keep()) {
  6309. e.add(r)
  6310. }
  6311. }
  6312. }
  6313. if (e.tweens.length == 0) {
  6314. e.ll_show = null
  6315. }
  6316. },
  6317. to: function(t, n, r) {
  6318. if (!t) {
  6319. return
  6320. }
  6321. var i = this;
  6322. var s = new e({}, 0, {});
  6323. i.tweens.push(s);
  6324. i.ll_show = i.frame;
  6325. s.to(t, n, r);
  6326. return s
  6327. },
  6328. add: function(e) {
  6329. this.tweens.push(e)
  6330. },
  6331. remove: function(e) {
  6332. var t = this;
  6333. if (typeof e == UNDEFINED) {
  6334. return
  6335. }
  6336. for (i = 0, l = t.tweens.length; i < l; i++) {
  6337. if (e.objectIndex == t.tweens[i].objectIndex) {
  6338. t.tweens.splice(i, 1);
  6339. break
  6340. }
  6341. }
  6342. },
  6343. removeAll: function() {
  6344. this.tweens.splice(0, this.tweens.length)
  6345. }
  6346. };
  6347. for (var n in t) {
  6348. r.prototype[n] = t[n]
  6349. }
  6350. LTweenLiteTimeline = new r;
  6351. LGlobal.childList.push(LTweenLiteTimeline);
  6352. var s = new r;
  6353. s.TYPE_FRAME = r.TYPE_FRAME;
  6354. s.TYPE_TIMER = r.TYPE_TIMER;
  6355. LGlobal.childList.push(s);
  6356. return s
  6357. }();
  6358. var LAjax = function() {
  6359. function e() {
  6360. this.responseType = null
  6361. }
  6362. e.prototype = {
  6363. TEXT: "text",
  6364. ARRAY_BUFFER: "arraybuffer",
  6365. BLOB: "blob",
  6366. get: function(e, t, n, r) {
  6367. this.getRequest("GET", e, t, n, r)
  6368. },
  6369. post: function(e, t, n, r) {
  6370. this.getRequest("POST", e, t, n, r)
  6371. },
  6372. getRequest: function(e, t, n, r, i) {
  6373. var s = this,
  6374. o, u = "",
  6375. a = "";
  6376. s.err = i;
  6377. var f = s.getHttp();
  6378. if (!f) {
  6379. return
  6380. }
  6381. if (n) {
  6382. for (o in n) {
  6383. u += a + o + "=" + n[o];
  6384. a = "&"
  6385. }
  6386. }
  6387. if (e.toLowerCase() == "get" && u.length > 0) {
  6388. t += (t.indexOf("?") >= 0 ? "&" : "?") + u;
  6389. u = null
  6390. }
  6391. f.open(e, t, true);
  6392. if (s.responseType) {
  6393. f.responseType = s.responseType;
  6394. s.responseType = s.TEXT
  6395. }
  6396. f.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
  6397. f.onreadystatechange = function() {
  6398. if (f.readyState == 4) {
  6399. if (f.status >= 200 && f.status < 300 || f.status === 304) {
  6400. if (r) {
  6401. if (f.responseType == s.ARRAY_BUFFER || f.responseType == s.BLOB) {
  6402. r(f.response)
  6403. } else if (f.responseText.length > 0) {
  6404. r(f.responseText)
  6405. } else {
  6406. r(null)
  6407. }
  6408. }
  6409. } else {
  6410. if (i) {
  6411. i(f)
  6412. }
  6413. }
  6414. }
  6415. };
  6416. f.send(u)
  6417. },
  6418. getHttp: function() {
  6419. if (typeof XMLHttpRequest != UNDEFINED) {
  6420. return new XMLHttpRequest
  6421. }
  6422. try {
  6423. return new ActiveXObject("Msxml2.XMLHTTP")
  6424. } catch (e) {
  6425. try {
  6426. return new ActiveXObject("Microsoft.XMLHTTP")
  6427. } catch (e) {
  6428. if (!this.err) {
  6429. this.err(e)
  6430. }
  6431. }
  6432. }
  6433. return false
  6434. }
  6435. };
  6436. return new e
  6437. }();
  6438. var LStageWebView = function() {
  6439. function e() {
  6440. var e = this;
  6441. LExtends(e, LEventDispatcher, []);
  6442. e.display = document.createElement("div");
  6443. e.iframe = document.createElement("iframe");
  6444. e.display.style.position = "absolute";
  6445. e.display.style.marginTop = "0px";
  6446. e.display.style.marginLeft = "0px";
  6447. e.display.style.zIndex = 11;
  6448. e.display.appendChild(e.iframe);
  6449. e.idAdded = false
  6450. }
  6451. var t = {
  6452. loadURL: function(e) {
  6453. var t = this;
  6454. t.iframe.src = e;
  6455. t.iframe.onload = function() {
  6456. t.dispatchEvent(LEvent.COMPLETE)
  6457. }
  6458. },
  6459. show: function() {
  6460. var e = this;
  6461. if (!e.idAdded) {
  6462. LGlobal.object.appendChild(e.display);
  6463. e.idAdded = true
  6464. }
  6465. if (e.display.style.display == "none") {
  6466. e.display.style.display = ""
  6467. }
  6468. },
  6469. die: function() {
  6470. LGlobal.object.removeChild(this.display);
  6471. this.idAdded = false
  6472. },
  6473. hide: function() {
  6474. this.display.style.display = "none"
  6475. },
  6476. setViewPort: function(e) {
  6477. var t = this,
  6478. n = parseInt(LGlobal.canvasObj.style.width) / LGlobal.canvasObj.width,
  6479. r = parseInt(LGlobal.canvasObj.style.height) / LGlobal.canvasObj.height;
  6480. t.display.style.marginTop = parseInt(LGlobal.canvasObj.style.marginTop) + (e.y * r >>> 0) + "px";
  6481. t.display.style.marginLeft = parseInt(LGlobal.canvasObj.style.marginLeft) + (e.x * n >>> 0) + "px";
  6482. t.iframe.style.width = t.display.style.width = (e.width * n >>> 0) + "px";
  6483. t.iframe.style.height = t.display.style.height = (e.height * r >>> 0) + "px"
  6484. }
  6485. };
  6486. for (var n in t) {
  6487. e.prototype[n] = t[n]
  6488. }
  6489. return e
  6490. }();
  6491. var FPS = function() {
  6492. function e() {
  6493. var e = this;
  6494. LExtends(e, LSprite, []);
  6495. e.fps = new LTextField;
  6496. e.fpsCount = 0;
  6497. e.fpsTime = (new Date).getTime();
  6498. e.fps.color = "#ffffff";
  6499. e.addChild(e.fps);
  6500. e.addEventListener(LEvent.ENTER_FRAME, e.showFPS)
  6501. }
  6502. e.prototype.showFPS = function(e) {
  6503. e.fpsCount++;
  6504. var t = (new Date).getTime();
  6505. if (t - e.fpsTime < 1e3) return;
  6506. e.fps.text = Math.round(e.fpsCount * 1e4 / (t - e.fpsTime)) / 10;
  6507. e.fpsTime = t;
  6508. e.fpsCount = 0;
  6509. e.graphics.clear();
  6510. e.graphics.drawRect(0, "#000000", [0, 0, e.fps.getWidth(), 20], true, "#000000")
  6511. };
  6512. return e
  6513. }();
  6514. var LQuadTree = function() {
  6515. function e(e) {
  6516. var t = this;
  6517. LExtends(t, LObject, []);
  6518. t.q1 = null;
  6519. t.q2 = null;
  6520. t.q3 = null;
  6521. t.q4 = null;
  6522. t.parent = null;
  6523. t.data = [];
  6524. t.rect = e;
  6525. t.root = t
  6526. }
  6527. e.prototype = {
  6528. createChildren: function(t) {
  6529. if (t == 0) {
  6530. return
  6531. }
  6532. var n = this;
  6533. var r = n.rect.width / 2,
  6534. i = n.rect.height / 2;
  6535. n.q1 = new e(new LRectangle(n.rect.x + r, n.rect.y, r, i));
  6536. n.q2 = new e(new LRectangle(n.rect.x + r, n.rect.y + i, r, i));
  6537. n.q3 = new e(new LRectangle(n.rect.x, n.rect.y + i, r, i));
  6538. n.q4 = new e(new LRectangle(n.rect.x, n.rect.y, r, i));
  6539. n.q1.parent = n.q2.parent = n.q3.parent = n.q4.parent = n;
  6540. n.q1.root = n.q2.root = n.q3.root = n.q4.root = n.root;
  6541. n.q1.createChildren(t - 1);
  6542. n.q2.createChildren(t - 1);
  6543. n.q3.createChildren(t - 1);
  6544. n.q4.createChildren(t - 1)
  6545. },
  6546. hasChildren: function() {
  6547. var e = this;
  6548. return e.q1 && e.q2 && e.q3 && e.q4
  6549. },
  6550. clear: function() {
  6551. var e = this;
  6552. if (e.hasChildren()) {
  6553. return e.q1.clear() || e.q2.clear() || e.q3.clear() || e.q4.clear()
  6554. } else {
  6555. e.q1 = null;
  6556. e.q2 = null;
  6557. e.q3 = null;
  6558. e.q4 = null;
  6559. e.parent = null;
  6560. e.data = [];
  6561. return e
  6562. }
  6563. },
  6564. add: function(e, t, n) {
  6565. var r = this;
  6566. if (!r.isIn(t, n)) {
  6567. return null
  6568. }
  6569. if (r.hasChildren()) {
  6570. return r.q1.add(e, t, n) || r.q2.add(e, t, n) || r.q3.add(e, t, n) || r.q4.add(e, t, n)
  6571. } else {
  6572. r.data.push(e);
  6573. return r
  6574. }
  6575. },
  6576. remove: function(e, t, n) {
  6577. var r = this;
  6578. if (!r.isIn(t, n)) {
  6579. return null
  6580. }
  6581. if (r.hasChildren()) {
  6582. return r.q1.remove(e, t, n) || r.q2.remove(e, t, n) || r.q3.remove(e, t, n) || r.q4.remove(e, t, n)
  6583. } else {
  6584. var i = r.data.indexOf(e);
  6585. if (i != -1) {
  6586. r.data.splice(i, 1);
  6587. return r
  6588. } else {
  6589. return null
  6590. }
  6591. }
  6592. },
  6593. isIn: function(e, t) {
  6594. var n = this;
  6595. return (typeof e == UNDEFINED || e >= n.rect.x && e < n.rect.right) && (typeof t == UNDEFINED || t >= n.rect.y && t < n.rect.bottom)
  6596. },
  6597. getDataInRect: function(e) {
  6598. var t = this;
  6599. if (!t.rect.intersects(e)) {
  6600. return []
  6601. }
  6602. var n = t.data.concat();
  6603. if (t.hasChildren()) {
  6604. n.push.apply(n, t.q1.getDataInRect(e));
  6605. n.push.apply(n, t.q2.getDataInRect(e));
  6606. n.push.apply(n, t.q3.getDataInRect(e));
  6607. n.push.apply(n, t.q4.getDataInRect(e))
  6608. }
  6609. return n
  6610. }
  6611. };
  6612. return e
  6613. }();
  6614. var LoadingSample1 = function() {
  6615. function e(e, t, n) {
  6616. base(this, LSprite, []);
  6617. var r = this;
  6618. r.numberList = new Array([1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1], [0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0], [1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1], [1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1], [1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 0, 0, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1], [1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1], [1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1]);
  6619. r.backgroundColor = t == null ? "#000000" : t;
  6620. r.color = n == null ? "#ffffff" : n;
  6621. r.progress = 0;
  6622. r.step = e == null ? LGlobal.width * .5 / 15 : e;
  6623. r.back = new LSprite;
  6624. r.addChild(r.back);
  6625. r.num = new LSprite;
  6626. r.addChild(r.num);
  6627. r.num.mask = new LSprite;
  6628. r.screenX = (LGlobal.width - r.step * 15) / 2;
  6629. r.screenY = (LGlobal.height - r.step * 5) / 2;
  6630. r.num.x = r.screenX;
  6631. r.num.y = r.screenY;
  6632. r.setProgress(r.progress)
  6633. }
  6634. e.prototype.setProgress = function(e) {
  6635. var t = this,
  6636. n = LGlobal.canvas;
  6637. var r = "",
  6638. i, s, o;
  6639. var u = t.step;
  6640. if (e >= 100) {
  6641. r = t.getNumber(1);
  6642. i = t.getNumber(0);
  6643. s = t.getNumber(0);
  6644. u = t.step * 3
  6645. } else if (e >= 10) {
  6646. i = t.getNumber(Math.floor(e / 10));
  6647. s = t.getNumber(e % 10)
  6648. } else {
  6649. i = t.getNumber(0);
  6650. s = t.getNumber(e)
  6651. }
  6652. t.back.graphics.clear();
  6653. t.back.graphics.add(function() {
  6654. n.beginPath();
  6655. n.fillStyle = t.backgroundColor;
  6656. n.fillRect(0, 0, LGlobal.width, LGlobal.height);
  6657. n.closePath();
  6658. n.fillStyle = t.color;
  6659. if (e >= 100) {
  6660. for (o = 0; o < r.length; o++) {
  6661. if (r[o] == 0) {
  6662. continue
  6663. }
  6664. n.fillRect(t.screenX + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6665. }
  6666. }
  6667. for (o = 0; o < i.length; o++) {
  6668. if (i[o] == 0) {
  6669. continue
  6670. }
  6671. n.fillRect(t.screenX + u + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6672. }
  6673. for (o = 0; o < s.length; o++) {
  6674. if (s[o] == 0) {
  6675. continue
  6676. }
  6677. n.fillRect(t.screenX + u + Math.floor(o % 3) * t.step + t.step * 4, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6678. }
  6679. n.moveTo(t.screenX + u + t.step * 9.7, t.screenY);
  6680. n.lineTo(t.screenX + u + t.step * 10.5, t.screenY);
  6681. n.lineTo(t.screenX + u + t.step * 9.3, t.screenY + t.step * 5);
  6682. n.lineTo(t.screenX + u + t.step * 8.5, t.screenY + t.step * 5);
  6683. n.lineTo(t.screenX + u + t.step * 9.7, t.screenY);
  6684. n.fill();
  6685. n.moveTo(t.screenX + u + t.step * 8.5, t.screenY + t.step);
  6686. n.arc(t.screenX + u + t.step * 8.5, t.screenY + t.step, t.step * .6, 0, 360 + Math.PI / 180);
  6687. n.moveTo(t.screenX + u + t.step * 10.5, t.screenY + t.step * 4);
  6688. n.arc(t.screenX + u + t.step * 10.5, t.screenY + t.step * 4, t.step * .6, 0, 360 + Math.PI / 180);
  6689. n.fill()
  6690. });
  6691. t.num.mask.graphics.clear();
  6692. t.num.mask.graphics.add(function() {
  6693. if (e >= 100) {
  6694. for (o = 0; o < r.length; o++) {
  6695. if (r[o] == 0) {
  6696. continue
  6697. }
  6698. n.rect(t.screenX + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6699. }
  6700. }
  6701. for (var o = 0; o < i.length; o++) {
  6702. if (i[o] == 0) {
  6703. continue
  6704. }
  6705. n.rect(t.screenX + u + Math.floor(o % 3) * t.step, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6706. }
  6707. for (var o = 0; o < s.length; o++) {
  6708. if (s[o] == 0) {
  6709. continue
  6710. }
  6711. n.rect(t.screenX + u + Math.floor(o % 3) * t.step + t.step * 4, t.screenY + Math.floor(o / 3) * t.step, t.step, t.step)
  6712. }
  6713. });
  6714. n.fillStyle = LGlobal._create_loading_color();
  6715. t.num.graphics.clear();
  6716. t.num.graphics.drawRect(1, n.fillStyle, [0, t.step * 5 * (100 - e) * .01, LGlobal.width, LGlobal.height], true, n.fillStyle)
  6717. };
  6718. e.prototype.getNumber = function(e) {
  6719. return this.numberList[e]
  6720. };
  6721. return e
  6722. }();
  6723. LoadingSample2.prototype.setProgress = function(e) {
  6724. var t = this,
  6725. n = LGlobal.canvas;
  6726. t.progressLabel.text = e + "%";
  6727. t.showLabel.mask.clear();
  6728. t.showLabel.mask.drawRect(0, "#000000", [t.screenX, 0, t.screenWidth * e * .01, LGlobal.height]);
  6729. if (e >= 100) {
  6730. n.shadowOffsetX = 0;
  6731. n.shadowOffsetY = 0
  6732. }
  6733. };
  6734. LoadingSample3.prototype.onframe = function(e) {
  6735. var t, n, r;
  6736. if (e.progress >= 100) {
  6737. if (e.star.length > 0) {
  6738. for (t = 0, r = e.star.length; t < r; t++) {
  6739. e.removeChild(e.star[t])
  6740. }
  6741. e.star.length = 0
  6742. }
  6743. return
  6744. }
  6745. for (t = 0, r = e.star.length; t < r; t++) {
  6746. n = e.star[t];
  6747. n.alpha -= .1;
  6748. n.x += n.speedx;
  6749. n.y += n.speedy;
  6750. if (n.alpha <= 0) {
  6751. e.star.splice(t, 1);
  6752. e.removeChild(n);
  6753. t--, r--
  6754. }
  6755. }
  6756. if (e.star.length < 10) e.addStar()
  6757. };
  6758. LoadingSample3.prototype.addStar = function() {
  6759. var e = this,
  6760. t = LGlobal.canvas;
  6761. var n = new LSprite;
  6762. var r = 1 + Math.floor(Math.random() * 4);
  6763. n.graphics.add(function() {
  6764. t.beginPath();
  6765. t.fillStyle = "#ffffff";
  6766. t.lineTo(r * 2, r);
  6767. t.lineTo(r * 4, 0);
  6768. t.lineTo(r * 3, r * 2);
  6769. t.lineTo(r * 4, r * 4);
  6770. t.lineTo(r * 2, r * 3);
  6771. t.lineTo(0, r * 4);
  6772. t.lineTo(r, r * 2);
  6773. t.lineTo(0, 0);
  6774. t.fill()
  6775. });
  6776. n.x = e.screenX + e.screenWidth * e.progress * .01;
  6777. n.y = e.screenY;
  6778. n.speedx = 4 - 8 * Math.random();
  6779. n.speedy = 4 - 8 * Math.random();
  6780. e.star.push(n);
  6781. e.addChild(n)
  6782. };
  6783. LoadingSample3.prototype.setProgress = function(e) {
  6784. var t = this,
  6785. n = LGlobal.canvas;
  6786. if (e > 100) e = 100;
  6787. t.progress = e;
  6788. t.back.graphics.clear();
  6789. t.back.graphics.add(function() {
  6790. n.beginPath();
  6791. n.fillStyle = "#00FFFF";
  6792. n.rect(t.screenX - 3, t.screenY - 3, t.screenWidth + 6, t.screenHeight + 6);
  6793. n.fill();
  6794. n.beginPath();
  6795. n.fillStyle = "#990033";
  6796. n.rect(t.screenX, t.screenY, t.screenWidth, t.screenHeight);
  6797. n.fill();
  6798. n.beginPath();
  6799. n.fillStyle = t.color;
  6800. n.rect(t.screenX, t.screenY, t.screenWidth * e * .01, t.screenHeight);
  6801. n.fill()
  6802. });
  6803. t.label.text = e + "%"
  6804. };
  6805. LoadingSample4.prototype.onframe = function(e) {
  6806. e.target.arc.rotate += 20
  6807. };
  6808. LoadingSample4.prototype.setProgress = function(e) {
  6809. var t = this;
  6810. if (e > 100) e = 100;
  6811. t.progress = e;
  6812. t.label.text = e + "%";
  6813. t.label.x = LGlobal.width * .5 - t.label.getWidth() * .5
  6814. };
  6815. LoadingSample5.prototype.onframe = function(e) {
  6816. var t = e.target;
  6817. if (t.index++ < t.max) return;
  6818. t.index = 0;
  6819. t.arc.rotate += 30
  6820. };
  6821. LoadingSample5.prototype.setProgress = function(e) {
  6822. var t = this;
  6823. if (e > 100) e = 100;
  6824. t.progress = e;
  6825. t.label.text = e + "%";
  6826. t.label.x = LGlobal.width * .5 - t.label.getWidth() * .5
  6827. };
  6828. LoadingSample6.prototype._addHole = function() {
  6829. var e = this;
  6830. var t = e.holeAmount,
  6831. n = e.holeR * 2 + e.holesx,
  6832. r = e.holeR;
  6833. for (var i = 0; i < t; i++) {
  6834. var s = new LSprite;
  6835. s.x = i * n;
  6836. s.graphics.drawArc(1, "#111", [0, 0, r, 0, 2 * Math.PI], true, "#000");
  6837. s.graphics.drawArc(1, "#333", [0, 0, r, 1.7 * Math.PI, .7 * Math.PI], false);
  6838. e.holeLayer.addChild(s)
  6839. }
  6840. };
  6841. LoadingSample6.prototype.setProgress = function(e) {
  6842. var t = this;
  6843. var n = t.holeR * 2 + t.holesx,
  6844. r = t.holeR;
  6845. t.progress = e / 100;
  6846. var i = new Array;
  6847. while (Math.floor(t.progress / .2) > t.step) {
  6848. var s = r * 2;
  6849. var o = s;
  6850. var u = LGlobal.canvas.createLinearGradient(0, -o * 2, 0, o);
  6851. u.addColorStop(0, "white");
  6852. u.addColorStop(1, t.progressColor);
  6853. var a = new LSprite;
  6854. a.x = t.step * n;
  6855. a.scaleX = 0;
  6856. a.scaleY = 0;
  6857. a.graphics.drawArc(0, "", [0, 0, r, 0, 2 * Math.PI], true, u);
  6858. t.progressLayer.addChild(a);
  6859. i.push(a);
  6860. t.step++
  6861. }
  6862. var f = function(e) {
  6863. var n = new LSprite;
  6864. n.alpha = .9;
  6865. n.x = e.x;
  6866. n.graphics.drawArc(1, t.filterColor, [0, 0, r, 0, 2 * Math.PI], false);
  6867. t.progressLayer.addChild(n);
  6868. var i = new LDropShadowFilter(0, 5, t.filterColor, 10);
  6869. n.filters = [i];
  6870. LTweenLite.to(n, .5, {
  6871. scaleX: 1.7,
  6872. scaleY: 1.7,
  6873. alpha: 0,
  6874. onComplete: function(e) {
  6875. e.parent.removeChild(e)
  6876. }
  6877. })
  6878. };
  6879. for (var l = 0; l < i.length; l++) {
  6880. var c = i[l];
  6881. LTweenLite.to(c, 1, {
  6882. scaleX: 1,
  6883. scaleY: 1,
  6884. onComplete: f
  6885. })
  6886. }
  6887. };
  6888. LoadingSample7.prototype._addHole = function() {
  6889. var e = this;
  6890. var t = e.holeAmount,
  6891. n = e.holeW + e.holesx,
  6892. r = e.holeW,
  6893. i = e.holeH;
  6894. for (var s = 0; s < t; s++) {
  6895. var o = new LSprite;
  6896. o.x = s * n;
  6897. o.graphics.drawRect(1, "#333", [1, 1, e.holeW, e.holeH], false);
  6898. o.graphics.drawRect(1, "#111", [0, 0, e.holeW, e.holeH], true, "#000");
  6899. e.holeLayer.addChild(o);
  6900. var u = LGlobal.canvas.createLinearGradient(0, -i, 0, i);
  6901. u.addColorStop(0, "white");
  6902. u.addColorStop(1, e.progressColor);
  6903. var a = new LSprite;
  6904. a.alpha = 0;
  6905. a.x = s * n;
  6906. a.graphics.drawRect(0, "", [0, 0, e.holeW, e.holeH], true, u);
  6907. e.progressLayer.addChild(a)
  6908. }
  6909. };
  6910. LoadingSample7.prototype.setProgress = function(e) {
  6911. var t = this;
  6912. t.progress = e / 100;
  6913. if (Math.floor(t.progress / .1) > t.step) {
  6914. var n = Math.ceil(t.progress / .1);
  6915. if (n > 10) n = 10;
  6916. for (var r = 0; r < n; r++) {
  6917. var i = t.progressLayer.childList;
  6918. if (i[r].alpha > 0) continue;
  6919. var s = t.progressLayer.childList[r];
  6920. LTweenLite.to(s, 1, {
  6921. alpha: 1
  6922. })
  6923. }
  6924. t.step++
  6925. }
  6926. };
  6927. var LBox2d = function() {
  6928. function e(t, n, r) {
  6929. var i = this;
  6930. Box2D.Dynamics.b2World.prototype.LAddController = Box2D.Dynamics.b2World.prototype.AddController;
  6931. Box2D.Dynamics.b2World.prototype.AddController = function(t) {
  6932. var n = {},
  6933. r;
  6934. for (r in t) {
  6935. n[r] = t[r]
  6936. }
  6937. if (e) {
  6938. e.m_controllerList = n
  6939. }
  6940. return this.LAddController(t)
  6941. };
  6942. var s, o, u = Box2D,
  6943. a, f = [u.Collision, u.Common, u.Common.Math, u.Dynamics, u.Dynamics.Contacts, u.Dynamics.Controllers, u.Dynamics.Joints, u.Collision.Shapes];
  6944. for (s in f) {
  6945. for (o in f[s]) {
  6946. i[o] = f[s][o]
  6947. }
  6948. }
  6949. if (typeof r == UNDEFINED) {
  6950. r = 30
  6951. }
  6952. i.stop = false;
  6953. i.drawScale = 30;
  6954. i.selectedBody = null;
  6955. i.mouseJoint = null;
  6956. i.mousePVec = null;
  6957. i.contactListener = null;
  6958. if (typeof t == UNDEFINED) {
  6959. t = new i.b2Vec2(0, 9.8)
  6960. } else {
  6961. t = new i.b2Vec2(t[0], t[1])
  6962. } if (typeof n == UNDEFINED) {
  6963. n = true
  6964. }
  6965. i.world = new i.b2World(t, n);
  6966. i.removeList = new Array;
  6967. if (LGlobal.traceDebug) {
  6968. a = new i.b2DebugDraw;
  6969. a.SetSprite(LGlobal.canvas);
  6970. a.SetLineThickness(1);
  6971. a.SetFillAlpha(.5);
  6972. a.SetAlpha(1);
  6973. a.SetDrawScale(i.drawScale);
  6974. a.SetFlags(i.b2DebugDraw.e_shapeBit | i.b2DebugDraw.e_jointBit);
  6975. i.world.SetDebugDraw(a)
  6976. }
  6977. LGlobal.destroy = true
  6978. }
  6979. e.prototype = {
  6980. setEvent: function(e, t) {
  6981. var n = this;
  6982. if (e == LEvent.ENTER_FRAME) {
  6983. n.ll_enterFrame = t;
  6984. return
  6985. }
  6986. if (!n.contactListener) {
  6987. n.contactListener = new n.b2ContactListener;
  6988. n.world.SetContactListener(n.contactListener)
  6989. }
  6990. switch (e) {
  6991. case LEvent.END_CONTACT:
  6992. n.contactListener.EndContact = t;
  6993. break;
  6994. case LEvent.PRE_SOLVE:
  6995. n.contactListener.PreSolve = t;
  6996. break;
  6997. case LEvent.POST_SOLVE:
  6998. n.contactListener.PostSolve = t;
  6999. break;
  7000. case LEvent.BEGIN_CONTACT:
  7001. default:
  7002. n.contactListener.BeginContact = t
  7003. }
  7004. },
  7005. setWeldJoint: function(e, t) {
  7006. var n = this;
  7007. var r = new n.b2WeldJointDef;
  7008. r.Initialize(t, e, t.GetWorldCenter());
  7009. return n.world.CreateJoint(r)
  7010. },
  7011. setLineJoint: function(e, t, n, r, i) {
  7012. var s = this;
  7013. var o = new s.b2Vec2(n[0], n[1]);
  7014. var u = new s.b2LineJointDef;
  7015. u.Initialize(e, t, t.GetWorldCenter(), o);
  7016. if (r == null) {
  7017. u.enableLimit = false
  7018. } else {
  7019. u.lowerTranslation = r[0];
  7020. u.upperTranslation = r[1];
  7021. u.enableLimit = true
  7022. } if (i == null) {
  7023. u.enableMotor = false
  7024. } else {
  7025. u.maxMotorForce = i[0];
  7026. u.motorSpeed = i[1];
  7027. u.enableMotor = true
  7028. }
  7029. return s.world.CreateJoint(u)
  7030. },
  7031. setGearJoint: function(e, t, n, r, i) {
  7032. var s = this;
  7033. var o = new s.b2GearJointDef;
  7034. o.joint1 = r;
  7035. o.joint2 = i;
  7036. o.bodyA = e;
  7037. o.bodyB = t;
  7038. o.ratio = n * s.b2Settings.b2_pi / (300 / s.drawScale);
  7039. return s.world.CreateJoint(o)
  7040. },
  7041. setPrismaticJoint: function(e, t, n, r, i) {
  7042. var s = this;
  7043. var o = new s.b2Vec2(n[0], n[1]);
  7044. var u = new s.b2PrismaticJointDef;
  7045. u.Initialize(t, e, t.GetWorldCenter(), o);
  7046. if (r == null) {
  7047. u.enableLimit = false
  7048. } else {
  7049. u.lowerTranslation = r[0];
  7050. u.upperTranslation = r[1];
  7051. u.enableLimit = true
  7052. } if (i == null) {
  7053. u.enableMotor = false
  7054. } else {
  7055. u.maxMotorForce = i[0];
  7056. u.motorSpeed = i[1];
  7057. u.enableMotor = true
  7058. }
  7059. return s.world.CreateJoint(u)
  7060. },
  7061. setRevoluteJoint: function(e, t, n, r) {
  7062. var i = this;
  7063. var s = new i.b2RevoluteJointDef;
  7064. s.Initialize(e, t, t.GetWorldCenter());
  7065. if (n == null) {
  7066. s.enableLimit = false
  7067. } else {
  7068. s.lowerAngle = n[0] * i.b2Settings.b2_pi / 180;
  7069. s.upperAngle = n[1] * i.b2Settings.b2_pi / 180;
  7070. s.enableLimit = true
  7071. } if (r == null) {
  7072. s.enableMotor = false
  7073. } else {
  7074. s.maxMotorTorque = r[0];
  7075. s.motorSpeed = r[1];
  7076. s.enableMotor = true
  7077. }
  7078. return i.world.CreateJoint(s)
  7079. },
  7080. setDistanceJoint: function(e, t) {
  7081. var n = this;
  7082. var r = new n.b2DistanceJointDef;
  7083. r.Initialize(e, t, e.GetWorldCenter(), t.GetWorldCenter());
  7084. return n.world.CreateJoint(r)
  7085. },
  7086. setPulleyJoint: function(e, t, n, r, i) {
  7087. var s = this;
  7088. var o = e.GetWorldCenter();
  7089. var u = t.GetWorldCenter();
  7090. var a = new s.b2Vec2(o.x + n[0] / s.drawScale, o.y + n[1] / s.drawScale);
  7091. var f = new s.b2Vec2(u.x + r[0] / s.drawScale, u.y + r[1] / s.drawScale);
  7092. var l = new s.b2PulleyJointDef;
  7093. l.Initialize(e, t, a, f, o, u, i);
  7094. l.maxLengthA = n[2] / s.drawScale;
  7095. l.maxLengthB = r[2] / s.drawScale;
  7096. return s.world.CreateJoint(l)
  7097. },
  7098. addCircle: function(e, t, n, r, i, s, o) {
  7099. var u = this;
  7100. u.bodyDef = new u.b2BodyDef;
  7101. u.bodyDef.type = r;
  7102. u.fixDef = new u.b2FixtureDef;
  7103. u.fixDef.density = i;
  7104. u.fixDef.friction = s;
  7105. u.fixDef.restitution = o;
  7106. u.fixDef.shape = new u.b2CircleShape(e);
  7107. u.bodyDef.position.x = t;
  7108. u.bodyDef.position.y = n;
  7109. var a = u.world.CreateBody(u.bodyDef);
  7110. a.CreateFixture(u.fixDef);
  7111. return a
  7112. },
  7113. addPolygon: function(e, t, n, r, i, s, o, u) {
  7114. var a = this;
  7115. a.bodyDef = new a.b2BodyDef;
  7116. a.bodyDef.type = i;
  7117. a.fixDef = new a.b2FixtureDef;
  7118. a.fixDef.density = s;
  7119. a.fixDef.friction = o;
  7120. a.fixDef.restitution = u;
  7121. a.fixDef.shape = new a.b2PolygonShape;
  7122. a.fixDef.shape.SetAsBox(e, t);
  7123. a.bodyDef.position.x = n;
  7124. a.bodyDef.position.y = r;
  7125. var f = a.world.CreateBody(a.bodyDef);
  7126. f.CreateFixture(a.fixDef);
  7127. return f
  7128. },
  7129. addVertices: function(e, t, n, r, i) {
  7130. var s = this,
  7131. o, u;
  7132. s.bodyDef = new s.b2BodyDef;
  7133. s.bodyDef.type = t;
  7134. var a = s.world.CreateBody(s.bodyDef);
  7135. for (o = 0, u = e.length; o < u; o++) {
  7136. s.createShapeAsArray(a, e[o], t, n, r, i)
  7137. }
  7138. return a
  7139. },
  7140. createShapeAsArray: function(e, t, n, r, i, s) {
  7141. var o = this;
  7142. var u = new o.b2PolygonShape;
  7143. var a = o.createVerticesArray(t);
  7144. u.SetAsArray(a, 0);
  7145. var f = new o.b2FixtureDef;
  7146. f.shape = u;
  7147. f.density = r;
  7148. f.friction = i;
  7149. f.restitution = s;
  7150. e.CreateFixture(f)
  7151. },
  7152. createVerticesArray: function(e) {
  7153. var t = this,
  7154. n, r;
  7155. var i = new Array;
  7156. if (e.length < 3) {
  7157. return i
  7158. }
  7159. for (n = 0, r = e.length; n < r; n++) {
  7160. i.push(new t.b2Vec2(e[n][0] / t.drawScale, e[n][1] / t.drawScale))
  7161. }
  7162. return i
  7163. },
  7164. getBodyAtMouse: function(e, t) {
  7165. var n = this;
  7166. n.mousePVec = new n.b2Vec2(e, t);
  7167. var r = new n.b2AABB;
  7168. r.lowerBound.Set(e - .001, t - .001);
  7169. r.upperBound.Set(e + .001, t + .001);
  7170. n.selectedBody = null;
  7171. n.world.QueryAABB(n.getBodyCallBack, r);
  7172. return n.selectedBody
  7173. },
  7174. getBodyCallBack: function(e) {
  7175. var t = LGlobal.box2d;
  7176. if (e.GetBody().GetType() != t.b2Body.b2_staticBody) {
  7177. if (e.GetShape().TestPoint(e.GetBody().GetTransform(), t.mousePVec)) {
  7178. t.selectedBody = e.GetBody();
  7179. return false
  7180. }
  7181. }
  7182. return true
  7183. },
  7184. ll_show: function() {
  7185. var e = this,
  7186. t = null;
  7187. for (t in e.removeList) {
  7188. e.world.DestroyBody(e.removeList[t])
  7189. }
  7190. e.removeList.splice(0, e.removeList.length);
  7191. if (e.stop) {
  7192. return
  7193. }
  7194. if (e.ll_enterFrame) {
  7195. e.ll_enterFrame({
  7196. target: e
  7197. })
  7198. }
  7199. e.world.Step(1 / 30, 10, 10);
  7200. e.world.ClearForces();
  7201. if (LGlobal.traceDebug) {
  7202. e.world.DrawDebugData()
  7203. }
  7204. },
  7205. synchronous: function() {
  7206. var t = this;
  7207. var n = null,
  7208. r, i = null,
  7209. s = 0,
  7210. o = 0,
  7211. u, a;
  7212. for (u = t.world.GetBodyList(); u; u = u.GetNext()) {
  7213. r = u.GetUserData();
  7214. if (r) {
  7215. if (i == null) {
  7216. n = r.parent;
  7217. s = u.GetPosition().x;
  7218. o = u.GetPosition().y
  7219. }
  7220. u.SetPosition(new t.b2Vec2((r.x + r.rotatex + n.x) / t.drawScale, (r.y + r.rotatey + n.y) / t.drawScale));
  7221. if (i == null) {
  7222. i = {
  7223. x: u.GetPosition().x - s,
  7224. y: u.GetPosition().y - o
  7225. }
  7226. }
  7227. }
  7228. }
  7229. for (a = t.world.GetJointList(); a; a = a.GetNext()) {
  7230. if (a.m_groundAnchor1) {
  7231. a.m_groundAnchor1.x += i.x;
  7232. a.m_groundAnchor1.y += i.y
  7233. }
  7234. if (a.m_groundAnchor2) {
  7235. a.m_groundAnchor2.x += i.x;
  7236. a.m_groundAnchor2.y += i.y
  7237. }
  7238. }
  7239. if (e.m_controllerList && t.world.m_controllerList && n) {
  7240. LGlobal.box2d.world.m_controllerList.offset = e.m_controllerList.offset - n.y / LGlobal.box2d.drawScale
  7241. }
  7242. }
  7243. };
  7244. return e
  7245. }();
  7246. LSprite.prototype.setBodyMouseJoint = function(e) {
  7247. var t = this;
  7248. if (!t.box2dBody) {
  7249. return
  7250. }
  7251. t.box2dBody.mouseJoint = e
  7252. };
  7253. LSprite.prototype.clearBody = function(e) {
  7254. var t = this;
  7255. if (!t.box2dBody) {
  7256. return
  7257. }
  7258. LGlobal.box2d.removeList.push(t.box2dBody);
  7259. t.box2dBody = null
  7260. };
  7261. LSprite.prototype.addBodyCircle = function(e, t, n, r, i, s, o) {
  7262. var u = this;
  7263. u.rotatex = e;
  7264. u.rotatey = e;
  7265. u.box2dBody = LGlobal.box2d.addCircle(e / LGlobal.box2d.drawScale, (u.x + t) / LGlobal.box2d.drawScale, (u.y + n) / LGlobal.box2d.drawScale, r == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, i == null ? .5 : i, s == null ? .4 : s, o == null ? .8 : o);
  7266. u.box2dBody.SetUserData(u)
  7267. };
  7268. LSprite.prototype.addBodyPolygon = function(e, t, n, r, i, s) {
  7269. var o = this;
  7270. o.rotatex = e / 2;
  7271. o.rotatey = t / 2;
  7272. o.box2dBody = LGlobal.box2d.addPolygon(e * .5 / LGlobal.box2d.drawScale, t * .5 / LGlobal.box2d.drawScale, o.x / LGlobal.box2d.drawScale, o.y / LGlobal.box2d.drawScale, n == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, r == null ? .5 : r, i == null ? .4 : i, s == null ? .8 : s);
  7273. o.box2dBody.SetUserData(o)
  7274. };
  7275. LSprite.prototype.addBodyVertices = function(e, t, n, r, i, s, o) {
  7276. var u = this;
  7277. u.rotatex = 0;
  7278. u.rotatey = 0;
  7279. u.box2dBody = LGlobal.box2d.addVertices(e, r == 1 ? LGlobal.box2d.b2Body.b2_dynamicBody : LGlobal.box2d.b2Body.b2_staticBody, i, s, o);
  7280. u.box2dBody.SetUserData(u);
  7281. u.box2dBody.SetPosition(new LGlobal.box2d.b2Vec2((u.x + t) / LGlobal.box2d.drawScale, (u.y + n) / LGlobal.box2d.drawScale))
  7282. };
  7283. LGlobal.mouseJoint_start = function(e) {
  7284. if (!LGlobal.IS_MOUSE_DOWN || !LGlobal.box2d || LGlobal.box2d.mouseJoint || LGlobal.box2d.stop) {
  7285. return
  7286. }
  7287. var t = e.offsetX / LGlobal.box2d.drawScale,
  7288. n = e.offsetY / LGlobal.box2d.drawScale,
  7289. r = LGlobal.box2d.getBodyAtMouse(t, n);
  7290. if (r && r.mouseJoint) {
  7291. var i = new LGlobal.box2d.b2MouseJointDef;
  7292. i.bodyA = LGlobal.box2d.world.GetGroundBody();
  7293. i.bodyB = r;
  7294. i.target.Set(t, n);
  7295. i.collideConnected = true;
  7296. i.maxForce = 3e5 * r.GetMass();
  7297. LGlobal.box2d.mouseJoint = LGlobal.box2d.world.CreateJoint(i);
  7298. r.SetAwake(true)
  7299. }
  7300. };
  7301. LGlobal.mouseJoint_move = function(e) {
  7302. if (!LGlobal.IS_MOUSE_DOWN || !LGlobal.box2d || !LGlobal.box2d.mouseJoint) {
  7303. return
  7304. }
  7305. mX = e.offsetX / LGlobal.box2d.drawScale, mY = e.offsetY / LGlobal.box2d.drawScale;
  7306. LGlobal.box2d.mouseJoint.SetTarget(new LGlobal.box2d.b2Vec2(mX, mY))
  7307. };
  7308. LGlobal.mouseJoint_end = function() {
  7309. if (LGlobal.box2d != null && LGlobal.box2d.mouseJoint) {
  7310. LGlobal.box2d.world.DestroyJoint(LGlobal.box2d.mouseJoint);
  7311. LGlobal.box2d.mouseJoint = null
  7312. }
  7313. };
  7314. var LTransition = function() {
  7315. function e(e, t) {
  7316. this.child = e;
  7317. this.trans = t
  7318. }
  7319. e.prototype = {
  7320. startTransition: function() {
  7321. var t = this;
  7322. switch (t.trans.type) {
  7323. case e.Blinds:
  7324. t.blinds();
  7325. break;
  7326. case e.Fade:
  7327. t.fade();
  7328. break;
  7329. case e.Fly:
  7330. t.fly();
  7331. break;
  7332. case e.Iris:
  7333. t.iris();
  7334. break;
  7335. case e.Squeeze:
  7336. t.squeeze();
  7337. break;
  7338. case e.Wipe:
  7339. t.wipe();
  7340. break;
  7341. case e.Zoom:
  7342. t.zoom();
  7343. break;
  7344. case e.PixelDissolve:
  7345. t.pixelDissolve();
  7346. break;
  7347. case e.Curtain:
  7348. t.curtain();
  7349. break;
  7350. default:
  7351. throw "the type is not exists."
  7352. }
  7353. },
  7354. blindsComplete: function(t) {
  7355. if (t.trans.direction == e.OUT) {
  7356. t.child.mask.clear()
  7357. } else {
  7358. t.blindsUpdateRun()
  7359. }
  7360. t.child.mask = null;
  7361. if (t.trans.onComplete) {
  7362. t.trans.onComplete(t.child)
  7363. }
  7364. },
  7365. blindsUpdateRun: function() {
  7366. var e = this,
  7367. t = e.child.mask,
  7368. n = LGlobal.canvas;
  7369. t.clear();
  7370. if (e.trans.dimension) {
  7371. t.add(function() {
  7372. n.save();
  7373. for (var t = 0; t < e.trans.numStrips; t++) {
  7374. n.rect(t * e.maxSize, 0, e.blindsSize, e.child.getHeight())
  7375. }
  7376. n.restore()
  7377. })
  7378. } else {
  7379. t.add(function() {
  7380. n.save();
  7381. for (var t = 0; t < e.trans.numStrips; t++) {
  7382. n.rect(0, 0 + t * e.maxSize, e.child.getWidth(), e.blindsSize)
  7383. }
  7384. n.restore()
  7385. })
  7386. }
  7387. },
  7388. blindsUpdate: function(e) {
  7389. e.blindsUpdateRun();
  7390. if (e.trans.onUpdate) {
  7391. e.trans.onUpdate(e.child)
  7392. }
  7393. },
  7394. blinds: function() {
  7395. var t = this;
  7396. if (!t.trans.numStrips) t.trans.numStrips = 1;
  7397. t.blindsSize = 0;
  7398. if (t.trans.dimension) {
  7399. t.maxSize = t.child.getWidth() / t.trans.numStrips >> 0
  7400. } else {
  7401. t.maxSize = t.child.getHeight() / t.trans.numStrips >> 0
  7402. }
  7403. var n = new LGraphics;
  7404. t.child.mask = n;
  7405. var r = t.maxSize;
  7406. if (t.trans.direction == e.OUT) {
  7407. t.blindsSize = t.maxSize;
  7408. r = 0
  7409. }
  7410. LTweenLite.to(t, t.trans.duration, {
  7411. blindsSize: r,
  7412. onComplete: t.blindsComplete,
  7413. onUpdate: t.blindsUpdate,
  7414. ease: t.trans.easing
  7415. })
  7416. },
  7417. fadeComplete: function(e) {
  7418. e.child.alpha = e.alpha;
  7419. if (e.trans.onComplete) {
  7420. e.trans.onComplete(e.child)
  7421. }
  7422. },
  7423. fadeUpdate: function(e) {
  7424. e.child.alpha = e.alpha;
  7425. if (e.trans.onUpdate) {
  7426. e.trans.onUpdate(e.child)
  7427. }
  7428. },
  7429. fade: function() {
  7430. var t = this;
  7431. var n = 1;
  7432. t.alpha = 0;
  7433. if (t.trans.direction == e.OUT) {
  7434. t.alpha = 1;
  7435. n = 0
  7436. }
  7437. t.child.alpha = t.alpha;
  7438. LTweenLite.to(t, t.trans.duration, {
  7439. alpha: n,
  7440. onComplete: t.fadeComplete,
  7441. onUpdate: t.fadeUpdate,
  7442. ease: t.trans.easing
  7443. })
  7444. },
  7445. flyComplete: function(e) {
  7446. e.child.x = e.x;
  7447. e.child.y = e.y;
  7448. if (e.trans.onComplete) {
  7449. e.trans.onComplete(e.child)
  7450. }
  7451. },
  7452. flyUpdate: function(e) {
  7453. e.child.x = e.x;
  7454. e.child.y = e.y;
  7455. if (e.trans.onUpdate) {
  7456. e.trans.onUpdate(e.child)
  7457. }
  7458. },
  7459. fly: function() {
  7460. var t = this;
  7461. var n = t.child.x;
  7462. var r = t.child.y;
  7463. switch (t.trans.startPoint) {
  7464. case 1:
  7465. t.x = -t.child.getWidth();
  7466. t.y = -t.child.getHeight();
  7467. break;
  7468. case 2:
  7469. t.x = (LGlobal.width - t.child.getWidth()) * .5;
  7470. t.y = -t.child.getHeight();
  7471. break;
  7472. case 3:
  7473. t.x = LGlobal.width;
  7474. t.y = -t.child.getHeight();
  7475. break;
  7476. case 4:
  7477. t.x = -t.child.getWidth();
  7478. t.y = (LGlobal.height - t.child.getHeight()) * .5;
  7479. break;
  7480. case 6:
  7481. t.x = LGlobal.width;
  7482. t.y = (LGlobal.height - t.child.getHeight()) * .5;
  7483. break;
  7484. case 7:
  7485. t.x = -t.child.getWidth();
  7486. t.y = LGlobal.height;
  7487. break;
  7488. case 8:
  7489. t.x = (LGlobal.width - t.child.getWidth()) * .5;
  7490. t.y = LGlobal.height;
  7491. break;
  7492. case 9:
  7493. t.x = LGlobal.width;
  7494. t.y = LGlobal.height;
  7495. break;
  7496. case 5:
  7497. default:
  7498. t.x = (LGlobal.width - t.child.getWidth()) * .5;
  7499. t.y = (LGlobal.height - t.child.getHeight()) * .5
  7500. }
  7501. if (t.trans.direction == e.OUT) {
  7502. var n = t.x;
  7503. var r = t.y;
  7504. t.x = t.child.x;
  7505. t.y = t.child.y
  7506. } else {
  7507. t.child.x = t.x;
  7508. t.child.y = t.y
  7509. }
  7510. LTweenLite.to(t, t.trans.duration, {
  7511. x: n,
  7512. y: r,
  7513. onComplete: t.flyComplete,
  7514. onUpdate: t.flyUpdate,
  7515. ease: t.trans.easing
  7516. })
  7517. },
  7518. irisComplete: function(t) {
  7519. if (t.trans.direction == e.OUT) {
  7520. t.child.mask.clear()
  7521. } else {
  7522. t.irisUpdateRun()
  7523. }
  7524. t.child.mask = null;
  7525. if (t.trans.onComplete) {
  7526. t.trans.onComplete(t.child)
  7527. }
  7528. },
  7529. irisUpdateRun: function() {
  7530. var e = this,
  7531. t = e.child.mask,
  7532. n = LGlobal.canvas;
  7533. t.clear();
  7534. if (e.trans.shape == LIris.CIRCLE) {
  7535. t.drawArc(0, "#000000", [e.x, e.y, e.r, 0, Math.PI * 2])
  7536. } else {
  7537. t.drawRect(0, "#000000", [e.x + e.sLeft, e.y + e.sTop, e.width, e.height])
  7538. }
  7539. },
  7540. irisUpdate: function(e) {
  7541. e.irisUpdateRun();
  7542. if (e.trans.onUpdate) {
  7543. e.trans.onUpdate(e.child)
  7544. }
  7545. },
  7546. iris: function() {
  7547. var t = this;
  7548. t.sLeft = 0;
  7549. t.sTop = 0;
  7550. t.width = 0;
  7551. t.height = 0;
  7552. t.x = 0;
  7553. t.y = 0;
  7554. t.r = 0;
  7555. t.eWidth = t.child.getWidth();
  7556. t.eHeight = t.child.getHeight();
  7557. switch (t.trans.startPoint) {
  7558. case 1:
  7559. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
  7560. break;
  7561. case 2:
  7562. t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * t.eHeight);
  7563. t.x = t.child.getWidth() * .5;
  7564. break;
  7565. case 3:
  7566. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
  7567. t.x = t.child.getWidth();
  7568. break;
  7569. case 4:
  7570. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * .5 * t.eHeight * .5);
  7571. t.y = t.child.getHeight() * .5;
  7572. break;
  7573. case 6:
  7574. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * .5 * t.eHeight * .5);
  7575. t.x = t.child.getWidth();
  7576. t.y = t.child.getHeight() * .5;
  7577. break;
  7578. case 7:
  7579. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
  7580. t.y = t.child.getHeight();
  7581. break;
  7582. case 8:
  7583. t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * t.eHeight);
  7584. t.x = t.child.getWidth() * .5;
  7585. t.y = t.child.getHeight();
  7586. break;
  7587. case 9:
  7588. t.eR = Math.sqrt(t.eWidth * t.eWidth + t.eHeight * t.eHeight);
  7589. t.x = t.child.getWidth();
  7590. t.y = t.child.getHeight();
  7591. break;
  7592. case 5:
  7593. default:
  7594. t.eR = Math.sqrt(t.eWidth * .5 * t.eWidth * .5 + t.eHeight * .5 * t.eHeight * .5);
  7595. t.x = t.child.getWidth() * .5;
  7596. t.y = t.child.getHeight() * .5
  7597. }
  7598. t.eLeft = -t.x;
  7599. t.eTop = -t.y;
  7600. var n = new LGraphics;
  7601. t.child.mask = n;
  7602. var r = t.maxSize;
  7603. if (t.trans.direction == e.OUT) {
  7604. t.sLeft = t.eLeft;
  7605. t.sTop = t.eTop;
  7606. t.eLeft = 0;
  7607. t.eTop = 0;
  7608. t.width = t.eWidth;
  7609. t.height = t.eHeight;
  7610. t.eWidth = 0;
  7611. t.eHeight = 0;
  7612. t.r = t.eR;
  7613. t.eR = 0
  7614. }
  7615. LTweenLite.to(t, t.trans.duration, {
  7616. width: t.eWidth,
  7617. height: t.eHeight,
  7618. sLeft: t.eLeft,
  7619. sTop: t.eTop,
  7620. r: t.eR,
  7621. onComplete: t.irisComplete,
  7622. onUpdate: t.irisUpdate,
  7623. ease: t.trans.easing
  7624. })
  7625. },
  7626. curtainComplete: function(t) {
  7627. if (t.trans.direction == e.OUT) {
  7628. t.child.mask.clear()
  7629. } else {
  7630. t.curtainUpdateRun()
  7631. }
  7632. t.child.mask = null;
  7633. if (t.trans.onComplete) {
  7634. t.trans.onComplete(t.child)
  7635. }
  7636. },
  7637. curtainUpdateRun: function() {
  7638. var e = this,
  7639. t = e.child.mask,
  7640. n = LGlobal.canvas;
  7641. t.clear();
  7642. if (e.trans.dimension) {
  7643. t.add(function() {
  7644. n.save();
  7645. n.rect(0, 0, e.width, e.child.getHeight());
  7646. n.rect(e.child.getWidth() - e.width, 0, e.width, e.child.getHeight());
  7647. n.restore()
  7648. })
  7649. } else {
  7650. t.add(function() {
  7651. n.save();
  7652. n.rect(0, 0, e.child.getWidth(), e.height);
  7653. n.rect(0, e.child.getHeight() - e.height, e.child.getWidth(), e.height);
  7654. n.restore()
  7655. })
  7656. }
  7657. },
  7658. curtainUpdate: function(e) {
  7659. e.curtainUpdateRun();
  7660. if (e.trans.onUpdate) {
  7661. e.trans.onUpdate(e.child)
  7662. }
  7663. },
  7664. curtain: function() {
  7665. var t = this;
  7666. var n = t.child.getWidth() * .5;
  7667. var r = t.child.getHeight() * .5;
  7668. if (t.trans.dimension) {
  7669. r = 0
  7670. } else {
  7671. n = 0
  7672. }
  7673. t.width = 0;
  7674. t.height = 0;
  7675. var i = new LGraphics;
  7676. t.child.mask = i;
  7677. var s = t.maxSize;
  7678. if (t.trans.direction == e.OUT) {
  7679. t.width = n;
  7680. t.height = r;
  7681. n = 0;
  7682. r = 0
  7683. }
  7684. LTweenLite.to(t, t.trans.duration, {
  7685. width: n,
  7686. height: r,
  7687. onComplete: t.curtainComplete,
  7688. onUpdate: t.curtainUpdate,
  7689. ease: t.trans.easing
  7690. })
  7691. },
  7692. squeezeComplete: function(e) {
  7693. e.child.scaleX = e.scaleX;
  7694. e.child.scaleY = e.scaleY;
  7695. if (e.trans.onComplete) {
  7696. e.trans.onComplete(e.child)
  7697. }
  7698. },
  7699. squeezeUpdate: function(e) {
  7700. e.child.scaleX = e.scaleX;
  7701. e.child.scaleY = e.scaleY;
  7702. if (e.trans.onUpdate) {
  7703. e.trans.onUpdate(e.child)
  7704. }
  7705. },
  7706. squeeze: function() {
  7707. var t = this;
  7708. var n = 1,
  7709. r = 1;
  7710. t.scaleX = 0, t.scaleY = 0;
  7711. if (t.trans.dimension) {
  7712. t.scaleX = 1
  7713. } else {
  7714. t.scaleY = 1
  7715. } if (t.trans.direction == e.OUT) {
  7716. n = t.scaleX, r = t.scaleY;
  7717. t.scaleX = 1, t.scaleY = 1
  7718. }
  7719. t.child.scaleX = t.scaleX;
  7720. t.child.scaleY = t.scaleY;
  7721. LTweenLite.to(t, t.trans.duration, {
  7722. scaleX: n,
  7723. scaleY: r,
  7724. onComplete: t.squeezeComplete,
  7725. onUpdate: t.squeezeUpdate,
  7726. ease: t.trans.easing
  7727. })
  7728. },
  7729. zoomComplete: function(e) {
  7730. e.child.scaleX = e.scaleX;
  7731. e.child.scaleY = e.scaleY;
  7732. if (e.trans.onComplete) {
  7733. e.trans.onComplete(e.child)
  7734. }
  7735. },
  7736. zoomUpdate: function(e) {
  7737. e.child.scaleX = e.scaleX;
  7738. e.child.scaleY = e.scaleY;
  7739. if (e.trans.onUpdate) {
  7740. e.trans.onUpdate(e.child)
  7741. }
  7742. },
  7743. zoom: function() {
  7744. var t = this;
  7745. var n = 1,
  7746. r = 1;
  7747. t.scaleX = 0, t.scaleY = 0;
  7748. if (t.trans.direction == e.OUT) {
  7749. n = 0, r = 0;
  7750. t.scaleX = 1, t.scaleY = 1
  7751. }
  7752. t.child.scaleX = t.scaleX;
  7753. t.child.scaleY = t.scaleY;
  7754. LTweenLite.to(t, t.trans.duration, {
  7755. scaleX: n,
  7756. scaleY: r,
  7757. onComplete: t.zoomComplete,
  7758. onUpdate: t.zoomUpdate,
  7759. ease: t.trans.easing
  7760. })
  7761. },
  7762. wipeComplete: function(t) {
  7763. if (t.trans.direction == e.OUT) {
  7764. t.child.mask.clear()
  7765. } else {
  7766. t.wipeUpdateRun()
  7767. }
  7768. t.child.mask = null;
  7769. if (t.trans.onComplete) {
  7770. t.trans.onComplete(t.child)
  7771. }
  7772. },
  7773. wipeUpdateRun: function() {
  7774. var e = this,
  7775. t = e.child.mask,
  7776. n = LGlobal.canvas;
  7777. t.clear();
  7778. t.drawVertices(0, "#000000", [
  7779. [e.leftTopX, e.leftTopY],
  7780. [e.leftBottomX, e.leftBottomY],
  7781. [e.rightBottomX, e.rightBottomY],
  7782. [e.rightTopX, e.rightTopY]
  7783. ])
  7784. },
  7785. wipeUpdate: function(e) {
  7786. e.wipeUpdateRun();
  7787. if (e.trans.onUpdate) {
  7788. e.trans.onUpdate(e.child)
  7789. }
  7790. },
  7791. wipe: function() {
  7792. var t = this,
  7793. n = t.child.getWidth(),
  7794. r = t.child.getHeight(),
  7795. i = t.leftTopX = 0,
  7796. s = t.leftTopY = 0,
  7797. o = t.leftBottomX = 0,
  7798. u = t.leftBottomY = r,
  7799. a = t.rightTopX = n,
  7800. f = t.rightTopY = 0,
  7801. l = t.rightBottomX = n,
  7802. c = t.rightBottomY = r;
  7803. switch (t.trans.startPoint) {
  7804. case 1:
  7805. i = t.leftTopX = -n;
  7806. o = t.leftBottomX = -n * 2;
  7807. t.rightTopX = 0;
  7808. a = n * 2;
  7809. t.rightBottomX = -n;
  7810. l = n;
  7811. break;
  7812. case 2:
  7813. s = t.leftTopY = -r;
  7814. t.leftBottomY = 0;
  7815. u = r;
  7816. f = t.rightTopY = -r;
  7817. t.rightBottomY = 0;
  7818. c = r;
  7819. break;
  7820. case 3:
  7821. t.leftTopX = n;
  7822. i = -n;
  7823. t.leftBottomX = n * 2;
  7824. o = 0;
  7825. a = t.rightTopX = n * 2;
  7826. l = t.rightBottomX = n * 3;
  7827. break;
  7828. case 4:
  7829. t.rightTopX = 0;
  7830. a = n;
  7831. t.rightBottomX = 0;
  7832. l = n;
  7833. break;
  7834. case 6:
  7835. t.leftTopX = n;
  7836. i = 0;
  7837. t.leftBottomX = n;
  7838. o = 0;
  7839. break;
  7840. case 7:
  7841. o = t.leftBottomX = -n;
  7842. i = t.leftTopX = -n * 2;
  7843. t.rightBottomX = 0;
  7844. l = n * 2;
  7845. t.rightTopX = -n;
  7846. a = n;
  7847. break;
  7848. case 8:
  7849. u = t.leftBottomY = r;
  7850. t.leftTopY = r;
  7851. s = 0;
  7852. c = t.rightBottomY = r;
  7853. t.rightTopY = r;
  7854. f = 0;
  7855. break;
  7856. case 9:
  7857. t.leftBottomX = n;
  7858. o = -n;
  7859. t.leftTopX = n * 2;
  7860. i = 0;
  7861. l = t.rightBottomX = n * 2;
  7862. a = t.rightTopX = n * 3;
  7863. break;
  7864. case 5:
  7865. default:
  7866. t.leftTopX = n * .5;
  7867. t.leftTopY = r * .5;
  7868. t.rightTopX = n * .5;
  7869. t.rightTopY = r * .5;
  7870. t.leftBottomX = n * .5;
  7871. t.leftBottomY = r * .5;
  7872. t.rightBottomX = n * .5;
  7873. t.rightBottomY = r * .5;
  7874. i = 0, s = 0;
  7875. o = 0, u = r;
  7876. a = n, f = 0;
  7877. l = n, c = r
  7878. }
  7879. var h = new LGraphics;
  7880. t.child.mask = h;
  7881. if (t.trans.direction == e.OUT) {
  7882. var p = i,
  7883. d = s,
  7884. v = o,
  7885. m = u,
  7886. g = a,
  7887. y = f,
  7888. b = l,
  7889. w = c;
  7890. i = t.leftTopX, s = t.leftTopY, o = t.leftBottomX, u = t.leftBottomY, a = t.rightTopX, f = t.rightTopY, l = t.rightBottomX, c = t.rightBottomY;
  7891. t.leftTopX = p, t.leftTopY = d, t.leftBottomX = v, t.leftBottomY = m, t.rightTopX = g, t.rightTopY = y, t.rightBottomX = b, t.rightBottomY = w
  7892. }
  7893. LTweenLite.to(t, t.trans.duration, {
  7894. leftTopX: i,
  7895. leftTopY: s,
  7896. leftBottomX: o,
  7897. leftBottomY: u,
  7898. rightTopX: a,
  7899. rightTopY: f,
  7900. rightBottomX: l,
  7901. rightBottomY: c,
  7902. onComplete: t.wipeComplete,
  7903. onUpdate: t.wipeUpdate,
  7904. ease: t.trans.easing
  7905. })
  7906. },
  7907. pixelDissolveComplete: function(t) {
  7908. if (t.trans.direction == e.OUT) {
  7909. t.child.mask.clear()
  7910. } else {
  7911. t.pixelDissolveUpdateRun()
  7912. }
  7913. t.child.mask = null;
  7914. if (t.trans.onComplete) {
  7915. t.trans.onComplete(t.child)
  7916. }
  7917. },
  7918. pixelDissolveUpdateRun: function() {
  7919. var e = this,
  7920. t = e.child.mask,
  7921. n = LGlobal.canvas,
  7922. r;
  7923. t.clear();
  7924. t.add(function() {
  7925. n.save();
  7926. for (var t = 0; t < e.index; t++) {
  7927. r = e.list[t];
  7928. n.rect(r[0] * e.w, r[1] * e.h, e.w, e.h)
  7929. }
  7930. n.restore()
  7931. })
  7932. },
  7933. pixelDissolveUpdate: function(e) {
  7934. e.pixelDissolveUpdateRun();
  7935. if (e.trans.onUpdate) {
  7936. e.trans.onUpdate(e.child)
  7937. }
  7938. },
  7939. pixelDissolve: function() {
  7940. var t = this;
  7941. var n = new LGraphics;
  7942. t.child.mask = n;
  7943. LGlobal.mg = n;
  7944. t.w = t.child.getWidth() / t.trans.xSections, t.h = t.child.getHeight() / t.trans.ySections;
  7945. t.list = [];
  7946. for (var r = 0; r < t.trans.xSections; r++) {
  7947. for (var i = 0; i < t.trans.ySections; i++) {
  7948. t.list.push([r, i])
  7949. }
  7950. }
  7951. t.index = 0;
  7952. var s = t.trans.xSections * t.trans.ySections;
  7953. if (t.trans.direction == e.OUT) {
  7954. t.index = s;
  7955. s = 0
  7956. }
  7957. t.list = t.list.sort(function(e, t) {
  7958. return Math.random() > .5
  7959. });
  7960. t.pixelDissolveUpdateRun();
  7961. LTweenLite.to(t, t.trans.duration, {
  7962. index: s,
  7963. onComplete: t.pixelDissolveComplete,
  7964. onUpdate: t.pixelDissolveUpdate,
  7965. ease: t.trans.easing
  7966. })
  7967. }
  7968. };
  7969. e.IN = "in";
  7970. e.OUT = "out";
  7971. e.Blinds = 1;
  7972. e.Fade = 2;
  7973. e.Fly = 3;
  7974. e.Iris = 4;
  7975. e.Curtain = 5;
  7976. e.PixelDissolve = 6;
  7977. e.Squeeze = 7;
  7978. e.Wipe = 8;
  7979. e.Zoom = 9;
  7980. return e
  7981. }();
  7982. var LIris = function() {
  7983. function e() {}
  7984. e.SQUARE = 0;
  7985. e.CIRCLE = 1;
  7986. return e
  7987. }();
  7988. var LTransitionManager = function() {
  7989. function e(e) {
  7990. this.child = e
  7991. }
  7992. e.prototype = {
  7993. startTransition: function(t) {
  7994. return e.start(this.child, t)
  7995. }
  7996. };
  7997. e.start = function(e, t) {
  7998. var n = new LTransition(e, t);
  7999. n.startTransition();
  8000. return n
  8001. };
  8002. return e
  8003. }();
  8004. var LFlash = function() {
  8005. function e() {}
  8006. e.SpriteSheetConvert = function(e) {
  8007. var t = [],
  8008. n;
  8009. for (var r = 0; r < e.length; r++) {
  8010. n = e[r];
  8011. t.push({
  8012. x: n.frame.x,
  8013. sx: n.spriteSourceSize.x,
  8014. y: n.frame.y,
  8015. sy: n.spriteSourceSize.y,
  8016. width: n.frame.w,
  8017. height: n.frame.h
  8018. })
  8019. }
  8020. return t
  8021. };
  8022. return e
  8023. }();
  8024. var LString = {
  8025. trim: function(e) {
  8026. return e.replace(/(^\s*)|(\s*$)|(\n)/g, "")
  8027. },
  8028. leftTrim: function(e) {
  8029. return e.replace(/(^\s*)|(^\n)/g, "")
  8030. },
  8031. rightTrim: function(e) {
  8032. return e.replace(/(\s*$)|(\n$)/g, "")
  8033. },
  8034. numberFormat: function(e, t) {
  8035. if (!t || t < 1) {
  8036. t = 3
  8037. }
  8038. e = String(e).split(".");
  8039. e[0] = e[0].replace(new RegExp("(\\d)(?=(\\d{" + t + "})+$)", "ig"), "$1,");
  8040. return e.join(".")
  8041. },
  8042. isString: function(e) {
  8043. var t = /^([a-z]|[A-Z])+$/;
  8044. return t.exec(e)
  8045. },
  8046. isNumber: function(e) {
  8047. var t = /^\d+\.\d+$/;
  8048. return t.exec(e)
  8049. },
  8050. isInt: function(e) {
  8051. var t = /^\d+$/;
  8052. return t.exec(e)
  8053. }
  8054. };
  8055. LMath = LString