123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079230802308123082230832308423085230862308723088230892309023091230922309323094230952309623097230982309923100231012310223103231042310523106231072310823109231102311123112231132311423115231162311723118231192312023121231222312323124231252312623127231282312923130231312313223133231342313523136231372313823139231402314123142231432314423145231462314723148231492315023151231522315323154231552315623157231582315923160231612316223163231642316523166231672316823169231702317123172231732317423175231762317723178231792318023181231822318323184231852318623187231882318923190231912319223193231942319523196231972319823199232002320123202232032320423205232062320723208232092321023211232122321323214232152321623217232182321923220232212322223223232242322523226232272322823229232302323123232232332323423235232362323723238232392324023241232422324323244232452324623247232482324923250232512325223253232542325523256232572325823259232602326123262232632326423265232662326723268232692327023271232722327323274232752327623277232782327923280232812328223283232842328523286232872328823289232902329123292232932329423295232962329723298232992330023301233022330323304233052330623307233082330923310233112331223313233142331523316233172331823319233202332123322233232332423325233262332723328233292333023331233322333323334233352333623337233382333923340233412334223343233442334523346233472334823349233502335123352233532335423355233562335723358233592336023361233622336323364233652336623367233682336923370233712337223373233742337523376233772337823379233802338123382233832338423385233862338723388233892339023391233922339323394233952339623397233982339923400234012340223403234042340523406234072340823409234102341123412234132341423415234162341723418234192342023421234222342323424234252342623427234282342923430234312343223433234342343523436234372343823439234402344123442234432344423445234462344723448234492345023451234522345323454234552345623457234582345923460234612346223463234642346523466234672346823469234702347123472234732347423475234762347723478234792348023481234822348323484234852348623487234882348923490234912349223493234942349523496234972349823499235002350123502235032350423505235062350723508235092351023511235122351323514235152351623517235182351923520235212352223523235242352523526235272352823529235302353123532235332353423535235362353723538235392354023541235422354323544235452354623547235482354923550235512355223553235542355523556235572355823559235602356123562235632356423565235662356723568235692357023571235722357323574235752357623577235782357923580235812358223583235842358523586235872358823589235902359123592235932359423595235962359723598235992360023601236022360323604236052360623607236082360923610236112361223613236142361523616236172361823619236202362123622236232362423625236262362723628236292363023631236322363323634236352363623637236382363923640236412364223643236442364523646236472364823649236502365123652236532365423655236562365723658236592366023661236622366323664236652366623667236682366923670236712367223673236742367523676236772367823679236802368123682236832368423685236862368723688236892369023691236922369323694236952369623697236982369923700237012370223703237042370523706237072370823709237102371123712237132371423715237162371723718237192372023721237222372323724237252372623727237282372923730237312373223733237342373523736237372373823739237402374123742237432374423745237462374723748237492375023751237522375323754237552375623757237582375923760237612376223763237642376523766237672376823769237702377123772237732377423775237762377723778237792378023781237822378323784237852378623787237882378923790237912379223793237942379523796237972379823799238002380123802238032380423805238062380723808238092381023811238122381323814238152381623817238182381923820238212382223823238242382523826238272382823829238302383123832238332383423835238362383723838238392384023841238422384323844238452384623847238482384923850238512385223853238542385523856238572385823859238602386123862238632386423865238662386723868238692387023871238722387323874238752387623877238782387923880238812388223883238842388523886238872388823889238902389123892238932389423895238962389723898238992390023901239022390323904239052390623907239082390923910239112391223913239142391523916239172391823919239202392123922239232392423925239262392723928239292393023931239322393323934239352393623937239382393923940239412394223943239442394523946239472394823949239502395123952239532395423955239562395723958239592396023961239622396323964239652396623967239682396923970239712397223973239742397523976239772397823979239802398123982239832398423985239862398723988239892399023991239922399323994239952399623997239982399924000240012400224003240042400524006240072400824009240102401124012240132401424015240162401724018240192402024021240222402324024240252402624027240282402924030240312403224033240342403524036240372403824039240402404124042240432404424045240462404724048240492405024051240522405324054240552405624057240582405924060240612406224063240642406524066240672406824069240702407124072240732407424075240762407724078240792408024081240822408324084240852408624087240882408924090240912409224093240942409524096240972409824099241002410124102241032410424105241062410724108241092411024111241122411324114241152411624117241182411924120241212412224123241242412524126241272412824129241302413124132241332413424135241362413724138241392414024141241422414324144241452414624147241482414924150241512415224153241542415524156241572415824159241602416124162241632416424165241662416724168241692417024171241722417324174241752417624177241782417924180241812418224183241842418524186241872418824189241902419124192241932419424195241962419724198241992420024201242022420324204242052420624207242082420924210242112421224213242142421524216242172421824219242202422124222242232422424225242262422724228242292423024231242322423324234242352423624237242382423924240242412424224243242442424524246242472424824249242502425124252242532425424255242562425724258242592426024261242622426324264242652426624267242682426924270242712427224273242742427524276242772427824279242802428124282242832428424285242862428724288242892429024291242922429324294242952429624297242982429924300243012430224303243042430524306243072430824309243102431124312243132431424315243162431724318243192432024321243222432324324243252432624327243282432924330243312433224333243342433524336243372433824339243402434124342243432434424345243462434724348243492435024351243522435324354243552435624357243582435924360243612436224363243642436524366243672436824369243702437124372243732437424375243762437724378243792438024381243822438324384243852438624387243882438924390243912439224393243942439524396243972439824399244002440124402244032440424405244062440724408244092441024411244122441324414244152441624417244182441924420244212442224423244242442524426244272442824429244302443124432244332443424435244362443724438244392444024441244422444324444244452444624447244482444924450244512445224453244542445524456244572445824459244602446124462244632446424465244662446724468244692447024471244722447324474244752447624477244782447924480244812448224483244842448524486244872448824489244902449124492244932449424495244962449724498244992450024501245022450324504245052450624507245082450924510245112451224513245142451524516245172451824519245202452124522245232452424525245262452724528245292453024531245322453324534245352453624537245382453924540245412454224543245442454524546245472454824549245502455124552245532455424555245562455724558245592456024561245622456324564245652456624567245682456924570245712457224573245742457524576245772457824579245802458124582245832458424585245862458724588245892459024591245922459324594245952459624597245982459924600246012460224603246042460524606246072460824609246102461124612246132461424615246162461724618246192462024621246222462324624246252462624627246282462924630246312463224633246342463524636246372463824639246402464124642246432464424645246462464724648246492465024651246522465324654246552465624657246582465924660246612466224663246642466524666246672466824669246702467124672246732467424675246762467724678246792468024681246822468324684246852468624687246882468924690246912469224693246942469524696246972469824699247002470124702247032470424705247062470724708247092471024711247122471324714247152471624717247182471924720247212472224723247242472524726247272472824729247302473124732247332473424735247362473724738247392474024741247422474324744247452474624747247482474924750247512475224753247542475524756247572475824759 |
- declare namespace cc {
-
- export var ENGINE_VERSION: string;
-
- export function error(msg: any, ...subst: any[]): void;
-
- export function warn(msg: any, ...subst: any[]): void;
-
- export function log(msg: string|any, ...subst: any[]): void;
-
- export var director: Director;
-
- export var game: Game;
-
- export var easing: Easing;
-
- export function speed(action: ActionInterval, speed: number): Action;
-
- export function follow(followedNode: Node, rect: Rect): Action;
-
- export function setPoints(points: any[]): void;
-
- export function cardinalSplineTo(duration: number, points: any[], tension: number): ActionInterval;
-
- export function updatePosition(newPos: Vec2): void;
-
- export function cardinalSplineBy(duration: number, points: any[], tension: number): ActionInterval;
-
- export function catmullRomTo(dt: number, points: any[]): ActionInterval;
-
- export function catmullRomBy(dt: number, points: any[]): ActionInterval;
-
- export function easeIn(rate: number): any;
-
- export function easeOut(rate: number): any;
-
- export function easeInOut(rate: number): any;
-
- export function easeExponentialIn(): any;
-
- export function easeExponentialOut(): any;
-
- export function easeExponentialInOut(): any;
-
- export function easeSineIn(): any;
-
- export function easeSineOut(): any;
-
- export function easeSineInOut(): any;
-
- export function easeElasticIn(period: number): any;
-
- export function easeElasticOut(period: number): any;
-
- export function easeElasticInOut(period: number): any;
-
- export function easeBounceIn(): any;
-
- export function easeBounceOut(): any;
-
- export function easeBounceInOut(): any;
-
- export function easeBackIn(): any;
-
- export function easeBackOut(): any;
-
- export function easeBackInOut(): any;
-
- export function easeBezierAction(p0: number, p1: number, p2: number, p3: number): any;
-
- export function easeQuadraticActionIn(): any;
-
- export function easeQuadraticActionOut(): any;
-
- export function easeQuadraticActionInOut(): any;
-
- export function easeQuarticActionIn(): any;
-
- export function easeQuarticActionOut(): any;
-
- export function easeQuarticActionInOut(): any;
-
- export function easeQuinticActionIn(): any;
-
- export function easeQuinticActionOut(): any;
-
- export function easeQuinticActionInOut(): any;
-
- export function easeCircleActionIn(): any;
-
- export function easeCircleActionOut(): any;
-
- export function easeCircleActionInOut(): any;
-
- export function easeCubicActionIn(): any;
-
- export function easeCubicActionOut(): any;
-
- export function easeCubicActionInOut(): any;
-
- export function show(): ActionInstant;
-
- export function hide(): ActionInstant;
-
- export function toggleVisibility(): ActionInstant;
-
- export function removeSelf(isNeedCleanUp ?: boolean): ActionInstant;
-
- export function flipX(flip: boolean): ActionInstant;
-
- export function flipY(flip: boolean): ActionInstant;
-
- export function place(pos: Vec2|number, y?: number): ActionInstant;
-
- export function callFunc(selector: Function, selectorTarget?: any, data?: any): ActionInstant;
-
- export function sequence(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): ActionInterval;
-
- export function repeat(action: FiniteTimeAction, times: number): ActionInterval;
-
- export function repeatForever(action: FiniteTimeAction): ActionInterval;
-
- export function spawn(actionOrActionArray: FiniteTimeAction|FiniteTimeAction[], ...tempArray: FiniteTimeAction[]): FiniteTimeAction;
-
- export function rotateTo(duration: number, dstAngle: number): ActionInterval;
-
- export function rotateBy(duration: number, deltaAngle: number): ActionInterval;
-
- export function moveBy(duration: number, deltaPos: Vec2|number, deltaY?: number): ActionInterval;
-
- export function moveTo(duration: number, position: Vec2|number, y?: number): ActionInterval;
-
- export function skewTo(t: number, sx: number, sy: number): ActionInterval;
-
- export function skewBy(t: number, sx: number, sy: number): ActionInterval;
-
- export function jumpBy(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval;
-
- export function jumpTo(duration: number, position: Vec2|number, y?: number, height?: number, jumps?: number): ActionInterval;
-
- export function bezierBy(t: number, c: Vec2[]): ActionInterval;
-
- export function bezierTo(t: number, c: Vec2[]): ActionInterval;
-
- export function scaleTo(duration: number, sx: number, sy?: number): ActionInterval;
-
- export function scaleBy(duration: number, sx: number, sy?: number|void): ActionInterval;
-
- export function blink(duration: number, blinks: number): ActionInterval;
-
- export function fadeTo(duration: number, opacity: number): ActionInterval;
-
- export function fadeIn(duration: number): ActionInterval;
-
- export function fadeOut(d: number): ActionInterval;
-
- export function tintTo(duration: number, red: number, green: number, blue: number): ActionInterval;
-
- export function tintBy(duration: number, deltaRed: number, deltaGreen: number, deltaBlue: number): ActionInterval;
-
- export function delayTime(d: number): ActionInterval;
-
- export function reverseTime(action: FiniteTimeAction): ActionInterval;
-
- export function targetedAction(target: Node, action: FiniteTimeAction): ActionInterval;
-
- export function tween(target?: any): Tween;
-
- export function rotate3DTo(duration: number, dstAngleX: number|Vec3|Quat, dstAngleY?: number, dstAngleZ?: number): ActionInterval;
-
- export function rotate3DBy(duration: number, deltaAngleX: number|Vec3, deltaAngleY?: number, deltaAngleZ?: number): ActionInterval;
-
- export var systemEvent: SystemEvent;
-
- export var offset: number;
-
- export var length: number;
-
- export var data: BufferRange;
-
- export var formats: VertexFormat;
-
- export var vertexBundleIndices: number[];
-
- export var data: BufferRange;
-
- export var indexUnit: number;
-
- export var topology: number;
-
- export function Class(options?: {name?: string; extends?: Function; ctor?: Function; __ctor__?: Function; properties?: any; statics?: any; mixins?: Function[]; editor?: {executeInEditMode?: boolean; requireComponent?: Function; menu?: string; executionOrder?: number; disallowMultiple?: boolean; playOnFocus?: boolean; inspector?: string; icon?: string; help?: string; }; update?: Function; lateUpdate?: Function; onLoad?: Function; start?: Function; onEnable?: Function; onDisable?: Function; onDestroy?: Function; onFocusInEditor?: Function; onLostFocusInEditor?: Function; resetInEditor?: Function; onRestore?: Function; _getLocalBounds?: Function; }): Function;
-
- export function Enum<T>(obj: T): T;
-
- export function handleTouchesBegin(touches: any[]): void;
-
- export function handleTouchesMove(touches: any[]): void;
-
- export function handleTouchesEnd(touches: any[]): void;
-
- export function handleTouchesCancel(touches: any[]): void;
-
- export function getSetOfTouchesEndOrCancel(touches: any[]): any[];
-
- export function getPreTouch(touch: Touch): Touch;
-
- export function setPreTouch(touch: Touch): void;
-
- export function getTouchByXY(tx: number, ty: number, pos: Vec2): Touch;
-
- export function getMouseEvent(location: Vec2, pos: Vec2, eventType: number): Event.EventMouse;
-
- export function getPointByEvent(event: Touch, pos: Vec2): Vec2;
-
- export function getTouchesByEvent(event: Touch, pos: Vec2): any[];
-
- export function registerSystemEvent(element: HTMLElement): void;
-
- export function update(dt: number): void;
-
- export function isValid(value: any, strictMode?: boolean): boolean;
-
- export var view: View;
-
- export var winSize: Size;
-
- export var Integer: string;
-
- export var Float: string;
-
- export var Boolean: string;
-
- export var String: string;
-
- export function deserialize(data: string|any, details?: Details, options?: any): any;
-
- export function instantiate(original: Prefab): Node;
- export function instantiate<T>(original: T): T;
-
- export function find(path: string, referenceNode?: Node): Node;
-
- export function color(r?: number, g?: number, b?: number, a?: number): Color;
-
- export function mat4(m00?: number, m01?: number, m02?: number, m03?: number, m10?: number, m11?: number, m12?: number, m13?: number, m20?: number, m21?: number, m22?: number, m23?: number, m30?: number, m31?: number, m32?: number, m33?: number): Mat4;
-
- export function rect(x?: number, y?: number, w?: number, h?: number): Rect;
-
- export function quat(x?: number|any, y?: number, z?: number, w?: number): Quat;
-
- export function size(w: number|Size, h?: number): Size;
-
- export function v2(x?: number|any, y?: number): Vec2;
-
- export function p(x?: number|any, y?: number): Vec2;
-
- export function v3(x?: number|any, y?: number, z?: number): Vec3;
-
- export function v4(x?: number|any, y?: number, z?: number): Vec4;
- export var dynamicAtlasManager: DynamicAtlasManager;
-
- export class debug {
-
- static getError(errorId: string, param?: any): string;
-
- static isDisplayStats(): boolean;
-
- static setDisplayStats(displayStats: boolean): void;
- }
-
- export class Director extends EventTarget {
-
- convertToGL(uiPoint: Vec2): Vec2;
-
- convertToUI(glPoint: Vec2): Vec2;
-
- end(): void;
-
- getWinSize(): Size;
-
- getWinSizeInPixels(): Size;
-
- pause(): void;
-
- runSceneImmediate(scene: Scene, onBeforeLoadScene?: Function, onLaunched?: Function): void;
-
- loadScene(sceneName: string, onLaunched?: Function): boolean;
-
- preloadScene(sceneName: string, onProgress?: (completedCount: number, totalCount: number, item: any) => void, onLoaded?: (error: Error, asset: SceneAsset) => void): void;
-
- resume(): void;
-
- setDepthTest(on: boolean): void;
-
- setClearColor(clearColor: Color): void;
-
- getScene(): Scene;
-
- getAnimationInterval(): number;
-
- setAnimationInterval(value: number): void;
-
- getDeltaTime(): number;
-
- getTotalTime(): number;
-
- getTotalFrames(): number;
-
- isPaused(): boolean;
-
- getScheduler(): Scheduler;
-
- setScheduler(scheduler: Scheduler): void;
-
- getActionManager(): ActionManager;
-
- setActionManager(actionManager: ActionManager): void;
-
- getCollisionManager(): CollisionManager;
-
- getPhysicsManager(): PhysicsManager;
-
- static EVENT_PROJECTION_CHANGED: string;
-
- static EVENT_BEFORE_SCENE_LOADING: string;
-
- static EVENT_BEFORE_SCENE_LAUNCH: string;
-
- static EVENT_AFTER_SCENE_LAUNCH: string;
-
- static EVENT_BEFORE_UPDATE: string;
-
- static EVENT_AFTER_UPDATE: string;
-
- static EVENT_BEFORE_VISIT: string;
-
- static EVENT_AFTER_VISIT: string;
-
- static EVENT_BEFORE_DRAW: string;
-
- static EVENT_AFTER_DRAW: string;
-
- static PROJECTION_2D: number;
-
- static PROJECTION_3D: number;
-
- static PROJECTION_CUSTOM: number;
-
- static PROJECTION_DEFAULT: number;
- }
-
- export class Game extends EventTarget {
-
- EVENT_HIDE: string;
-
- EVENT_SHOW: string;
-
- EVENT_RESTART: string;
-
- EVENT_GAME_INITED: string;
-
- EVENT_ENGINE_INITED: string;
-
- RENDER_TYPE_CANVAS: number;
-
- RENDER_TYPE_WEBGL: number;
-
- RENDER_TYPE_OPENGL: number;
-
- frame: any;
-
- container: HTMLDivElement;
-
- canvas: HTMLCanvasElement;
-
- renderType: number;
-
- config: any;
-
- onStart(): void;
-
- setFrameRate(frameRate: number): void;
-
- getFrameRate(): number;
-
- step(): void;
-
- pause(): void;
-
- resume(): void;
-
- isPaused(): boolean;
-
- restart(): void;
-
- end(): void;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- prepare(cb: Function): void;
-
- run(config: any, onStart: Function): void;
-
- addPersistRootNode(node: Node): void;
-
- removePersistRootNode(node: Node): void;
-
- isPersistRootNode(node: Node): boolean;
- }
-
- export class PrivateNode extends Node {
-
- constructor(name?: string);
- }
-
- export class Node extends _BaseNode {
-
- groupIndex: number;
-
- group: string;
-
- position: Vec2;
-
- x: number;
-
- y: number;
-
- z: number;
-
- rotation: number;
-
- angle: number;
-
- eulerAngles: Vec3;
-
- rotationX: number;
-
- rotationY: number;
-
- scale: number;
-
- scaleX: number;
-
- scaleY: number;
-
- scaleZ: number;
-
- skewX: number;
-
- skewY: number;
-
- opacity: number;
-
- color: Color;
-
- anchorX: number;
-
- anchorY: number;
-
- width: number;
-
- height: number;
-
- zIndex: number;
-
- constructor(name?: string);
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- once<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any, useCapture?: boolean): void;
-
- targetOff(target: any): void;
-
- hasEventListener(type: string): boolean;
-
- emit(type: string, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any): void;
-
- dispatchEvent(event: Event): void;
-
- pauseSystemEvents(recursive: boolean): void;
-
- resumeSystemEvents(recursive: boolean): void;
-
- runAction(action: Action): Action;
-
- pauseAllActions(): void;
-
- resumeAllActions(): void;
-
- stopAllActions(): void;
-
- stopAction(action: Action): void;
-
- stopActionByTag(tag: number): void;
-
- getActionByTag(tag: number): Action;
-
- getNumberOfRunningActions(): number;
-
- getPosition(out?: Vec2|Vec3): Vec2;
-
- setPosition(newPosOrX: Vec2|Vec3|number, y?: number, z?: number): void;
-
- getScale(out: Vec2|Vec3): Vec2;
-
- setScale(x: number|Vec2|Vec3, y?: number, z?: number): void;
-
- getRotation(out: Quat): Quat;
-
- setRotation(quat: Quat|number, y?: number, z?: number, w?: number): void;
-
- getContentSize(): Size;
-
- setContentSize(size: Size|number, height?: number): void;
-
- getAnchorPoint(): Vec2;
-
- setAnchorPoint(point: Vec2|number, y?: number): void;
-
- lookAt(pos: Vec3, up?: Vec3): void;
-
- getLocalMatrix(out: Mat4): Mat4;
-
- getWorldMatrix(out: Mat4): Mat4;
-
- convertToNodeSpaceAR<T extends cc.Vec2 | cc.Vec3>(worldPoint: T, out?: T): T;
-
- convertToWorldSpaceAR<T extends cc.Vec2 | cc.Vec3>(nodePoint: T, out?: T): T;
-
- convertToNodeSpace(worldPoint: Vec2): Vec2;
-
- convertToWorldSpace(nodePoint: Vec2): Vec2;
-
- getNodeToParentTransform(out?: AffineTransform): AffineTransform;
-
- getNodeToParentTransformAR(out?: AffineTransform): AffineTransform;
-
- getNodeToWorldTransform(out?: AffineTransform): AffineTransform;
-
- getNodeToWorldTransformAR(out?: AffineTransform): AffineTransform;
-
- getParentToNodeTransform(out?: AffineTransform): AffineTransform;
-
- getWorldToNodeTransform(out?: AffineTransform): AffineTransform;
-
- convertTouchToNodeSpace(touch: Touch): Vec2;
-
- convertTouchToNodeSpaceAR(touch: Touch): Vec2;
-
- getBoundingBox(): Rect;
-
- getBoundingBoxToWorld(): Rect;
-
- addChild(child: Node, zIndex?: number, name?: string): void;
-
- cleanup(): void;
-
- sortAllChildren(): void;
-
- is3DNode: boolean;
-
- getDisplayedOpacity(): number;
-
- getDisplayedColor(): Color;
-
- cascadeOpacity: boolean;
-
- isCascadeOpacityEnabled(): boolean;
-
- setCascadeOpacityEnabled(cascadeOpacityEnabled: boolean): void;
-
- setOpacityModifyRGB(opacityValue: boolean): void;
-
- isOpacityModifyRGB(): boolean;
- }
-
- export class Scene extends Node {
-
- autoReleaseAssets: boolean;
- }
-
- export class Scheduler {
-
- enableForTarget(target: any): void;
-
- setTimeScale(timeScale: number): void;
-
- getTimeScale(): number;
-
- update(dt: number): void;
-
- schedule(callback: Function, target: any, interval: number, repeat: number, delay: number, paused?: boolean): void;
- schedule(callback: Function, target: any, interval: number, paused?: boolean): void;
-
- scheduleUpdate(target: any, priority: number, paused: boolean): void;
-
- unschedule(callback: Function, target: any): void;
-
- unscheduleUpdate(target: any): void;
-
- unscheduleAllForTarget(target: any): void;
-
- unscheduleAll(): void;
-
- unscheduleAllWithMinPriority(minPriority: number): void;
-
- isScheduled(callback: Function, target: any): boolean;
-
- pauseAllTargets(): void;
-
- pauseAllTargetsWithMinPriority(minPriority: number): void;
-
- resumeTargets(targetsToResume: any[]): void;
-
- pauseTarget(target: any): void;
-
- resumeTarget(target: any): void;
-
- isTargetPaused(target: any): boolean;
-
- static PRIORITY_SYSTEM: number;
-
- static PRIORITY_NON_SYSTEM: number;
- }
-
- export class audioEngine {
-
- static play(clip: AudioClip, loop: boolean, volume: number): number;
-
- static setLoop(audioID: number, loop: boolean): void;
-
- static isLoop(audioID: number): boolean;
-
- static setVolume(audioID: number, volume: number): void;
-
- static getVolume(audioID: number): number;
-
- static setCurrentTime(audioID: number, sec: number): boolean;
-
- static getCurrentTime(audioID: number): number;
-
- static getDuration(audioID: number): number;
-
- static getState(audioID: number): audioEngine.AudioState;
-
- static setFinishCallback(audioID: number, callback: Function): void;
-
- static pause(audioID: number): void;
-
- static pauseAll(): void;
-
- static resume(audioID: number): void;
-
- static resumeAll(): void;
-
- static stop(audioID: number): void;
-
- static stopAll(): void;
-
- static setMaxAudioInstance(num: number): void;
-
- static getMaxAudioInstance(): number;
-
- static uncache(clip: AudioClip): void;
-
- static uncacheAll(): void;
-
- static preload(filePath: string, callback?: Function): void;
-
- static setMaxWebAudioSize(kb: number): void;
-
- static playMusic(clip: AudioClip, loop: boolean): number;
-
- static stopMusic(): void;
-
- static pauseMusic(): void;
-
- static resumeMusic(): void;
-
- static getMusicVolume(): number;
-
- static setMusicVolume(volume: number): void;
-
- static isMusicPlaying(): boolean;
-
- static playEffect(clip: AudioClip, loop: boolean): number;
-
- static setEffectsVolume(volume: number): void;
-
- static getEffectsVolume(): number;
-
- static pauseEffect(audioID: number): void;
-
- static pauseAllEffects(): void;
-
- static resumeEffect(audioID: number): void;
-
- static resumeAllEffects(): void;
-
- static stopEffect(audioID: number): void;
-
- static stopAllEffects(): void;
- }
-
- export class AnimationClip extends Asset {
-
- duration: number;
-
- sample: number;
-
- speed: number;
-
- wrapMode: WrapMode;
-
- curveData: any;
-
- events: {frame: number, func: string, params: string[]}[];
-
- static createWithSpriteFrames(spriteFrames: SpriteFrame[], sample: number): AnimationClip;
- }
-
- export class AnimationState extends Playable {
-
- constructor(clip: AnimationClip, name?: string);
-
- curves: any[];
-
- delay: number;
-
- repeatCount: number;
-
- duration: number;
-
- speed: number;
-
- wrapMode: WrapMode;
-
- time: number;
-
- clip: AnimationClip;
-
- name: string;
- }
-
- export class Easing {
-
- quadIn(t: number): any;
-
- quadOut(t: number): any;
-
- quadInOut(t: number): any;
-
- cubicIn(t: number): any;
-
- cubicOut(t: number): any;
-
- cubicInOut(t: number): any;
-
- quartIn(t: number): any;
-
- quartOut(t: number): any;
-
- quartInOut(t: number): any;
-
- quintIn(t: number): any;
-
- quintOut(t: number): any;
-
- quintInOut(t: number): any;
-
- sineIn(t: number): any;
-
- sineOut(t: number): any;
-
- sineInOut(t: number): any;
-
- expoIn(t: number): any;
-
- expoOu(t: number): any;
-
- expoInOut(t: number): any;
-
- circIn(t: number): any;
-
- circOut(t: number): any;
-
- circInOut(t: number): any;
-
- elasticIn(t: number): any;
-
- elasticOut(t: number): any;
-
- elasticInOut(t: number): any;
-
- backIn(t: number): any;
-
- backOut(t: number): any;
-
- backInOut(t: number): any;
-
- bounceIn(t: number): any;
-
- bounceOut(t: number): any;
-
- bounceInOut(t: number): any;
-
- smooth(t: number): any;
-
- fade(t: number): any;
- }
-
- export class Playable {
-
- isPlaying: boolean;
-
- isPaused: boolean;
-
- play(): void;
-
- stop(): void;
-
- pause(): void;
-
- resume(): void;
-
- step(): void;
- }
-
- export enum WrapMode {
- Default = 0,
- Normal = 0,
- Reverse = 0,
- Loop = 0,
- LoopReverse = 0,
- PingPong = 0,
- PingPongReverse = 0,
- }
-
- export class ParticleAsset extends Asset {
- }
-
- export class ParticleSystem extends RenderComponent implements BlendFunc {
-
- preview: boolean;
-
- custom: boolean;
-
- file: ParticleAsset;
-
- spriteFrame: SpriteFrame;
-
- texture: string;
-
- particleCount: number;
-
- stopped: boolean;
-
- playOnLoad: boolean;
-
- autoRemoveOnFinish: boolean;
-
- active: boolean;
-
- totalParticles: number;
-
- duration: number;
-
- emissionRate: number;
-
- life: number;
-
- lifeVar: number;
-
- startColor: Color;
-
- startColorVar: Color;
-
- endColor: Color;
-
- endColorVar: Color;
-
- angle: number;
-
- angleVar: number;
-
- startSize: number;
-
- startSizeVar: number;
-
- endSize: number;
-
- endSizeVar: number;
-
- startSpin: number;
-
- startSpinVar: number;
-
- endSpin: number;
-
- endSpinVar: number;
-
- sourcePos: Vec2;
-
- posVar: Vec2;
-
- positionType: ParticleSystem.PositionType;
-
- emitterMode: ParticleSystem.EmitterMode;
-
- gravity: Vec2;
-
- speed: number;
-
- speedVar: number;
-
- tangentialAccel: number;
-
- tangentialAccelVar: number;
-
- radialAccel: number;
-
- radialAccelVar: number;
-
- rotationIsDir: boolean;
-
- startRadius: number;
-
- startRadiusVar: number;
-
- endRadius: number;
-
- endRadiusVar: number;
-
- rotatePerS: number;
-
- rotatePerSVar: number;
-
- static DURATION_INFINITY: number;
-
- static START_SIZE_EQUAL_TO_END_SIZE: number;
-
- static START_RADIUS_EQUAL_TO_END_RADIUS: number;
-
- stopSystem(): void;
-
- resetSystem(): void;
-
- isFull(): boolean;
-
- setTextureWithRect(texture: Texture2D, rect: Rect): void;
- }
-
- export class Action {
-
- clone(): Action;
-
- isDone(): boolean;
-
- getTarget(): Node;
-
- setTarget(target: Node): void;
-
- getOriginalTarget(): Node;
-
- getTag(): number;
-
- setTag(tag: number): void;
-
- static TAG_INVALID: number;
- }
-
- export class FiniteTimeAction extends Action {
-
- getDuration(): number;
-
- setDuration(duration: number): void;
-
- reverse(): void;
-
- clone(): FiniteTimeAction;
- }
-
- export class ActionInstant extends FiniteTimeAction {
- }
-
- export class ActionInterval extends FiniteTimeAction {
-
- easing(easeObj: any): ActionInterval;
-
- repeat(times: number): ActionInterval;
-
- repeatForever(): ActionInterval;
- }
-
- export class ActionManager {
-
- addAction(action: Action, target: Node, paused: boolean): void;
-
- removeAllActions(): void;
-
- removeAllActionsFromTarget(target: Node, forceDelete: boolean): void;
-
- removeAction(action: Action): void;
-
- removeActionByTag(tag: number, target: Node): void;
-
- getActionByTag(tag: number, target: Node): Action;
-
- getNumberOfRunningActionsInTarget(target: Node): number;
-
- pauseTarget(target: Node): void;
-
- resumeTarget(target: Node): void;
-
- pauseAllRunningActions(): any[];
-
- resumeTargets(targetsToResume: any[]): void;
-
- pauseTargets(targetsToPause: any[]): void;
-
- purgeSharedManager(): void;
-
- update(dt: number): void;
- }
-
- export class Tween {
-
- then(other: Action|Tween): Tween;
-
- target(target: any): Tween;
-
- start(): Tween;
-
- stop(): Tween;
-
- clone(target?: any): Tween;
-
- union(): Tween;
-
- to(duration: number, props: any, opts?: {progress?: Function; easing?: Function|string; }): Tween;
-
- by(duration: number, props: any, opts?: {progress?: Function; easing?: Function|string; }): Tween;
-
- set(props: any): Tween;
-
- delay(duration: number): Tween;
-
- call(callback: Function): Tween;
-
- hide(): Tween;
-
- show(): Tween;
-
- removeSelf(): Tween;
-
- sequence(action: Action|Tween, ...actions: (Action|Tween)[]): Tween;
-
- parallel(action: Action|Tween, ...actions: (Action|Tween)[]): Tween;
-
- repeat(repeatTimes: number, action?: Action|Tween): Tween;
-
- repeatForever(action?: Action|Tween): Tween;
-
- reverseTime(action?: Action|Tween): Tween;
- }
-
- export class VideoPlayer extends Component {
-
- resourceType: VideoPlayer.ResourceType;
-
- remoteURL: string;
-
- clip: string;
-
- currentTime: number;
-
- volume: number;
-
- mute: boolean;
-
- keepAspectRatio: boolean;
-
- isFullscreen: boolean;
-
- videoPlayerEvent: Component.EventHandler[];
-
- play(): void;
-
- resume(): void;
-
- pause(): void;
-
- stop(): void;
-
- getDuration(): number;
-
- isPlaying(): boolean;
-
- destroy(): boolean;
- }
-
- export class TiledLayer extends Component {
-
- enableCulling(value: any): void;
-
- addUserNode(node: Node): boolean;
-
- removeUserNode(node: Node): boolean;
-
- destroyUserNode(node: Node): void;
-
- getLayerName(): string;
-
- SetLayerName(layerName: string): void;
-
- getProperty(propertyName: string): any;
-
- getPositionAt(pos: Vec2|number, y?: number): Vec2;
-
- setTileGIDAt(gid: number, posOrX: Vec2|number, flagsOrY: number, flags?: number): void;
-
- getTileGIDAt(pos: Vec2|number, y?: number): number;
-
- getLayerOrientation(): number;
-
- getProperties(): any[];
-
- getTiledTileAt(x: number, y: number, forceCreate: boolean): TiledTile;
-
- setTiledTileAt(x: number, y: number, tiledTile: TiledTile): TiledTile;
-
- getTexture(index: any): Texture2D;
-
- getTextures(): Texture2D;
-
- setTexture(texture: Texture2D): void;
-
- setTexture(textures: Texture2D): void;
-
- getLayerSize(): Size;
-
- getMapTileSize(): Size;
-
- getTileSet(index: any): TMXTilesetInfo;
-
- getTileSet(): TMXTilesetInfo;
-
- setTileSet(tileset: TMXTilesetInfo): void;
-
- setTileSets(tilesets: TMXTilesetInfo): void;
- }
-
- export class TiledMap extends Component {
-
- tmxAsset: TiledMapAsset;
-
- getMapSize(): Size;
-
- getTileSize(): Size;
-
- getMapOrientation(): number;
-
- getObjectGroups(): TiledObjectGroup[];
-
- getObjectGroup(groupName: string): TiledObjectGroup;
-
- enableCulling(value: any): void;
-
- getProperties(): any[];
-
- getLayers(): TiledLayer[];
-
- getLayer(layerName: string): TiledLayer;
-
- getProperty(propertyName: string): string;
-
- getPropertiesForGID(GID: number): any;
- }
-
- export class TiledMapAsset extends Asset {
- textures: Texture2D[];
- textureNames: string[];
- imageLayerTextures: Texture2D[];
- imageLayerTextureNames: string[];
- }
-
- export class TiledObjectGroup extends Component {
-
- getPositionOffset(): Vec2;
-
- getProperties(): any;
-
- getGroupName(): string;
-
- getObject(objectName: string): any;
-
- getObjects(): any[];
- }
-
- export class TiledTile extends Component {
-
- x: number;
-
- y: number;
-
- gid: number;
- }
-
- export class WebView extends Component {
-
- url: string;
-
- webviewLoadedEvents: Component.EventHandler[];
-
- setJavascriptInterfaceScheme(scheme: string): void;
-
- setOnJSCallback(callback: Function): void;
-
- evaluateJS(str: string): void;
-
- destroy(): boolean;
- }
-
- export class NodePool {
-
- constructor(poolHandlerComp?: {prototype: Component}|string);
-
- poolHandlerComp: Function|string;
-
- size(): number;
-
- clear(): void;
-
- put(obj: Node): void;
-
- get(...params: any[]): Node;
- }
-
- export class Camera extends Component {
-
- zoomRatio: number;
-
- fov: number;
-
- orthoSize: number;
-
- nearClip: number;
-
- farClip: number;
-
- ortho: boolean;
-
- rect: Rect;
-
- cullingMask: number;
-
- clearFlags: Camera.ClearFlags;
-
- backgroundColor: Color;
-
- depth: number;
-
- targetTexture: RenderTexture;
-
- renderStages: number;
-
- alignWithScreen: boolean;
-
- static main: Camera;
-
- static cameras: Camera[];
-
- static findCamera(node: Node): Camera;
-
- getScreenToWorldMatrix2D(out: Mat4): Mat4;
-
- getWorldToScreenMatrix2D(out: Mat4): Mat4;
-
- getScreenToWorldPoint(screenPosition: Vec3|Vec2, out?: Vec3|Vec2): Vec3;
-
- getWorldToScreenPoint(worldPosition: Vec3|Vec2, out?: Vec3|Vec2): Vec3;
-
- getRay(screenPos: Vec2): Ray;
-
- containsNode(node: Node): boolean;
-
- render(root: Node): void;
-
- getNodeToCameraTransform(node: Node): AffineTransform;
-
- getCameraToWorldPoint(point: Vec2, out: Vec2): Vec2;
-
- getWorldToCameraPoint(point: Vec2, out: Vec2): Vec2;
-
- getCameraToWorldMatrix(out: Mat4): Mat4;
-
- getWorldToCameraMatrix(out: Mat4): Mat4;
- }
-
- export class Light extends Component {
- }
-
- export class BoxCollider extends Collider implements Collider.Box {
-
- offset: Vec2;
-
- size: Size;
- }
-
- export class CircleCollider extends Collider implements Collider.Circle {
-
- offset: Vec2;
-
- radius: number;
- }
-
- export class Collider extends Component {
-
- tag: number;
- }
-
- export class CollisionManager implements EventTarget {
-
- enabled: boolean;
-
- enabledDrawBoundingBox: boolean;
-
- enabledDebugDraw: boolean;
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class Intersection {
-
- static lineLine(a1: Vec2, a2: Vec2, b1: Vec2, b2: Vec2): boolean;
-
- static lineRect(a1: Vec2, a2: Vec2, b: Rect): boolean;
-
- static linePolygon(a1: Vec2, a2: Vec2, b: Vec2[]): boolean;
-
- static rectRect(a: Rect, b: Rect): boolean;
-
- static rectPolygon(a: Rect, b: Vec2[]): boolean;
-
- static polygonPolygon(a: Vec2[], b: Vec2[]): boolean;
-
- static circleCircle(a: {position: Vec2, radius: number}, b: {position: Vec2, radius: number}): boolean;
-
- static polygonCircle(polygon: Vec2[], circle: {position: Vec2, radius: number}): boolean;
-
- static pointInPolygon(point: Vec2, polygon: Vec2[]): boolean;
-
- static pointLineDistance(point: Vec2, start: Vec2, end: Vec2, isSegment: boolean): number;
- }
-
- export class PolygonCollider extends Collider implements Collider.Polygon {
-
- offset: Vec2;
-
- points: Vec2[];
- }
-
- export class EventTarget extends CallbacksInvoker {
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class Event {
-
- constructor(type: string, bubbles: boolean);
-
- type: string;
-
- bubbles: boolean;
-
- target: any;
-
- currentTarget: any;
-
- eventPhase: number;
-
- unuse(): string;
-
- reuse(): string;
-
- stopPropagation(): void;
-
- stopPropagationImmediate(): void;
-
- isStopped(): boolean;
-
- getCurrentTarget(): Node;
-
- getType(): string;
-
- static NO_TYPE: string;
-
- static TOUCH: string;
-
- static MOUSE: string;
-
- static KEYBOARD: string;
-
- static ACCELERATION: string;
-
- static NONE: number;
-
- static CAPTURING_PHASE: number;
-
- static AT_TARGET: number;
-
- static BUBBLING_PHASE: number;
- }
-
- export class SystemEvent extends EventTarget {
-
- setAccelerometerEnabled(isEnable: boolean): void;
-
- setAccelerometerInterval(interval: number): void;
- }
-
- export class Animation extends Component implements EventTarget {
-
- defaultClip: AnimationClip;
-
- currentClip: AnimationClip;
-
- playOnLoad: boolean;
-
- getClips(): AnimationClip[];
-
- play(name?: string, startTime?: number): AnimationState;
-
- playAdditive(name?: string, startTime?: number): AnimationState;
-
- stop(name?: string): void;
-
- pause(name?: string): void;
-
- resume(name?: string): void;
-
- setCurrentTime(time?: number, name?: string): void;
-
- getAnimationState(name: string): AnimationState;
-
- addClip(clip: AnimationClip, newName?: string): AnimationState;
-
- removeClip(clip: AnimationClip, force?: boolean): void;
-
- sample(name: string): void;
-
- on(type: string, callback: (event: Event.EventCustom) => void, target?: any, useCapture?: boolean): (event: Event.EventCustom) => void;
- on<T>(type: string, callback: (event: T) => void, target?: any, useCapture?: boolean): (event: T) => void;
-
- off(type: string, callback?: Function, target?: any, useCapture?: boolean): void;
-
- hasEventListener(type: string): boolean;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class AudioSource extends Component {
-
- isPlaying: boolean;
-
- clip: AudioClip;
-
- volume: number;
-
- mute: boolean;
-
- loop: boolean;
-
- playOnLoad: boolean;
-
- play(): void;
-
- stop(): void;
-
- pause(): void;
-
- resume(): void;
-
- rewind(): void;
-
- getCurrentTime(): number;
-
- setCurrentTime(time: number): number;
-
- getDuration(): number;
- }
-
- export class BlockInputEvents extends Component {
- }
-
- export class Button extends Component implements GraySpriteState {
-
- interactable: boolean;
-
- enableAutoGrayEffect: boolean;
-
- transition: Button.Transition;
-
- normalColor: Color;
-
- pressedColor: Color;
-
- hoverColor: Color;
-
- disabledColor: Color;
-
- duration: number;
-
- zoomScale: number;
-
- normalSprite: SpriteFrame;
-
- pressedSprite: SpriteFrame;
-
- hoverSprite: SpriteFrame;
-
- disabledSprite: SpriteFrame;
-
- target: Node;
-
- clickEvents: Component.EventHandler[];
- }
-
- export class Canvas extends Component {
-
- static instance: Canvas;
-
- designResolution: Size;
-
- fitHeight: boolean;
-
- fitWidth: boolean;
- }
-
- export class Component extends Object {
-
- node: Node;
-
- uuid: string;
-
- enabled: boolean;
-
- enabledInHierarchy: boolean;
-
- _isOnLoadCalled: number;
-
- protected update(dt: number): void;
-
- protected lateUpdate(): void;
-
- protected onLoad(): void;
-
- protected start(): void;
-
- protected onEnable(): void;
-
- protected onDisable(): void;
-
- protected onDestroy(): void;
- protected onFocusInEditor(): void;
- protected onLostFocusInEditor(): void;
-
- protected resetInEditor(): void;
-
- addComponent<T extends Component>(type: {new(): T}): T;
- addComponent(className: string): any;
-
- getComponent<T extends Component>(type: {prototype: T}): T;
- getComponent(className: string): any;
-
- getComponents<T extends Component>(type: {prototype: T}): T[];
- getComponents(className: string): any[];
-
- getComponentInChildren<T extends Component>(type: {prototype: T}): T;
- getComponentInChildren(className: string): any;
-
- getComponentsInChildren<T extends Component>(type: {prototype: T}): T[];
- getComponentsInChildren(className: string): any[];
-
- _getLocalBounds(out_rect: Rect): void;
-
- onRestore(): void;
-
- schedule(callback: Function, interval?: number, repeat?: number, delay?: number): void;
-
- scheduleOnce(callback: Function, delay?: number): void;
-
- unschedule(callback_fn: Function): void;
-
- unscheduleAllCallbacks(): void;
- }
-
- export class Label extends RenderComponent {
-
- string: string;
-
- horizontalAlign: Label.HorizontalAlign;
-
- verticalAlign: Label.VerticalAlign;
-
- actualFontSize: number;
-
- fontSize: number;
-
- fontFamily: string;
-
- lineHeight: number;
-
- overflow: Label.Overflow;
-
- enableWrapText: boolean;
-
- font: Font;
-
- useSystemFont: boolean;
-
- spacingX: number;
-
- cacheMode: Label.CacheMode;
-
- static clearCharCache(): void;
- }
-
- export class LabelOutline extends Component {
-
- color: Color;
-
- width: number;
- }
-
- export class LabelShadow extends Component {
-
- color: Color;
-
- offset: Vec2;
-
- blur: number;
- }
-
- export class Layout extends Component {
-
- type: Layout.Type;
-
- resizeMode: Layout.ResizeMode;
-
- cellSize: Size;
-
- startAxis: Layout.AxisDirection;
-
- paddingLeft: number;
-
- paddingRight: number;
-
- paddingTop: number;
-
- paddingBottom: number;
-
- spacingX: number;
-
- spacingY: number;
-
- verticalDirection: Layout.VerticalDirection;
-
- horizontalDirection: Layout.HorizontalDirection;
-
- affectedByScale: boolean;
-
- updateLayout(): void;
-
- padding: number;
- }
-
- export class Mask extends RenderComponent {
-
- type: Mask.Type;
-
- spriteFrame: SpriteFrame;
-
- alphaThreshold: number;
-
- inverted: boolean;
-
- segements: number;
- }
-
- export class MotionStreak extends Component implements BlendFunc {
-
- preview: boolean;
-
- fadeTime: number;
-
- minSeg: number;
-
- stroke: number;
-
- texture: Texture2D;
-
- color: Color;
-
- fastMode: boolean;
-
- reset(): void;
- }
-
- export class PageView extends ScrollView {
-
- sizeMode: PageView.SizeMode;
-
- direction: PageView.Direction;
-
- scrollThreshold: number;
-
- autoPageTurningThreshold: number;
-
- pageTurningEventTiming: number;
-
- indicator: PageViewIndicator;
-
- pageTurningSpeed: number;
-
- pageEvents: Component.EventHandler[];
-
- getCurrentPageIndex(): number;
-
- setCurrentPageIndex(index: number): void;
-
- getPages(): Node[];
-
- addPage(page: Node): void;
-
- insertPage(page: Node, index: number): void;
-
- removePage(page: Node): void;
-
- removePageAtIndex(index: number): void;
-
- removeAllPages(): void;
-
- scrollToPage(idx: number, timeInSecond: number): void;
- }
-
- export class PageViewIndicator extends Component {
-
- spriteFrame: SpriteFrame;
-
- direction: PageViewIndicator.Direction;
-
- cellSize: Size;
-
- spacing: number;
-
- setPageView(target: PageView): void;
- }
-
- export class ProgressBar extends Component {
-
- barSprite: Sprite;
-
- mode: ProgressBar.Mode;
-
- totalLength: number;
-
- progress: number;
-
- reverse: boolean;
- }
-
- export class RenderComponent extends Component {
-
- sharedMaterials: Material[];
-
- getMaterial(index: number): Material;
-
- setMaterial(index: number, material: Material): void;
- }
-
- export class RichText extends Component {
-
- string: string;
-
- horizontalAlign: macro.TextAlignment;
-
- fontSize: number;
-
- fontFamily: string;
-
- font: TTFFont;
-
- useSystemFont: boolean;
-
- maxWidth: number;
-
- lineHeight: number;
-
- imageAtlas: SpriteAtlas;
-
- handleTouchEvent: boolean;
- }
-
- export class Scrollbar extends Component {
-
- handle: Sprite;
-
- direction: Scrollbar.Direction;
-
- enableAutoHide: boolean;
-
- autoHideTime: number;
- }
-
- export class ScrollView extends Component {
-
- content: Node;
-
- horizontal: boolean;
-
- vertical: boolean;
-
- inertia: boolean;
-
- brake: number;
-
- elastic: boolean;
-
- bounceDuration: number;
-
- horizontalScrollBar: Scrollbar;
-
- verticalScrollBar: Scrollbar;
-
- scrollEvents: Component.EventHandler[];
-
- cancelInnerEvents: boolean;
-
- scrollToBottom(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToTop(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToLeft(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToRight(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToTopLeft(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToTopRight(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToBottomLeft(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToBottomRight(timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToOffset(offset: Vec2, timeInSecond?: number, attenuated?: boolean): void;
-
- getScrollOffset(): Vec2;
-
- getMaxScrollOffset(): Vec2;
-
- scrollToPercentHorizontal(percent: number, timeInSecond?: number, attenuated?: boolean): void;
-
- scrollTo(anchor: Vec2, timeInSecond?: number, attenuated?: boolean): void;
-
- scrollToPercentVertical(percent: number, timeInSecond?: number, attenuated?: boolean): void;
-
- stopAutoScroll(): void;
-
- setContentPosition(position: Vec2): void;
-
- getContentPosition(): Vec2;
-
- isScrolling(): boolean;
-
- isAutoScrolling(): boolean;
- }
-
- export class Slider extends Component {
-
- handle: Button;
-
- direction: Slider.Direction;
-
- progress: number;
-
- slideEvents: Component.EventHandler[];
- }
-
- export class Sprite extends RenderComponent implements BlendFunc {
-
- spriteFrame: SpriteFrame;
-
- type: Sprite.Type;
-
- fillType: Sprite.FillType;
-
- fillCenter: Vec2;
-
- fillStart: number;
-
- fillRange: number;
-
- trim: boolean;
-
- sizeMode: Sprite.SizeMode;
-
- setState(state: Sprite.State): void;
-
- getState(): Sprite.State;
- }
-
- export class Toggle extends Button implements GraySpriteState {
-
- isChecked: boolean;
-
- toggleGroup: ToggleGroup;
-
- checkMark: Sprite;
-
- checkEvents: Component.EventHandler[];
-
- check(): void;
-
- uncheck(): void;
- }
-
- export class ToggleContainer extends Component {
-
- allowSwitchOff: boolean;
-
- checkEvents: Component.EventHandler[];
-
- toggleItems: Toggle[];
- }
-
- export class ToggleGroup extends Component {
-
- allowSwitchOff: boolean;
-
- toggleItems: any[];
- }
-
- export class ViewGroup extends Component {
- }
-
- export class Widget extends Component {
-
- target: Node;
-
- isAlignTop: boolean;
-
- isAlignVerticalCenter: boolean;
-
- isAlignBottom: boolean;
-
- isAlignLeft: boolean;
-
- isAlignHorizontalCenter: boolean;
-
- isAlignRight: boolean;
-
- isStretchWidth: boolean;
-
- isStretchHeight: boolean;
-
- top: number;
-
- bottom: number;
-
- left: number;
-
- right: number;
-
- horizontalCenter: number;
-
- verticalCenter: number;
-
- isAbsoluteHorizontalCenter: boolean;
-
- isAbsoluteVerticalCenter: boolean;
-
- isAbsoluteTop: boolean;
-
- isAbsoluteBottom: boolean;
-
- isAbsoluteLeft: boolean;
-
- isAbsoluteRight: boolean;
-
- alignMode: Widget.AlignMode;
-
- updateAlignment(): void;
-
- isAlignOnce: boolean;
- }
-
- export class SwanSubContextView extends Component {
-
- updateSubContextViewport(): void;
- }
-
- export class WXSubContextView extends Component {
-
- reset(): void;
-
- updateSubContextViewport(): void;
- }
-
- export class Asset extends RawAsset {
-
- loaded: boolean;
-
- url: string;
-
- nativeUrl: string;
-
- static preventDeferredLoadDependents: boolean;
-
- static preventPreloadNativeObject: boolean;
-
- toString(): string;
-
- createNode(callback: (error: string, node: any) => void): void;
- }
-
- export class AudioClip extends Asset implements EventTarget {
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class BitmapFont extends Font {
- }
-
- export class BufferAsset extends Asset {
- }
-
- export class Font extends Asset {
- }
-
- export class JsonAsset extends Asset {
-
- json: any;
- }
-
- export class LabelAtlas extends BitmapFont {
- }
-
- export class Prefab extends Asset {
-
- data: Node;
-
- optimizationPolicy: Prefab.OptimizationPolicy;
-
- asyncLoadAssets: boolean;
- readonly: boolean;
-
- compileCreateFunction(): void;
- }
-
- export class RawAsset extends Object {
- }
-
- export class RenderTexture extends Texture2D {
-
- initWithSize(width?: number, height?: number, depthStencilFormat?: number): void;
-
- readPixels(data?: Uint8Array, x?: number, y?: number, w?: number, h?: number): Uint8Array;
- }
-
- export class SceneAsset extends Asset {
- scene: Scene;
-
- asyncLoadAssets: boolean;
- }
-
- export class _Script extends Asset {
- }
-
- export class _JavaScript extends Asset {
- }
-
- export class CoffeeScript extends Asset {
- }
-
- export class TypeScript extends Asset {
- }
-
- export class SpriteAtlas extends Asset {
-
- getTexture(): Texture2D;
-
- getSpriteFrame(key: string): SpriteFrame;
-
- getSpriteFrames(): SpriteFrame[];
- }
-
- export class SpriteFrame extends Asset implements EventTarget {
-
- insetTop: number;
-
- insetBottom: number;
-
- insetLeft: number;
-
- insetRight: number;
-
- constructor(filename?: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size);
-
- textureLoaded(): boolean;
-
- isRotated(): boolean;
-
- setRotated(bRotated: boolean): void;
-
- getRect(): Rect;
-
- setRect(rect: Rect): void;
-
- getOriginalSize(): Size;
-
- setOriginalSize(size: Size): void;
-
- getTexture(): Texture2D;
-
- getOffset(): Vec2;
-
- setOffset(offsets: Vec2): void;
-
- clone(): SpriteFrame;
-
- setTexture(textureOrTextureFile: string|Texture2D, rect?: Rect, rotated?: boolean, offset?: Vec2, originalSize?: Size): boolean;
-
- ensureLoadTexture(): void;
-
- clearTexture(): void;
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class TTFFont extends Font {
- }
-
- export class TextAsset extends Asset {
-
- text: string;
- }
-
- export class Texture2D extends Asset implements EventTarget {
-
- genMipmaps: boolean;
-
- packable: boolean;
-
- loaded: boolean;
-
- width: number;
-
- height: number;
-
- getImpl(): void;
-
- update(options: {image: DOMImageElement; genMipmaps: boolean; format: Texture2D.PixelFormat; minFilter: Texture2D.Filter; magFilter: Texture2D.Filter; wrapS: WrapMode; wrapT: WrapMode; premultiplyAlpha: boolean; }): void;
-
- initWithElement(element: HTMLImageElement|HTMLCanvasElement): void;
-
- initWithData(data: DataView, pixelFormat: number, pixelsWidth: number, pixelsHeight: number): boolean;
-
- getHtmlElementObj(): HTMLImageElement;
-
- destroy(): boolean;
-
- getPixelFormat(): number;
-
- hasPremultipliedAlpha(): boolean;
-
- handleLoadedTexture(premultiplied?: boolean): void;
-
- description(): string;
-
- releaseTexture(): void;
-
- setTexParameters(wrapS: Texture2D.WrapMode, wrapT: Texture2D.WrapMode): void;
-
- setFilters(minFilter: Texture2D.Filter, magFilter: Texture2D.Filter): void;
-
- setFlipY(flipY: boolean): void;
-
- setPremultiplyAlpha(premultiply: boolean): void;
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class Touch {
-
- getLocation(): Vec2;
-
- getLocationX(): number;
-
- getLocationY(): number;
-
- getPreviousLocation(): Vec2;
-
- getStartLocation(): Vec2;
-
- getDelta(): Vec2;
-
- getLocationInView(): Vec2;
-
- getPreviousLocationInView(): Vec2;
-
- getStartLocationInView(): Vec2;
-
- getID(): number;
-
- setTouchInfo(id: number, x: number, y: number): void;
- }
-
- export class Graphics extends RenderComponent {
-
- lineWidth: number;
-
- lineJoin: Graphics.LineJoin;
-
- lineCap: Graphics.LineCap;
-
- strokeColor: Color;
-
- fillColor: Color;
-
- miterLimit: number;
-
- moveTo(x?: number, y?: number): void;
-
- lineTo(x?: number, y?: number): void;
-
- bezierCurveTo(c1x?: number, c1y?: number, c2x?: number, c2y?: number, x?: number, y?: number): void;
-
- quadraticCurveTo(cx?: number, cy?: number, x?: number, y?: number): void;
-
- arc(cx?: number, cy?: number, r?: number, startAngle?: number, endAngle?: number, counterclockwise?: boolean): void;
-
- ellipse(cx?: number, cy?: number, rx?: number, ry?: number): void;
-
- circle(cx?: number, cy?: number, r?: number): void;
-
- rect(x?: number, y?: number, w?: number, h?: number): void;
-
- roundRect(x?: number, y?: number, w?: number, h?: number, r?: number): void;
-
- fillRect(x?: number, y?: number, w?: number, h?: number): void;
-
- clear(clean?: boolean): void;
-
- close(): void;
-
- stroke(): void;
-
- fill(): void;
- }
-
- export class Mesh extends Asset implements EventTarget {
-
- subMeshes: InputAssembler[];
-
- init(vertexFormat: gfx.VertexFormat, vertexCount: number, dynamic?: boolean, index?: boolean): void;
-
- setVertices(name: string, values: Vec2[]|Vec3[]|Color[]|number[]|Uint8Array|Float32Array): void;
-
- setIndices(indices: number[]|Uint16Array|Uint8Array, index?: number, dynamic?: boolean): void;
-
- setPrimitiveType(type: number, index: number): void;
-
- clear(): void;
-
- setBoundingBox(min: Vec3, max: Vec3): void;
-
- hasEventListener(type: string): boolean;
-
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
-
- off(type: string, callback?: Function, target?: any): void;
-
- targetOff(target: any): void;
-
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
-
- dispatchEvent(event: Event): void;
- }
-
- export class MeshRenderer extends RenderComponent {
-
- mesh: Mesh;
-
- receiveShadows: boolean;
-
- shadowCastingMode: MeshRenderer.ShadowCastingMode;
-
- enableAutoBatch: boolean;
- }
-
- export class loader extends Pipeline {
-
- static assetLoader: any;
-
- static md5Pipe: any;
-
- static downloader: any;
-
- static loader: any;
-
- static getXMLHttpRequest(): XMLHttpRequest;
-
- static addDownloadHandlers(extMap: any): void;
-
- static addLoadHandlers(extMap: any): void;
-
- static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, completeCallback?: Function): void;
- static load(resources: string|string[]|{uuid?: string, url?: string, type?: string}, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: Function|null): void;
-
- static loadRes(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void;
- static loadRes(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any) => void): void;
- static loadRes(url: string, type: typeof cc.Asset): void;
- static loadRes(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any) => void)|null): void;
- static loadRes(url: string, completeCallback: (error: Error, resource: any) => void): void;
- static loadRes(url: string): void;
- /**
- This method is like {{#crossLink "loader/loadRes:method"}}{{/crossLink}} except that it accepts array of url.
- @param urls Array of URLs of the target resource.
- The url is relative to the "resources" folder, extensions must be omitted.
- @param type Only asset of type will be loaded if this argument is supplied.
- @param progressCallback Callback invoked when progression change.
- @param completeCallback A callback which is called when all assets have been loaded, or an error occurs.
-
- @example
- ```js
- // load the SpriteFrames from resources folder
- var spriteFrames;
- var urls = ['misc/characters/character_01', 'misc/weapons/weapons_01'];
- cc.loader.loadResArray(urls, cc.SpriteFrame, function (err, assets) {
- if (err) {
- cc.error(err);
- return;
- }
- spriteFrames = assets;
-
- });
- ```
- */
- static loadResArray(url: string[], type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void;
- static loadResArray(url: string[], type: typeof cc.Asset, completeCallback: (error: Error, resource: any[]) => void): void;
- static loadResArray(url: string[], type: typeof cc.Asset): void;
- static loadResArray(url: string[], progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[]) => void)|null): void;
- static loadResArray(url: string[], completeCallback: (error: Error, resource: any[]) => void): void;
- static loadResArray(url: string[]): void;
- static loadResArray(url: string[], type: typeof cc.Asset[]): void;
- /**
- Load all assets in a folder inside the "assets/resources" folder of your project.<br>
- <br>
- Note: All asset URLs in Creator use forward slashes, URLs using backslashes will not work.
- @param url Url of the target folder.
- The url is relative to the "resources" folder, extensions must be omitted.
- @param type Only asset of type will be loaded if this argument is supplied.
- @param progressCallback Callback invoked when progression change.
- @param completeCallback A callback which is called when all assets have been loaded, or an error occurs.
-
- @example
- ```js
- // load the texture (resources/imgs/cocos.png) and the corresponding sprite frame
- cc.loader.loadResDir('imgs/cocos', function (err, assets) {
- if (err) {
- cc.error(err);
- return;
- }
- var texture = assets[0];
- var spriteFrame = assets[1];
- });
-
- // load all textures in "resources/imgs/"
- cc.loader.loadResDir('imgs', cc.Texture2D, function (err, textures) {
- var texture1 = textures[0];
- var texture2 = textures[1];
- });
-
- // load all JSONs in "resources/data/"
- cc.loader.loadResDir('data', function (err, objects, urls) {
- var data = objects[0];
- var url = urls[0];
- });
- ```
- */
- static loadResDir(url: string, type: typeof cc.Asset, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void;
- static loadResDir(url: string, type: typeof cc.Asset, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void;
- static loadResDir(url: string, type: typeof cc.Asset): void;
- static loadResDir(url: string, progressCallback: (completedCount: number, totalCount: number, item: any) => void, completeCallback: ((error: Error, resource: any[], urls: string[]) => void)|null): void;
- static loadResDir(url: string, completeCallback: (error: Error, resource: any[], urls: string[]) => void): void;
- static loadResDir(url: string): void;
- /**
- Get resource data by id. <br>
- When you load resources with {{#crossLink "loader/load:method"}}{{/crossLink}} or {{#crossLink "loader/loadRes:method"}}{{/crossLink}},
- the url will be the unique identity of the resource.
- After loaded, you can acquire them by passing the url to this API.
- @param url url
- @param type Only asset of type will be returned if this argument is supplied.
- */
- static getRes(url: string, type?: Function): any;
- /**
- !#en
- Get all resource dependencies of the loaded asset in an array, including itself.
- The owner parameter accept the following types: 1. The asset itself; 2. The resource url; 3. The asset's uuid.<br>
- The returned array stores the dependencies with their uuids, after retrieve dependencies,
- you can release them, access dependent assets by passing the uuid to {{#crossLink "loader/getRes:method"}}{{/crossLink}}, or other stuffs you want.<br>
- For release all dependencies of an asset, please refer to {{#crossLink "loader/release:method"}}{{/crossLink}}
- Here is some examples:
- !#zh
- 获取某个已经加载好的资源的所有依赖资源,包含它自身,并保存在数组中返回。owner 参数接收以下几种类型:1. 资源 asset 对象;2. 资源目录下的 url;3. 资源的 uuid。<br>
- 返回的数组将仅保存依赖资源的 uuid,获取这些 uuid 后,你可以从 loader 释放这些资源;通过 {{#crossLink "loader/getRes:method"}}{{/crossLink}} 获取某个资源或者进行其他你需要的操作。<br>
- 想要释放一个资源及其依赖资源,可以参考 {{#crossLink "loader/release:method"}}{{/crossLink}}。下面是一些示例代码:
- @param owner The owner asset or the resource url or the asset's uuid
-
- @example
- ```js
- // Release all dependencies of a loaded prefab
- var deps = cc.loader.getDependsRecursively(prefab);
- cc.loader.release(deps);
- // Retrieve all dependent textures
- var deps = cc.loader.getDependsRecursively('prefabs/sample');
- var textures = [];
- for (var i = 0; i < deps.length; ++i) {
- var item = cc.loader.getRes(deps[i]);
- if (item instanceof cc.Texture2D) {
- textures.push(item);
- }
- }
- ```
- */
- static getDependsRecursively(owner: Asset|RawAsset|string): any[];
- /**
- !#en
- Release the content of an asset or an array of assets by uuid.
- Start from v1.3, this method will not only remove the cache of the asset in loader, but also clean up its content.
- For example, if you release a texture, the texture asset and its gl texture data will be freed up.
- In complexe project, you can use this function with {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} to free up memory in critical circumstances.
- Notice, this method may cause the texture to be unusable, if there are still other nodes use the same texture, they may turn to black and report gl errors.
- If you only want to remove the cache of an asset, please use {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}}
- !#zh
- 通过 id(通常是资源 url)来释放一个资源或者一个资源数组。
- 从 v1.3 开始,这个方法不仅会从 loader 中删除资源的缓存引用,还会清理它的资源内容。
- 比如说,当你释放一个 texture 资源,这个 texture 和它的 gl 贴图数据都会被释放。
- 在复杂项目中,我们建议你结合 {{#crossLink "loader/getDependsRecursively:method"}}{{/crossLink}} 来使用,便于在设备内存告急的情况下更快地释放不再需要的资源的内存。
- 注意,这个函数可能会导致资源贴图或资源所依赖的贴图不可用,如果场景中存在节点仍然依赖同样的贴图,它们可能会变黑并报 GL 错误。
- 如果你只想删除一个资源的缓存引用,请使用 {{#crossLink "pipeline/removeItem:method"}}{{/crossLink}}
- @param asset asset
-
- @example
- ```js
- // Release a texture which is no longer need
- cc.loader.release(texture);
- // Release all dependencies of a loaded prefab
- var deps = cc.loader.getDependsRecursively('prefabs/sample');
- cc.loader.release(deps);
- // If there is no instance of this prefab in the scene, the prefab and its dependencies like textures, sprite frames, etc, will be freed up.
- // If you have some other nodes share a texture in this prefab, you can skip it in two ways:
- // 1. Forbid auto release a texture before release
- cc.loader.setAutoRelease(texture2d, false);
- // 2. Remove it from the dependencies array
- var deps = cc.loader.getDependsRecursively('prefabs/sample');
- var index = deps.indexOf(texture2d._uuid);
- if (index !== -1)
- deps.splice(index, 1);
- cc.loader.release(deps);
- ```
- */
- static release(asset: Asset|RawAsset|string|any[]): void;
- /**
- !#en Release the asset by its object. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations.
- !#zh 通过资源对象自身来释放资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}}
- @param asset asset
- */
- static releaseAsset(asset: Asset): void;
- /**
- !#en Release the asset loaded by {{#crossLink "loader/loadRes:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations.
- !#zh 释放通过 {{#crossLink "loader/loadRes:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}}
- @param url url
- @param type Only asset of type will be released if this argument is supplied.
- */
- static releaseRes(url: string, type?: Function): void;
- /**
- !#en Release the all assets loaded by {{#crossLink "loader/loadResDir:method"}}{{/crossLink}}. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations.
- !#zh 释放通过 {{#crossLink "loader/loadResDir:method"}}{{/crossLink}} 加载的资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}}
- @param url url
- @param type Only asset of type will be released if this argument is supplied.
- */
- static releaseResDir(url: string, type?: Function): void;
- /**
- !#en Resource all assets. Refer to {{#crossLink "loader/release:method"}}{{/crossLink}} for detailed informations.
- !#zh 释放所有资源。详细信息请参考 {{#crossLink "loader/release:method"}}{{/crossLink}}
- */
- static releaseAll(): void;
- /**
- !#en
- Indicates whether to release the asset when loading a new scene.<br>
- By default, when loading a new scene, all assets in the previous scene will be released or preserved
- according to whether the previous scene checked the "Auto Release Assets" option.
- On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir`
- will not be affected by that option, remain not released by default.<br>
- Use this API to change the default behavior on a single asset, to force preserve or release specified asset when scene switching.<br>
- <br>
- See: {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}}
- !#zh
- 设置当场景切换时是否自动释放资源。<br>
- 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。
- 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。<br>
- 使用这个 API 可以在单个资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。<br>
- <br>
- 参考:{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}}
- @param assetOrUrlOrUuid asset object or the raw asset's url or uuid
- @param autoRelease indicates whether should release automatically
-
- @example
- ```js
- // auto release the texture event if "Auto Release Assets" disabled in current scene
- cc.loader.setAutoRelease(texture2d, true);
- // don't release the texture even if "Auto Release Assets" enabled in current scene
- cc.loader.setAutoRelease(texture2d, false);
- // first parameter can be url
- cc.loader.setAutoRelease(audioUrl, false);
- ```
- */
- static setAutoRelease(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void;
- /**
- !#en
- Indicates whether to release the asset and its referenced other assets when loading a new scene.<br>
- By default, when loading a new scene, all assets in the previous scene will be released or preserved
- according to whether the previous scene checked the "Auto Release Assets" option.
- On the other hand, assets dynamically loaded by using `cc.loader.loadRes` or `cc.loader.loadResDir`
- will not be affected by that option, remain not released by default.<br>
- Use this API to change the default behavior on the specified asset and its recursively referenced assets, to force preserve or release specified asset when scene switching.<br>
- <br>
- See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}}
- !#zh
- 设置当场景切换时是否自动释放资源及资源引用的其它资源。<br>
- 默认情况下,当加载新场景时,旧场景的资源根据旧场景是否勾选“Auto Release Assets”,将会被释放或者保留。
- 而使用 `cc.loader.loadRes` 或 `cc.loader.loadResDir` 动态加载的资源,则不受场景设置的影响,默认不自动释放。<br>
- 使用这个 API 可以在指定资源及资源递归引用到的所有资源上改变这个默认行为,强制在切换场景时保留或者释放指定资源。<br>
- <br>
- 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/isAutoRelease:method"}}cc.loader.isAutoRelease{{/crossLink}}
- @param assetOrUrlOrUuid asset object or the raw asset's url or uuid
- @param autoRelease indicates whether should release automatically
-
- @example
- ```js
- // auto release the SpriteFrame and its Texture event if "Auto Release Assets" disabled in current scene
- cc.loader.setAutoReleaseRecursively(spriteFrame, true);
- // don't release the SpriteFrame and its Texture even if "Auto Release Assets" enabled in current scene
- cc.loader.setAutoReleaseRecursively(spriteFrame, false);
- // don't release the Prefab and all the referenced assets
- cc.loader.setAutoReleaseRecursively(prefab, false);
- ```
- */
- static setAutoReleaseRecursively(assetOrUrlOrUuid: Asset|string, autoRelease: boolean): void;
- /**
- !#en
- Returns whether the asset is configured as auto released, despite how "Auto Release Assets" property is set on scene asset.<br>
- <br>
- See: {{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}}, {{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}}
-
- !#zh
- 返回指定的资源是否有被设置为自动释放,不论场景的“Auto Release Assets”如何设置。<br>
- <br>
- 参考:{{#crossLink "loader/setAutoRelease:method"}}cc.loader.setAutoRelease{{/crossLink}},{{#crossLink "loader/setAutoReleaseRecursively:method"}}cc.loader.setAutoReleaseRecursively{{/crossLink}}
- @param assetOrUrl asset object or the raw asset's url
- */
- static isAutoRelease(assetOrUrl: Asset|string): boolean;
- }
- /** !#en
- LoadingItems is the queue of items which can flow them into the loading pipeline.<br/>
- Please don't construct it directly, use {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} instead, because we use an internal pool to recycle the queues.<br/>
- It hold a map of items, each entry in the map is a url to object key value pair.<br/>
- Each item always contains the following property:<br/>
- - id: The identification of the item, usually it's identical to url<br/>
- - url: The url <br/>
- - type: The type, it's the extension name of the url by default, could be specified manually too.<br/>
- - error: The error happened in pipeline will be stored in this property.<br/>
- - content: The content processed by the pipeline, the final result will also be stored in this property.<br/>
- - complete: The flag indicate whether the item is completed by the pipeline.<br/>
- - states: An object stores the states of each pipe the item go through, the state can be: Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE<br/>
- <br/>
- Item can hold other custom properties.<br/>
- Each LoadingItems object will be destroyed for recycle after onComplete callback<br/>
- So please don't hold its reference for later usage, you can copy properties in it though.
- !#zh
- LoadingItems 是一个加载对象队列,可以用来输送加载对象到加载管线中。<br/>
- 请不要直接使用 new 构造这个类的对象,你可以使用 {{#crossLink "LoadingItems.create"}}cc.LoadingItems.create{{/crossLink}} 来创建一个新的加载队列,这样可以允许我们的内部对象池回收并重利用加载队列。
- 它有一个 map 属性用来存放加载项,在 map 对象中以 url 为 key 值。<br/>
- 每个对象都会包含下列属性:<br/>
- - id:该对象的标识,通常与 url 相同。<br/>
- - url:路径 <br/>
- - type: 类型,它这是默认的 URL 的扩展名,可以手动指定赋值。<br/>
- - error:pipeline 中发生的错误将被保存在这个属性中。<br/>
- - content: pipeline 中处理的临时结果,最终的结果也将被存储在这个属性中。<br/>
- - complete:该标志表明该对象是否通过 pipeline 完成。<br/>
- - states:该对象存储每个管道中对象经历的状态,状态可以是 Pipeline.ItemState.WORKING | Pipeline.ItemState.ERROR | Pipeline.ItemState.COMPLETE<br/>
- <br/>
- 对象可容纳其他自定义属性。<br/>
- 每个 LoadingItems 对象都会在 onComplete 回调之后被销毁,所以请不要持有它的引用并在结束回调之后依赖它的内容执行任何逻辑,有这种需求的话你可以提前复制它的内容。 */
- export class LoadingItems extends CallbacksInvoker {
- /**
- !#en This is a callback which will be invoked while an item flow out the pipeline.
- You can pass the callback function in LoadingItems.create or set it later.
- !#zh 这个回调函数将在 item 加载结束后被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。
- @param completedCount The number of the items that are already completed.
- @param totalCount The total number of the items.
- @param item The latest item which flow out the pipeline.
-
- @example
- ```js
- loadingItems.onProgress = function (completedCount, totalCount, item) {
- var progress = (100 * completedCount / totalCount).toFixed(2);
- cc.log(progress + '%');
- }
- ```
- */
- onProgress(completedCount: number, totalCount: number, item: any): void;
- /**
- !#en This is a callback which will be invoked while all items is completed,
- You can pass the callback function in LoadingItems.create or set it later.
- !#zh 该函数将在加载队列全部完成时被调用。你可以在构造时传递这个回调函数或者是在构造之后直接设置。
- @param errors All errored urls will be stored in this array, if no error happened, then it will be null
- @param items All items.
-
- @example
- ```js
- loadingItems.onComplete = function (errors, items) {
- if (error)
- cc.log('Completed with ' + errors.length + ' errors');
- else
- cc.log('Completed ' + items.totalCount + ' items');
- }
- ```
- */
- onComplete(errors: any[], items: LoadingItems): void;
- /** !#en The map of all items.
- !#zh 存储所有加载项的对象。 */
- map: any;
- /** !#en The map of completed items.
- !#zh 存储已经完成的加载项。 */
- completed: any;
- /** !#en Total count of all items.
- !#zh 所有加载项的总数。 */
- totalCount: number;
- /** !#en Total count of completed items.
- !#zh 所有完成加载项的总数。 */
- completedCount: number;
- /** !#en Activated or not.
- !#zh 是否启用。 */
- active: boolean;
- /**
- !#en The constructor function of LoadingItems, this will use recycled LoadingItems in the internal pool if possible.
- You can pass onProgress and onComplete callbacks to visualize the loading process.
- !#zh LoadingItems 的构造函数,这种构造方式会重用内部对象缓冲池中的 LoadingItems 队列,以尽量避免对象创建。
- 你可以传递 onProgress 和 onComplete 回调函数来获知加载进度信息。
- @param pipeline The pipeline to process the queue.
- @param urlList The items array.
- @param onProgress The progression callback, refer to {{#crossLink "LoadingItems.onProgress"}}{{/crossLink}}
- @param onComplete The completion callback, refer to {{#crossLink "LoadingItems.onComplete"}}{{/crossLink}}
-
- @example
- ```js
- cc.LoadingItems.create(cc.loader, ['a.png', 'b.plist'], function (completedCount, totalCount, item) {
- var progress = (100 * completedCount / totalCount).toFixed(2);
- cc.log(progress + '%');
- }, function (errors, items) {
- if (errors) {
- for (var i = 0; i < errors.length; ++i) {
- cc.log('Error url: ' + errors[i] + ', error: ' + items.getError(errors[i]));
- }
- }
- else {
- var result_a = items.getContent('a.png');
-
- }
- })
- ```
- */
- static create(pipeline: Pipeline, urlList: any[], onProgress: Function, onComplete: Function): LoadingItems;
- /**
- !#en Retrieve the LoadingItems queue object for an item.
- !#zh 通过 item 对象获取它的 LoadingItems 队列。
- @param item The item to query
- */
- static getQueue(item: any): LoadingItems;
- /**
- !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening.
- !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。
- @param item The item which has completed
- */
- static itemComplete(item: any): void;
- /**
- !#en Add urls to the LoadingItems queue.
- !#zh 向一个 LoadingItems 队列添加加载项。
- @param urlList The url list to be appended, the url can be object or string
- */
- append(urlList: any[]): any[];
- /**
- !#en Complete a LoadingItems queue, please do not call this method unless you know what's happening.
- !#zh 完成一个 LoadingItems 队列,请不要调用这个函数,除非你知道自己在做什么。
- */
- allComplete(): void;
- /**
- !#en Check whether all items are completed.
- !#zh 检查是否所有加载项都已经完成。
- */
- isCompleted(): boolean;
- /**
- !#en Check whether an item is completed.
- !#zh 通过 id 检查指定加载项是否已经加载完成。
- @param id The item's id.
- */
- isItemCompleted(id: string): boolean;
- /**
- !#en Check whether an item exists.
- !#zh 通过 id 检查加载项是否存在。
- @param id The item's id.
- */
- exists(id: string): boolean;
- /**
- !#en Returns the content of an internal item.
- !#zh 通过 id 获取指定对象的内容。
- @param id The item's id.
- */
- getContent(id: string): any;
- /**
- !#en Returns the error of an internal item.
- !#zh 通过 id 获取指定对象的错误信息。
- @param id The item's id.
- */
- getError(id: string): any;
- /**
- !#en Add a listener for an item, the callback will be invoked when the item is completed.
- !#zh 监听加载项(通过 key 指定)的完成事件。
- @param key key
- @param callback can be null
- @param target can be null
- */
- addListener(key: string, callback: Function, target: any): boolean;
- /**
- !#en
- Check if the specified key has any registered callback.
- If a callback is also specified, it will only return true if the callback is registered.
- !#zh
- 检查指定的加载项是否有完成事件监听器。
- 如果同时还指定了一个回调方法,并且回调有注册,它只会返回 true。
- @param key key
- @param callback callback
- @param target target
- */
- hasListener(key: string, callback?: Function, target?: any): boolean;
- /**
- !#en
- Removes a listener.
- It will only remove when key, callback, target all match correctly.
- !#zh
- 移除指定加载项已经注册的完成事件监听器。
- 只会删除 key, callback, target 均匹配的监听器。
- @param key key
- @param callback callback
- @param target target
- */
- remove(key: string, callback: Function, target: any): boolean;
- /**
- !#en
- Removes all callbacks registered in a certain event
- type or all callbacks registered with a certain target.
- !#zh 删除指定目标的所有完成事件监听器。
- @param key The event key to be removed or the target to be removed
- */
- removeAllListeners(key: string|any): void;
- /**
- !#en Complete an item in the LoadingItems queue, please do not call this method unless you know what's happening.
- !#zh 通知 LoadingItems 队列一个 item 对象已完成,请不要调用这个函数,除非你知道自己在做什么。
- @param id The item url
- */
- itemComplete(id: string): void;
- /**
- !#en Destroy the LoadingItems queue, the queue object won't be garbage collected, it will be recycled, so every after destroy is not reliable.
- !#zh 销毁一个 LoadingItems 队列,这个队列对象会被内部缓冲池回收,所以销毁后的所有内部信息都是不可依赖的。
- */
- destroy(): void;
- }
- /** !#en
- A pipeline describes a sequence of manipulations, each manipulation is called a pipe.<br/>
- It's designed for loading process. so items should be urls, and the url will be the identity of each item during the process.<br/>
- A list of items can flow in the pipeline and it will output the results of all pipes.<br/>
- They flow in the pipeline like water in tubes, they go through pipe by pipe separately.<br/>
- Finally all items will flow out the pipeline and the process is finished.
-
- !#zh
- pipeline 描述了一系列的操作,每个操作都被称为 pipe。<br/>
- 它被设计来做加载过程的流程管理。所以 item 应该是 url,并且该 url 将是在处理中的每个 item 的身份标识。<br/>
- 一个 item 列表可以在 pipeline 中流动,它将输出加载项经过所有 pipe 之后的结果。<br/>
- 它们穿过 pipeline 就像水在管子里流动,将会按顺序流过每个 pipe。<br/>
- 最后当所有加载项都流出 pipeline 时,整个加载流程就结束了。 */
- export class Pipeline {
- /**
- !#en
- Constructor, pass an array of pipes to construct a new Pipeline,
- the pipes will be chained in the given order.<br/>
- A pipe is an object which must contain an `id` in string and a `handle` function,
- the id must be unique in the pipeline.<br/>
- It can also include `async` property to identify whether it's an asynchronous process.
- !#zh
- 构造函数,通过一系列的 pipe 来构造一个新的 pipeline,pipes 将会在给定的顺序中被锁定。<br/>
- 一个 pipe 就是一个对象,它包含了字符串类型的 ‘id’ 和 ‘handle’ 函数,在 pipeline 中 id 必须是唯一的。<br/>
- 它还可以包括 ‘async’ 属性以确定它是否是一个异步过程。
- @param pipes pipes
-
- @example
- ```js
- var pipeline = new Pipeline([
- {
- id: 'Downloader',
- handle: function (item, callback) {},
- async: true
- },
- {id: 'Parser', handle: function (item) {}, async: false}
- ]);
- ```
- */
- constructor(pipes: any[]);
- /**
- !#en
- Insert a new pipe at the given index of the pipeline. <br/>
- A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline.
- !#zh
- 在给定的索引位置插入一个新的 pipe。<br/>
- 一个 pipe 必须包含一个字符串类型的 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。
- @param pipe The pipe to be inserted
- @param index The index to insert
- */
- insertPipe(pipe: any, index: number): void;
- /**
- !en
- Insert a pipe to the end of an existing pipe. The existing pipe must be a valid pipe in the pipeline.
- !zh
- 在当前 pipeline 的一个已知 pipe 后面插入一个新的 pipe。
- @param refPipe An existing pipe in the pipeline.
- @param newPipe The pipe to be inserted.
- */
- insertPipeAfter(refPipe: any, newPipe: any): void;
- /**
- !#en
- Add a new pipe at the end of the pipeline. <br/>
- A pipe must contain an `id` in string and a `handle` function, the id must be unique in the pipeline.
- !#zh
- 添加一个新的 pipe 到 pipeline 尾部。 <br/>
- 该 pipe 必须包含一个字符串类型 ‘id’ 和 ‘handle’ 函数,该 id 在 pipeline 必须是唯一标识。
- @param pipe The pipe to be appended
- */
- appendPipe(pipe: any): void;
- /**
- !#en
- Let new items flow into the pipeline. <br/>
- Each item can be a simple url string or an object,
- if it's an object, it must contain `id` property. <br/>
- You can specify its type by `type` property, by default, the type is the extension name in url. <br/>
- By adding a `skips` property including pipe ids, you can skip these pipe. <br/>
- The object can contain any supplementary property as you want. <br/>
- !#zh
- 让新的 item 流入 pipeline 中。<br/>
- 这里的每个 item 可以是一个简单字符串类型的 url 或者是一个对象,
- 如果它是一个对象的话,他必须要包含 ‘id’ 属性。<br/>
- 你也可以指定它的 ‘type’ 属性类型,默认情况下,该类型是 ‘url’ 的后缀名。<br/>
- 也通过添加一个 包含 ‘skips’ 属性的 item 对象,你就可以跳过 skips 中包含的 pipe。<br/>
- 该对象可以包含任何附加属性。
- @param items items
-
- @example
- ```js
- pipeline.flowIn([
- 'res/Background.png',
- {
- id: 'res/scene.json',
- type: 'scene',
- name: 'scene',
- skips: ['Downloader']
- }
- ]);
- ```
- */
- flowIn(items: any[]): void;
- /**
- !#en
- Copy the item states from one source item to all destination items. <br/>
- It's quite useful when a pipe generate new items from one source item,<br/>
- then you should flowIn these generated items into pipeline, <br/>
- but you probably want them to skip all pipes the source item already go through,<br/>
- you can achieve it with this API. <br/>
- <br/>
- For example, an unzip pipe will generate more items, but you won't want them to pass unzip or download pipe again.
- !#zh
- 从一个源 item 向所有目标 item 复制它的 pipe 状态,用于避免重复通过部分 pipe。<br/>
- 当一个源 item 生成了一系列新的 items 时很有用,<br/>
- 你希望让这些新的依赖项进入 pipeline,但是又不希望它们通过源 item 已经经过的 pipe,<br/>
- 但是你可能希望他们源 item 已经通过并跳过所有 pipes,<br/>
- 这个时候就可以使用这个 API。
- @param srcItem The source item
- @param dstItems A single destination item or an array of destination items
- */
- copyItemStates(srcItem: any, dstItems: any[]|any): void;
- /**
- !#en Returns an item in pipeline.
- !#zh 根据 id 获取一个 item
- @param id The id of the item
- */
- getItem(id: any): any;
- /**
- !#en Removes an completed item in pipeline.
- It will only remove the cache in the pipeline or loader, its dependencies won't be released.
- cc.loader provided another method to completely cleanup the resource and its dependencies,
- please refer to {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}}
- !#zh 移除指定的已完成 item。
- 这将仅仅从 pipeline 或者 loader 中删除其缓存,并不会释放它所依赖的资源。
- cc.loader 中提供了另一种删除资源及其依赖的清理方法,请参考 {{#crossLink "loader/release:method"}}cc.loader.release{{/crossLink}}
- @param id The id of the item
- */
- removeItem(id: any): boolean;
- /**
- !#en Clear the current pipeline, this function will clean up the items.
- !#zh 清空当前 pipeline,该函数将清理 items。
- */
- clear(): void;
- }
- /** undefined */
- export class WorldManifold {
- /** !#en
- world contact point (point of intersection)
- !#zh
- 碰撞点集合 */
- points: Vec2[];
- /** !#en
- world vector pointing from A to B
- !#zh
- 世界坐标系下由 A 指向 B 的向量 */
- normal: Vec2;
- }
- /** !#en
- A manifold point is a contact point belonging to a contact manifold.
- It holds details related to the geometry and dynamics of the contact points.
- Note: the impulses are used for internal caching and may not
- provide reliable contact forces, especially for high speed collisions.
- !#zh
- ManifoldPoint 是接触信息中的接触点信息。它拥有关于几何和接触点的详细信息。
- 注意:信息中的冲量用于系统内部缓存,提供的接触力可能不是很准确,特别是高速移动中的碰撞信息。 */
- export class ManifoldPoint {
- /** !#en
- The local point usage depends on the manifold type:
- -e_circles: the local center of circleB
- -e_faceA: the local center of circleB or the clip point of polygonB
- -e_faceB: the clip point of polygonA
- !#zh
- 本地坐标点的用途取决于 manifold 的类型
- - e_circles: circleB 的本地中心点
- - e_faceA: circleB 的本地中心点 或者是 polygonB 的截取点
- - e_faceB: polygonB 的截取点 */
- localPoint: Vec2;
- /** !#en
- Normal impulse.
- !#zh
- 法线冲量。 */
- normalImpulse: number;
- /** !#en
- Tangent impulse.
- !#zh
- 切线冲量。 */
- tangentImpulse: number;
- }
- /** undefined */
- export class Manifold {
- /** !#en
- Manifold type : 0: e_circles, 1: e_faceA, 2: e_faceB
- !#zh
- Manifold 类型 : 0: e_circles, 1: e_faceA, 2: e_faceB */
- type: number;
- /** !#en
- The local point usage depends on the manifold type:
- -e_circles: the local center of circleA
- -e_faceA: the center of faceA
- -e_faceB: the center of faceB
- !#zh
- 用途取决于 manifold 类型
- -e_circles: circleA 的本地中心点
- -e_faceA: faceA 的本地中心点
- -e_faceB: faceB 的本地中心点 */
- localPoint: Vec2;
- /** !#en
- -e_circles: not used
- -e_faceA: the normal on polygonA
- -e_faceB: the normal on polygonB
- !#zh
- -e_circles: 没被使用到
- -e_faceA: polygonA 的法向量
- -e_faceB: polygonB 的法向量 */
- localNormal: Vec2;
- /** !#en
- the points of contact.
- !#zh
- 接触点信息。 */
- points: ManifoldPoint[];
- }
- /** !#en
- Contact impulses for reporting.
- !#zh
- 用于返回给回调的接触冲量。 */
- export class PhysicsImpulse {
- /** !#en
- Normal impulses.
- !#zh
- 法线方向的冲量 */
- normalImpulses: any;
- /** !#en
- Tangent impulses
- !#zh
- 切线方向的冲量 */
- tangentImpulses: any;
- }
- /** !#en
- PhysicsContact will be generated during begin and end collision as a parameter of the collision callback.
- Note that contacts will be reused for speed up cpu time, so do not cache anything in the contact.
- !#zh
- 物理接触会在开始和结束碰撞之间生成,并作为参数传入到碰撞回调函数中。
- 注意:传入的物理接触会被系统进行重用,所以不要在使用中缓存里面的任何信息。 */
- export class PhysicsContact {
- /**
- !#en
- Get the world manifold.
- !#zh
- 获取世界坐标系下的碰撞信息。
- */
- getWorldManifold(): WorldManifold;
- /**
- !#en
- Get the manifold.
- !#zh
- 获取本地(局部)坐标系下的碰撞信息。
- */
- getManifold(): Manifold;
- /**
- !#en
- Get the impulses.
- Note: PhysicsImpulse can only used in onPostSolve callback.
- !#zh
- 获取冲量信息
- 注意:这个信息只有在 onPostSolve 回调中才能获取到
- */
- getImpulse(): PhysicsImpulse;
- colliderA: Collider;
- colliderB: Collider;
- /** !#en
- If set disabled to true, the contact will be ignored until contact end.
- If you just want to disabled contact for current time step or sub-step, please use disabledOnce.
- !#zh
- 如果 disabled 被设置为 true,那么直到接触结束此接触都将被忽略。
- 如果只是希望在当前时间步或子步中忽略此接触,请使用 disabledOnce 。 */
- disabled: boolean;
- /** !#en
- Disabled contact for current time step or sub-step.
- !#zh
- 在当前时间步或子步中忽略此接触。 */
- disabledOnce: boolean;
- /**
- !#en
- Is this contact touching?
- !#zh
- 返回碰撞体是否已经接触到。
- */
- isTouching(): boolean;
- /**
- !#en
- Set the desired tangent speed for a conveyor belt behavior.
- !#zh
- 为传送带设置期望的切线速度
- @param tangentSpeed tangentSpeed
- */
- setTangentSpeed(tangentSpeed: number): void;
- /**
- !#en
- Get the desired tangent speed.
- !#zh
- 获取切线速度
- */
- getTangentSpeed(): number;
- /**
- !#en
- Override the default friction mixture. You can call this in onPreSolve callback.
- !#zh
- 覆盖默认的摩擦力系数。你可以在 onPreSolve 回调中调用此函数。
- @param friction friction
- */
- setFriction(friction: number): void;
- /**
- !#en
- Get the friction.
- !#zh
- 获取当前摩擦力系数
- */
- getFriction(): number;
- /**
- !#en
- Reset the friction mixture to the default value.
- !#zh
- 重置摩擦力系数到默认值
- */
- resetFriction(): void;
- /**
- !#en
- Override the default restitution mixture. You can call this in onPreSolve callback.
- !#zh
- 覆盖默认的恢复系数。你可以在 onPreSolve 回调中调用此函数。
- @param restitution restitution
- */
- setRestitution(restitution: number): void;
- /**
- !#en
- Get the restitution.
- !#zh
- 获取当前恢复系数
- */
- getRestitution(): number;
- /**
- !#en
- Reset the restitution mixture to the default value.
- !#zh
- 重置恢复系数到默认值
- */
- resetRestitution(): void;
- }
- /** !#en
- Physics manager uses box2d as the inner physics system, and hide most box2d implement details(creating rigidbody, synchronize rigidbody info to node).
- You can visit some common box2d function through physics manager(hit testing, raycast, debug info).
- Physics manager distributes the collision information to each collision callback when collision is produced.
- Note: You need first enable the collision listener in the rigidbody.
- !#zh
- 物理系统将 box2d 作为内部物理系统,并且隐藏了大部分 box2d 实现细节(比如创建刚体,同步刚体信息到节点中等)。
- 你可以通过物理系统访问一些 box2d 常用的功能,比如点击测试,射线测试,设置测试信息等。
- 物理系统还管理碰撞信息的分发,她会在产生碰撞时,将碰撞信息分发到各个碰撞回调中。
- 注意:你需要先在刚体中开启碰撞接听才会产生相应的碰撞回调。<br>
- 支持的物理系统指定绘制信息事件,请参阅 {{#crossLink "PhysicsManager.DrawBits"}}{{/crossLink}} */
- export class PhysicsManager implements EventTarget {
- /** !#en
- The ratio transform between physics unit and pixel unit, generally is 32.
- !#zh
- 物理单位与像素单位互相转换的比率,一般是 32。 */
- static PTM_RATIO: number;
- /** !#en
- The velocity iterations for the velocity constraint solver.
- !#zh
- 速度更新迭代数 */
- static VELOCITY_ITERATIONS: number;
- /** !#en
- The position Iterations for the position constraint solver.
- !#zh
- 位置迭代更新数 */
- static POSITION_ITERATIONS: number;
- /** !#en
- Specify the fixed time step.
- Need enabledAccumulator to make it work.
- !#zh
- 指定固定的物理更新间隔时间,需要开启 enabledAccumulator 才有效。 */
- static FIXED_TIME_STEP: number;
- /** !#en
- Specify the max accumulator time.
- Need enabledAccumulator to make it work.
- !#zh
- 每次可用于更新物理系统的最大时间,需要开启 enabledAccumulator 才有效。 */
- static MAX_ACCUMULATOR: number;
- /** !#en
- If enabled accumulator, then will call step function with the fixed time step FIXED_TIME_STEP.
- And if the update dt is bigger than the time step, then will call step function several times.
- If disabled accumulator, then will call step function with a time step calculated with the frame rate.
- !#zh
- 如果开启此选项,那么将会以固定的间隔时间 FIXED_TIME_STEP 来更新物理引擎,如果一个 update 的间隔时间大于 FIXED_TIME_STEP,则会对物理引擎进行多次更新。
- 如果关闭此选项,那么将会根据设定的 frame rate 计算出一个间隔时间来更新物理引擎。 */
- enabledAccumulator: boolean;
- /**
- !#en
- Test which collider contains the given world point
- !#zh
- 获取包含给定世界坐标系点的碰撞体
- @param point the world point
- */
- testPoint(point: Vec2): PhysicsCollider;
- /**
- !#en
- Test which colliders intersect the given world rect
- !#zh
- 获取与给定世界坐标系矩形相交的碰撞体
- @param rect the world rect
- */
- testAABB(rect: Rect): PhysicsCollider[];
- /**
- !#en
- Raycast the world for all colliders in the path of the ray.
- The raycast ignores colliders that contain the starting point.
- !#zh
- 检测哪些碰撞体在给定射线的路径上,射线检测将忽略包含起始点的碰撞体。
- @param p1 start point of the raycast
- @param p2 end point of the raycast
- @param type optional, default is RayCastType.Closest
- */
- rayCast(p1: Vec2, p2: Vec2, type: RayCastType): PhysicsRayCastResult[];
- /** !#en
- Enabled the physics manager?
- !#zh
- 指定是否启用物理系统? */
- enabled: boolean;
- /** !#en
- Debug draw flags.
- !#zh
- 设置调试绘制标志 */
- debugDrawFlags: number;
- /** !#en
- The physics world gravity.
- !#zh
- 物理世界重力值 */
- gravity: Vec2;
- /**
- !#en Checks whether the EventTarget object has any callback registered for a specific type of event.
- !#zh 检查事件目标对象是否有为特定类型的事件注册的回调。
- @param type The type of event.
- */
- hasEventListener(type: string): boolean;
- /**
- !#en
- Register an callback of a specific event type on the EventTarget.
- This type of event should be triggered via `emit`.
- !#zh
- 注册事件目标的特定事件类型回调。这种类型的事件应该被 `emit` 触发。
- @param type A string representing the event type to listen for.
- @param callback The callback that will be invoked when the event is dispatched.
- The callback is ignored if it is a duplicate (the callbacks are unique).
- @param target The target (this object) to invoke the callback, can be null
-
- @example
- ```js
- eventTarget.on('fire', function () {
- cc.log("fire in the hole");
- }, node);
- ```
- */
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
- /**
- !#en
- Removes the listeners previously registered with the same type, callback, target and or useCapture,
- if only type is passed as parameter, all listeners registered with that type will be removed.
- !#zh
- 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。
- @param type A string representing the event type being removed.
- @param callback The callback to remove.
- @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed
-
- @example
- ```js
- // register fire eventListener
- var callback = eventTarget.on('fire', function () {
- cc.log("fire in the hole");
- }, target);
- // remove fire event listener
- eventTarget.off('fire', callback, target);
- // remove all fire event listeners
- eventTarget.off('fire');
- ```
- */
- off(type: string, callback?: Function, target?: any): void;
- /**
- !#en Removes all callbacks previously registered with the same target (passed as parameter).
- This is not for removing all listeners in the current event target,
- and this is not for removing all listeners the target parameter have registered.
- It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter.
- !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。
- 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。
- 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。
- @param target The target to be searched for all related listeners
- */
- targetOff(target: any): void;
- /**
- !#en
- Register an callback of a specific event type on the EventTarget,
- the callback will remove itself after the first time it is triggered.
- !#zh
- 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。
- @param type A string representing the event type to listen for.
- @param callback The callback that will be invoked when the event is dispatched.
- The callback is ignored if it is a duplicate (the callbacks are unique).
- @param target The target (this object) to invoke the callback, can be null
-
- @example
- ```js
- eventTarget.once('fire', function () {
- cc.log("this is the callback and will be invoked only once");
- }, node);
- ```
- */
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
- /**
- !#en
- Send an event with the event object.
- !#zh
- 通过事件对象派发事件
- @param event event
- */
- dispatchEvent(event: Event): void;
- }
- /** undefined */
- export class PhysicsRayCastResult {
- /** !#en
- The PhysicsCollider which intersects with the raycast
- !#zh
- 与射线相交的碰撞体 */
- collider: PhysicsCollider;
- /** !#en
- The intersection point
- !#zh
- 射线与碰撞体相交的点 */
- point: Vec2;
- /** !#en
- The normal vector at the point of intersection
- !#zh
- 射线与碰撞体相交的点的法向量 */
- normal: Vec2;
- /** !#en
- The fraction of the raycast path at the point of intersection
- !#zh
- 射线与碰撞体相交的点占射线长度的分数 */
- fraction: number;
- }
- /** !#en Enum for RigidBodyType.
- !#zh 刚体类型 */
- export enum RigidBodyType {
- Static = 0,
- Kinematic = 0,
- Dynamic = 0,
- Animated = 0,
- }
- /** !#en Enum for RayCastType.
- !#zh 射线检测类型 */
- export enum RayCastType {
- Closest = 0,
- Any = 0,
- AllClosest = 0,
- All = 0,
- }
- /** undefined */
- export class RigidBody extends Component {
- /** !#en
- Should enabled contact listener?
- When a collision is trigger, the collision callback will only be called when enabled contact listener.
- !#zh
- 是否启用接触接听器。
- 当 collider 产生碰撞时,只有开启了接触接听器才会调用相应的回调函数 */
- enabledContactListener: boolean;
- /**
- !#en
- Collision callback.
- Called when two collider begin to touch.
- !#zh
- 碰撞回调。
- 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体开始接触时被调用。
- @param contact contact information
- @param selfCollider the collider belong to this rigidbody
- @param otherCollider the collider belong to another rigidbody
- */
- onBeginContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void;
- /**
- !#en
- Collision callback.
- Called when two collider cease to touch.
- !#zh
- 碰撞回调。
- 如果你的脚本中实现了这个函数,那么它将会在两个碰撞体停止接触时被调用。
- @param contact contact information
- @param selfCollider the collider belong to this rigidbody
- @param otherCollider the collider belong to another rigidbody
- */
- onEndContact(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void;
- /**
- !#en
- Collision callback.
- This is called when a contact is updated.
- This allows you to inspect a contact before it goes to the solver(e.g. disable contact).
- Note: this is called only for awake bodies.
- Note: this is called even when the number of contact points is zero.
- Note: this is not called for sensors.
- !#zh
- 碰撞回调。
- 如果你的脚本中实现了这个函数,那么它将会在接触更新时被调用。
- 你可以在接触被处理前根据他包含的信息作出相应的处理,比如将这个接触禁用掉。
- 注意:回调只会为醒着的刚体调用。
- 注意:接触点为零的时候也有可能被调用。
- 注意:感知体(sensor)的回调不会被调用。
- @param contact contact information
- @param selfCollider the collider belong to this rigidbody
- @param otherCollider the collider belong to another rigidbody
- */
- onPreSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void;
- /**
- !#en
- Collision callback.
- This is called after a contact is updated.
- You can get the impulses from the contact in this callback.
- !#zh
- 碰撞回调。
- 如果你的脚本中实现了这个函数,那么它将会在接触更新完后被调用。
- 你可以在这个回调中从接触信息中获取到冲量信息。
- @param contact contact information
- @param selfCollider the collider belong to this rigidbody
- @param otherCollider the collider belong to another rigidbody
- */
- onPostSolve(contact: PhysicsContact, selfCollider: PhysicsCollider, otherCollider: PhysicsCollider): void;
- /** !#en
- Is this a fast moving body that should be prevented from tunneling through
- other moving bodies?
- Note :
- - All bodies are prevented from tunneling through kinematic and static bodies. This setting is only considered on dynamic bodies.
- - You should use this flag sparingly since it increases processing time.
- !#zh
- 这个刚体是否是一个快速移动的刚体,并且需要禁止穿过其他快速移动的刚体?
- 需要注意的是 :
- - 所有刚体都被禁止从 运动刚体 和 静态刚体 中穿过。此选项只关注于 动态刚体。
- - 应该尽量少的使用此选项,因为它会增加程序处理时间。 */
- bullet: boolean;
- /** !#en
- Rigidbody type : Static, Kinematic, Dynamic or Animated.
- !#zh
- 刚体类型: Static, Kinematic, Dynamic or Animated. */
- type: RigidBodyType;
- /** !#en
- Set this flag to false if this body should never fall asleep.
- Note that this increases CPU usage.
- !#zh
- 如果此刚体永远都不应该进入睡眠,那么设置这个属性为 false。
- 需要注意这将使 CPU 占用率提高。 */
- allowSleep: boolean;
- /** !#en
- Scale the gravity applied to this body.
- !#zh
- 缩放应用在此刚体上的重力值 */
- gravityScale: number;
- /** !#en
- Linear damping is use to reduce the linear velocity.
- The damping parameter can be larger than 1, but the damping effect becomes sensitive to the
- time step when the damping parameter is large.
- !#zh
- Linear damping 用于衰减刚体的线性速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */
- linearDamping: number;
- /** !#en
- Angular damping is use to reduce the angular velocity. The damping parameter
- can be larger than 1 but the damping effect becomes sensitive to the
- time step when the damping parameter is large.
- !#zh
- Angular damping 用于衰减刚体的角速度。衰减系数可以大于 1,但是当衰减系数比较大的时候,衰减的效果会变得比较敏感。 */
- angularDamping: number;
- /** !#en
- The linear velocity of the body's origin in world co-ordinates.
- !#zh
- 刚体在世界坐标下的线性速度 */
- linearVelocity: Vec2;
- /** !#en
- The angular velocity of the body.
- !#zh
- 刚体的角速度 */
- angularVelocity: number;
- /** !#en
- Should this body be prevented from rotating?
- !#zh
- 是否禁止此刚体进行旋转 */
- fixedRotation: boolean;
- /** !#en
- Set the sleep state of the body. A sleeping body has very low CPU cost.(When the rigid body is hit, if the rigid body is in sleep state, it will be immediately awakened.)
- !#zh
- 设置刚体的睡眠状态。 睡眠的刚体具有非常低的 CPU 成本。(当刚体被碰撞到时,如果刚体处于睡眠状态,它会立即被唤醒) */
- awake: boolean;
- /** !#en
- Whether to wake up this rigid body during initialization
- !#zh
- 是否在初始化时唤醒此刚体 */
- awakeOnLoad: boolean;
- /** !#en
- Set the active state of the body. An inactive body is not
- simulated and cannot be collided with or woken up.
- If body is active, all fixtures will be added to the
- broad-phase.
- If body is inactive, all fixtures will be removed from
- the broad-phase and all contacts will be destroyed.
- Fixtures on an inactive body are implicitly inactive and will
- not participate in collisions, ray-casts, or queries.
- Joints connected to an inactive body are implicitly inactive.
- !#zh
- 设置刚体的激活状态。一个非激活状态下的刚体是不会被模拟和碰撞的,不管它是否处于睡眠状态下。
- 如果刚体处于激活状态下,所有夹具会被添加到 粗测阶段(broad-phase)。
- 如果刚体处于非激活状态下,所有夹具会被从 粗测阶段(broad-phase)中移除。
- 在非激活状态下的夹具不会参与到碰撞,射线,或者查找中
- 链接到非激活状态下刚体的关节也是非激活的。 */
- active: boolean;
- /**
- !#en
- Gets a local point relative to the body's origin given a world point.
- !#zh
- 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点
- @param worldPoint a point in world coordinates.
- @param out optional, the receiving point
- */
- getLocalPoint(worldPoint: Vec2, out: Vec2): Vec2;
- /**
- !#en
- Get the world coordinates of a point given the local coordinates.
- !#zh
- 将一个给定的刚体本地坐标系下的点转换为世界坐标系下的点
- @param localPoint a point in local coordinates.
- @param out optional, the receiving point
- */
- getWorldPoint(localPoint: Vec2, out: Vec2): Vec2;
- /**
- !#en
- Get the world coordinates of a vector given the local coordinates.
- !#zh
- 将一个给定的世界坐标系下的向量转换为刚体本地坐标系下的向量
- @param localVector a vector in world coordinates.
- @param out optional, the receiving vector
- */
- getWorldVector(localVector: Vec2, out: Vec2): Vec2;
- /**
- !#en
- Gets a local vector relative to the body's origin given a world vector.
- !#zh
- 将一个给定的世界坐标系下的点转换为刚体本地坐标系下的点
- @param worldVector a vector in world coordinates.
- @param out optional, the receiving vector
- */
- getLocalVector(worldVector: Vec2, out: Vec2): Vec2;
- /**
- !#en
- Get the world body origin position.
- !#zh
- 获取刚体世界坐标系下的原点值
- @param out optional, the receiving point
- */
- getWorldPosition(out: Vec2): Vec2;
- /**
- !#en
- Get the world body rotation angle.
- !#zh
- 获取刚体世界坐标系下的旋转值。
- */
- getWorldRotation(): number;
- /**
- !#en
- Get the local position of the center of mass.
- !#zh
- 获取刚体本地坐标系下的质心
- */
- getLocalCenter(): Vec2;
- /**
- !#en
- Get the world position of the center of mass.
- !#zh
- 获取刚体世界坐标系下的质心
- */
- getWorldCenter(): Vec2;
- /**
- !#en
- Get the world linear velocity of a world point attached to this body.
- !#zh
- 获取刚体上指定点的线性速度
- @param worldPoint a point in world coordinates.
- @param out optional, the receiving point
- */
- getLinearVelocityFromWorldPoint(worldPoint: Vec2, out: Vec2): Vec2;
- /**
- !#en
- Get total mass of the body.
- !#zh
- 获取刚体的质量。
- */
- getMass(): number;
- /**
- !#en
- Get the rotational inertia of the body about the local origin.
- !#zh
- 获取刚体本地坐标系下原点的旋转惯性
- */
- getInertia(): number;
- /**
- !#en
- Get all the joints connect to the rigidbody.
- !#zh
- 获取链接到此刚体的所有关节
- */
- getJointList(): Joint[];
- /**
- !#en
- Apply a force at a world point. If the force is not
- applied at the center of mass, it will generate a torque and
- affect the angular velocity.
- !#zh
- 施加一个力到刚体上的一个点。如果力没有施加到刚体的质心上,还会产生一个扭矩并且影响到角速度。
- @param force the world force vector.
- @param point the world position.
- @param wake also wake up the body.
- */
- applyForce(force: Vec2, point: Vec2, wake: boolean): void;
- /**
- !#en
- Apply a force to the center of mass.
- !#zh
- 施加一个力到刚体上的质心上。
- @param force the world force vector.
- @param wake also wake up the body.
- */
- applyForceToCenter(force: Vec2, wake: boolean): void;
- /**
- !#en
- Apply a torque. This affects the angular velocity.
- !#zh
- 施加一个扭矩力,将影响刚体的角速度
- @param torque about the z-axis (out of the screen), usually in N-m.
- @param wake also wake up the body
- */
- applyTorque(torque: number, wake: boolean): void;
- /**
- !#en
- Apply a impulse at a world point, This immediately modifies the velocity.
- If the impulse is not applied at the center of mass, it will generate a torque and
- affect the angular velocity.
- !#zh
- 施加冲量到刚体上的一个点,将立即改变刚体的线性速度。
- 如果冲量施加到的点不是刚体的质心,那么将产生一个扭矩并影响刚体的角速度。
- @param impulse the world impulse vector, usually in N-seconds or kg-m/s.
- @param point the world position
- @param wake alse wake up the body
- */
- applyLinearImpulse(impulse: Vec2, point: Vec2, wake: boolean): void;
- /**
- !#en
- Apply an angular impulse.
- !#zh
- 施加一个角速度冲量。
- @param impulse the angular impulse in units of kg*m*m/s
- @param wake also wake up the body
- */
- applyAngularImpulse(impulse: number, wake: boolean): void;
- /**
- !#en
- Synchronize node's world position to box2d rigidbody's position.
- If enableAnimated is true and rigidbody's type is Animated type,
- will set linear velocity instead of directly set rigidbody's position.
- !#zh
- 同步节点的世界坐标到 box2d 刚体的坐标上。
- 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的线性速度来代替直接设置刚体的位置。
- @param enableAnimated enableAnimated
- */
- syncPosition(enableAnimated: boolean): void;
- /**
- !#en
- Synchronize node's world angle to box2d rigidbody's angle.
- If enableAnimated is true and rigidbody's type is Animated type,
- will set angular velocity instead of directly set rigidbody's angle.
- !#zh
- 同步节点的世界旋转角度值到 box2d 刚体的旋转值上。
- 如果 enableAnimated 是 true,并且刚体的类型是 Animated ,那么将设置刚体的角速度来代替直接设置刚体的角度。
- @param enableAnimated enableAnimated
- */
- syncRotation(enableAnimated: boolean): void;
- }
- /** !#en the device accelerometer reports values for each axis in units of g-force.
- !#zh 设备重力传感器传递的各个轴的数据。 */
- export class constructor {
- /**
- whether enable accelerometer event
- @param isEnable isEnable
- */
- setAccelerometerEnabled(isEnable: boolean): void;
- /**
- set accelerometer interval value
- @param interval interval
- */
- setAccelerometerInterval(interval: number): void;
- }
- /** Predefined constants */
- export class macro {
- /** PI / 180 */
- static RAD: number;
- /** One degree */
- static DEG: number;
- static REPEAT_FOREVER: number;
- static FLT_EPSILON: number;
- /** Minimum z index value for node */
- static MIN_ZINDEX: number;
- /** Maximum z index value for node */
- static MAX_ZINDEX: number;
- static ONE: number;
- static ZERO: number;
- static SRC_ALPHA: number;
- static SRC_ALPHA_SATURATE: number;
- static SRC_COLOR: number;
- static DST_ALPHA: number;
- static DST_COLOR: number;
- static ONE_MINUS_SRC_ALPHA: number;
- static ONE_MINUS_SRC_COLOR: number;
- static ONE_MINUS_DST_ALPHA: number;
- static ONE_MINUS_DST_COLOR: number;
- static ONE_MINUS_CONSTANT_ALPHA: number;
- static ONE_MINUS_CONSTANT_COLOR: number;
- /** Oriented vertically */
- static ORIENTATION_PORTRAIT: number;
- /** Oriented horizontally */
- static ORIENTATION_LANDSCAPE: number;
- /** Oriented automatically */
- static ORIENTATION_AUTO: number;
- /** <p>
- If enabled, the texture coordinates will be calculated by using this formula: <br/>
- - texCoord.left = (rect.x*2+1) / (texture.wide*2); <br/>
- - texCoord.right = texCoord.left + (rect.width*2-2)/(texture.wide*2); <br/>
- <br/>
- The same for bottom and top. <br/>
- <br/>
- This formula prevents artifacts by using 99% of the texture. <br/>
- The "correct" way to prevent artifacts is by expand the texture's border with the same color by 1 pixel<br/>
- <br/>
- Affected component: <br/>
- - cc.TMXLayer <br/>
- <br/>
- Enabled by default. To disabled set it to 0. <br/>
- To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h
- </p> */
- static FIX_ARTIFACTS_BY_STRECHING_TEXEL_TMX: number;
- /** Position of the FPS (Default: 0,0 (bottom-left corner))<br/>
- To modify it, in Web engine please refer to CCMacro.js, in JSB please refer to CCConfig.h */
- static DIRECTOR_STATS_POSITION: Vec2;
- /** <p>
- If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked. <br/>
- If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions. <br/>
- If disabled, only the last run action will take effect.
- </p> */
- static ENABLE_STACKABLE_ACTIONS: number;
- /** !#en
- The timeout to determine whether a touch is no longer active and should be removed.
- The reason to add this timeout is due to an issue in X5 browser core,
- when X5 is presented in wechat on Android, if a touch is glissed from the bottom up, and leave the page area,
- no touch cancel event is triggered, and the touch will be considered active forever.
- After multiple times of this action, our maximum touches number will be reached and all new touches will be ignored.
- So this new mechanism can remove the touch that should be inactive if it's not updated during the last 5000 milliseconds.
- Though it might remove a real touch if it's just not moving for the last 5 seconds which is not easy with the sensibility of mobile touch screen.
- You can modify this value to have a better behavior if you find it's not enough.
- !#zh
- 用于甄别一个触点对象是否已经失效并且可以被移除的延时时长
- 添加这个时长的原因是 X5 内核在微信浏览器中出现的一个 bug。
- 在这个环境下,如果用户将一个触点从底向上移出页面区域,将不会触发任何 touch cancel 或 touch end 事件,而这个触点会被永远当作停留在页面上的有效触点。
- 重复这样操作几次之后,屏幕上的触点数量将达到我们的事件系统所支持的最高触点数量,之后所有的触摸事件都将被忽略。
- 所以这个新的机制可以在触点在一定时间内没有任何更新的情况下视为失效触点并从事件系统中移除。
- 当然,这也可能移除一个真实的触点,如果用户的触点真的在一定时间段内完全没有移动(这在当前手机屏幕的灵敏度下会很难)。
- 你可以修改这个值来获得你需要的效果,默认值是 5000 毫秒。 */
- static TOUCH_TIMEOUT: number;
- /** !#en
- The maximum vertex count for a single batched draw call.
- !#zh
- 最大可以被单次批处理渲染的顶点数量。 */
- static BATCH_VERTEX_COUNT: number;
- /** !#en
- Whether or not enabled tiled map auto culling. If you set the TiledMap skew or rotation, then need to manually disable this, otherwise, the rendering will be wrong.
- !#zh
- 是否开启瓦片地图的自动裁减功能。瓦片地图如果设置了 skew, rotation 的话,需要手动关闭,否则渲染会出错。 */
- static ENABLE_TILEDMAP_CULLING: boolean;
- /** !#en
- The max concurrent task number for the downloader
- !#zh
- 下载任务的最大并发数限制,在安卓平台部分机型或版本上可能需要限制在较低的水平 */
- static DOWNLOAD_MAX_CONCURRENT: number;
- /** !#en
- Boolean that indicates if the canvas contains an alpha channel, default sets to false for better performance.
- Though if you want to make your canvas background transparent and show other dom elements at the background,
- you can set it to true before `cc.game.run`.
- Web only.
- !#zh
- 用于设置 Canvas 背景是否支持 alpha 通道,默认为 false,这样可以有更高的性能表现。
- 如果你希望 Canvas 背景是透明的,并显示背后的其他 DOM 元素,你可以在 `cc.game.run` 之前将这个值设为 true。
- 仅支持 Web */
- static ENABLE_TRANSPARENT_CANVAS: boolean;
- /** !#en
- Boolean that indicates if the WebGL context is created with `antialias` option turned on, default value is false.
- Set it to true could make your game graphics slightly smoother, like texture hard edges when rotated.
- Whether to use this really depend on your game design and targeted platform,
- device with retina display usually have good detail on graphics with or without this option,
- you probably don't want antialias if your game style is pixel art based.
- Also, it could have great performance impact with some browser / device using software MSAA.
- You can set it to true before `cc.game.run`.
- Web only.
- !#zh
- 用于设置在创建 WebGL Context 时是否开启抗锯齿选项,默认值是 false。
- 将这个选项设置为 true 会让你的游戏画面稍稍平滑一些,比如旋转硬边贴图时的锯齿。是否开启这个选项很大程度上取决于你的游戏和面向的平台。
- 在大多数拥有 retina 级别屏幕的设备上用户往往无法区分这个选项带来的变化;如果你的游戏选择像素艺术风格,你也多半不会想开启这个选项。
- 同时,在少部分使用软件级别抗锯齿算法的设备或浏览器上,这个选项会对性能产生比较大的影响。
- 你可以在 `cc.game.run` 之前设置这个值,否则它不会生效。
- 仅支持 Web */
- static ENABLE_WEBGL_ANTIALIAS: boolean;
- /** !#en
- Whether or not enable auto culling.
- This feature have been removed in v2.0 new renderer due to overall performance consumption.
- We have no plan currently to re-enable auto culling.
- If your game have more dynamic objects, we suggest to disable auto culling.
- If your game have more static objects, we suggest to enable auto culling.
- !#zh
- 是否开启自动裁减功能,开启裁减功能将会把在屏幕外的物体从渲染队列中去除掉。
- 这个功能在 v2.0 的新渲染器中被移除了,因为它在大多数游戏中所带来的损耗要高于性能的提升,目前我们没有计划重新支持自动裁剪。
- 如果游戏中的动态物体比较多的话,建议将此选项关闭。
- 如果游戏中的静态物体比较多的话,建议将此选项打开。 */
- static ENABLE_CULLING: boolean;
- /** !#en
- Whether or not clear dom Image object cache after uploading to gl texture.
- Concretely, we are setting image.src to empty string to release the cache.
- Normally you don't need to enable this option, because on web the Image object doesn't consume too much memory.
- But on WeChat Game platform, the current version cache decoded data in Image object, which has high memory usage.
- So we enabled this option by default on WeChat, so that we can release Image cache immediately after uploaded to GPU.
- !#zh
- 是否在将贴图上传至 GPU 之后删除 DOM Image 缓存。
- 具体来说,我们通过设置 image.src 为空字符串来释放这部分内存。
- 正常情况下,你不需要开启这个选项,因为在 web 平台,Image 对象所占用的内存很小。
- 但是在微信小游戏平台的当前版本,Image 对象会缓存解码后的图片数据,它所占用的内存空间很大。
- 所以我们在微信平台默认开启了这个选项,这样我们就可以在上传 GL 贴图之后立即释放 Image 对象的内存,避免过高的内存占用。 */
- static CLEANUP_IMAGE_CACHE: boolean;
- /** !#en
- Whether or not show mesh wire frame.
- !#zh
- 是否显示网格的线框。 */
- static SHOW_MESH_WIREFRAME: boolean;
- /** !#en
- Set cc.RotateTo/cc.RotateBy rotate direction.
- If need set rotate positive direction to counterclockwise, please change setting to : cc.macro.ROTATE_ACTION_CCW = true;
- !#zh
- 设置 cc.RotateTo/cc.RotateBy 的旋转方向。
- 如果需要设置旋转的正方向为逆时针方向,请设置选项为: cc.macro.ROTATE_ACTION_CCW = true; */
- static ROTATE_ACTION_CCW: boolean;
- /** !en
- The image format supported by the engine defaults, and the supported formats may differ in different build platforms and device types.
- Currently all platform and device support ['.webp', '.jpg', '.jpeg', '.bmp', '.png'], The iOS mobile platform also supports the PVR format。
- !zh
- 引擎默认支持的图片格式,支持的格式可能在不同的构建平台和设备类型上有所差别。
- 目前所有平台和设备支持的格式有 ['.webp', '.jpg', '.jpeg', '.bmp', '.png']. 另外 Ios 手机平台还额外支持了 PVR 格式。 */
- static SUPPORT_TEXTURE_FORMATS: string[];
- }
- /** undefined */
- export enum VerticalTextAlignment {
- TOP = 0,
- CENTER = 0,
- BOTTOM = 0,
- }
- /** The base class of most of all the objects in Fireball. */
- export class Object {
- /** !#en The name of the object.
- !#zh 该对象的名称。 */
- name: string;
- /** !#en
- Indicates whether the object is not yet destroyed. (It will not be available after being destroyed)<br>
- When an object's `destroy` is called, it is actually destroyed after the end of this frame.
- So `isValid` will return false from the next frame, while `isValid` in the current frame will still be true.
- If you want to determine whether the current frame has called `destroy`, use `cc.isValid(obj, true)`,
- but this is often caused by a particular logical requirements, which is not normally required.
-
- !#zh
- 表示该对象是否可用(被 destroy 后将不可用)。<br>
- 当一个对象的 `destroy` 调用以后,会在这一帧结束后才真正销毁。因此从下一帧开始 `isValid` 就会返回 false,而当前帧内 `isValid` 仍然会是 true。如果希望判断当前帧是否调用过 `destroy`,请使用 `cc.isValid(obj, true)`,不过这往往是特殊的业务需求引起的,通常情况下不需要这样。 */
- isValid: boolean;
- /**
- !#en
- Destroy this Object, and release all its own references to other objects.<br/>
- Actual object destruction will delayed until before rendering.
- From the next frame, this object is not usable any more.
- You can use cc.isValid(obj) to check whether the object is destroyed before accessing it.
- !#zh
- 销毁该对象,并释放所有它对其它对象的引用。<br/>
- 实际销毁操作会延迟到当前帧渲染前执行。从下一帧开始,该对象将不再可用。
- 您可以在访问对象之前使用 cc.isValid(obj) 来检查对象是否已被销毁。
-
- @example
- ```js
- obj.destroy();
- ```
- */
- destroy(): boolean;
- }
- /** Bit mask that controls object states. */
- export enum Flags {
- DontSave = 0,
- EditorOnly = 0,
- HideInHierarchy = 0,
- }
- /** The fullscreen API provides an easy way for web content to be presented using the user's entire screen.
- It's invalid on safari, QQbrowser and android browser */
- export class screen {
- /**
- initialize
- */
- init(): void;
- /**
- return true if it's full now.
- */
- fullScreen(): boolean;
- /**
- change the screen to full mode.
- @param element element
- @param onFullScreenChange onFullScreenChange
- @param onFullScreenError onFullScreenError
- */
- requestFullScreen(element: Element, onFullScreenChange: Function, onFullScreenError: Function): void;
- /**
- exit the full mode.
- */
- exitFullScreen(): boolean;
- /**
- Automatically request full screen with a touch/click event
- @param element element
- @param onFullScreenChange onFullScreenChange
- */
- autoFullScreen(element: Element, onFullScreenChange: Function): void;
- }
- /** System variables */
- export class sys {
- /** English language code */
- static LANGUAGE_ENGLISH: string;
- /** Chinese language code */
- static LANGUAGE_CHINESE: string;
- /** French language code */
- static LANGUAGE_FRENCH: string;
- /** Italian language code */
- static LANGUAGE_ITALIAN: string;
- /** German language code */
- static LANGUAGE_GERMAN: string;
- /** Spanish language code */
- static LANGUAGE_SPANISH: string;
- /** Spanish language code */
- static LANGUAGE_DUTCH: string;
- /** Russian language code */
- static LANGUAGE_RUSSIAN: string;
- /** Korean language code */
- static LANGUAGE_KOREAN: string;
- /** Japanese language code */
- static LANGUAGE_JAPANESE: string;
- /** Hungarian language code */
- static LANGUAGE_HUNGARIAN: string;
- /** Portuguese language code */
- static LANGUAGE_PORTUGUESE: string;
- /** Arabic language code */
- static LANGUAGE_ARABIC: string;
- /** Norwegian language code */
- static LANGUAGE_NORWEGIAN: string;
- /** Polish language code */
- static LANGUAGE_POLISH: string;
- /** Turkish language code */
- static LANGUAGE_TURKISH: string;
- /** Ukrainian language code */
- static LANGUAGE_UKRAINIAN: string;
- /** Romanian language code */
- static LANGUAGE_ROMANIAN: string;
- /** Bulgarian language code */
- static LANGUAGE_BULGARIAN: string;
- /** Unknown language code */
- static LANGUAGE_UNKNOWN: string;
- static OS_IOS: string;
- static OS_ANDROID: string;
- static OS_WINDOWS: string;
- static OS_MARMALADE: string;
- static OS_LINUX: string;
- static OS_BADA: string;
- static OS_BLACKBERRY: string;
- static OS_OSX: string;
- static OS_WP8: string;
- static OS_WINRT: string;
- static OS_UNKNOWN: string;
- static UNKNOWN: number;
- static WIN32: number;
- static LINUX: number;
- static MACOS: number;
- static ANDROID: number;
- static IPHONE: number;
- static IPAD: number;
- static BLACKBERRY: number;
- static NACL: number;
- static EMSCRIPTEN: number;
- static TIZEN: number;
- static WINRT: number;
- static WP8: number;
- static MOBILE_BROWSER: number;
- static DESKTOP_BROWSER: number;
- /** Indicates whether executes in editor's window process (Electron's renderer context) */
- static EDITOR_PAGE: number;
- /** Indicates whether executes in editor's main process (Electron's browser context) */
- static EDITOR_CORE: number;
- static WECHAT_GAME: number;
- static QQ_PLAY: number;
- static FB_PLAYABLE_ADS: number;
- static BAIDU_GAME: number;
- static VIVO_GAME: number;
- static OPPO_GAME: number;
- static HUAWEI_GAME: number;
- static XIAOMI_GAME: number;
- static JKW_GAME: number;
- static ALIPAY_GAME: number;
- static WECHAT_GAME_SUB: number;
- static BAIDU_GAME_SUB: number;
- /** BROWSER_TYPE_WECHAT */
- static BROWSER_TYPE_WECHAT: string;
- /** BROWSER_TYPE_WECHAT_GAME */
- static BROWSER_TYPE_WECHAT_GAME: string;
- /** BROWSER_TYPE_WECHAT_GAME_SUB */
- static BROWSER_TYPE_WECHAT_GAME_SUB: string;
- /** BROWSER_TYPE_BAIDU_GAME */
- static BROWSER_TYPE_BAIDU_GAME: string;
- /** BROWSER_TYPE_BAIDU_GAME_SUB */
- static BROWSER_TYPE_BAIDU_GAME_SUB: string;
- /** BROWSER_TYPE_XIAOMI_GAME */
- static BROWSER_TYPE_XIAOMI_GAME: string;
- /** BROWSER_TYPE_ALIPAY_GAME */
- static BROWSER_TYPE_ALIPAY_GAME: string;
- /** BROWSER_TYPE_QQ_PLAY */
- static BROWSER_TYPE_QQ_PLAY: string;
- static BROWSER_TYPE_ANDROID: string;
- static BROWSER_TYPE_IE: string;
- static BROWSER_TYPE_EDGE: string;
- static BROWSER_TYPE_QQ: string;
- static BROWSER_TYPE_MOBILE_QQ: string;
- static BROWSER_TYPE_UC: string;
- /** uc third party integration. */
- static BROWSER_TYPE_UCBS: string;
- static BROWSER_TYPE_360: string;
- static BROWSER_TYPE_BAIDU_APP: string;
- static BROWSER_TYPE_BAIDU: string;
- static BROWSER_TYPE_MAXTHON: string;
- static BROWSER_TYPE_OPERA: string;
- static BROWSER_TYPE_OUPENG: string;
- static BROWSER_TYPE_MIUI: string;
- static BROWSER_TYPE_FIREFOX: string;
- static BROWSER_TYPE_SAFARI: string;
- static BROWSER_TYPE_CHROME: string;
- static BROWSER_TYPE_LIEBAO: string;
- static BROWSER_TYPE_QZONE: string;
- static BROWSER_TYPE_SOUGOU: string;
- static BROWSER_TYPE_UNKNOWN: string;
- /** Is native ? This is set to be true in jsb auto. */
- static isNative: boolean;
- /** Is web browser ? */
- static isBrowser: boolean;
- /**
- Is webgl extension support?
- @param name name
- */
- static glExtension(name: any): void;
- /**
- Get max joint matrix size for skinned mesh renderer.
- */
- static getMaxJointMatrixSize(): void;
- /** Indicate whether system is mobile system */
- static isMobile: boolean;
- /** Indicate the running platform */
- static platform: number;
- /** Get current language iso 639-1 code.
- Examples of valid language codes include "zh-tw", "en", "en-us", "fr", "fr-fr", "es-es", etc.
- The actual value totally depends on results provided by destination platform. */
- static languageCode: string;
- /** Indicate the current language of the running system */
- static language: string;
- /** Indicate the running os name */
- static os: string;
- /** Indicate the running os version */
- static osVersion: string;
- /** Indicate the running os main version */
- static osMainVersion: number;
- /** Indicate the running browser type */
- static browserType: string;
- /** Indicate the running browser version */
- static browserVersion: string;
- /** Indicate the real pixel resolution of the whole game window */
- static windowPixelResolution: Size;
- /** cc.sys.localStorage is a local storage component. */
- static localStorage: any;
- /** The capabilities of the current platform */
- static capabilities: any;
- /**
- !#en
- Get the network type of current device, return cc.sys.NetworkType.LAN if failure.
- !#zh
- 获取当前设备的网络类型, 如果网络类型无法获取,默认将返回 cc.sys.NetworkType.LAN
- */
- static getNetworkType(): sys.NetworkType;
- /**
- !#en
- Get the battery level of current device, return 1.0 if failure.
- !#zh
- 获取当前设备的电池电量,如果电量无法获取,默认将返回 1
- */
- static getBatteryLevel(): number;
- /**
- Forces the garbage collection, only available in JSB
- */
- static garbageCollect(): void;
- /**
- Restart the JS VM, only available in JSB
- */
- static restartVM(): void;
- /**
- !#en
- Return the safe area rect. <br/>
- only available on the iOS native platform, otherwise it will return a rect with design resolution size.
- !#zh
- 返回手机屏幕安全区域,目前仅在 iOS 原生平台有效。其它平台将默认返回设计分辨率尺寸。
- */
- static getSafeAreaRect(): Rect;
- /**
- Check whether an object is valid,
- In web engine, it will return true if the object exist
- In native engine, it will return true if the JS object and the correspond native object are both valid
- @param obj obj
- */
- static isObjectValid(obj: any): boolean;
- /**
- Dump system informations
- */
- static dump(): void;
- /**
- Open a url in browser
- @param url url
- */
- static openURL(url: string): void;
- /**
- Get the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.
- */
- static now(): number;
- }
- /** cc.view is the singleton object which represents the game window.<br/>
- It's main task include: <br/>
- - Apply the design resolution policy<br/>
- - Provide interaction with the window, like resize event on web, retina display support, etc...<br/>
- - Manage the game view port which can be different with the window<br/>
- - Manage the content scale and translation<br/>
- <br/>
- Since the cc.view is a singleton, you don't need to call any constructor or create functions,<br/>
- the standard way to use it is by calling:<br/>
- - cc.view.methodName(); <br/> */
- export class View extends EventTarget {
- /**
- !#en
- Sets view's target-densitydpi for android mobile browser. it can be set to: <br/>
- 1. cc.macro.DENSITYDPI_DEVICE, value is "device-dpi" <br/>
- 2. cc.macro.DENSITYDPI_HIGH, value is "high-dpi" (default value) <br/>
- 3. cc.macro.DENSITYDPI_MEDIUM, value is "medium-dpi" (browser's default value) <br/>
- 4. cc.macro.DENSITYDPI_LOW, value is "low-dpi" <br/>
- 5. Custom value, e.g: "480" <br/>
- !#zh 设置目标内容的每英寸像素点密度。
- @param densityDPI densityDPI
- */
- setTargetDensityDPI(densityDPI: string): void;
- /**
- !#en
- Returns the current target-densitydpi value of cc.view.
- !#zh 获取目标内容的每英寸像素点密度。
- */
- getTargetDensityDPI(): string;
- /**
- !#en
- Sets whether resize canvas automatically when browser's size changed.<br/>
- Useful only on web.
- !#zh 设置当发现浏览器的尺寸改变时,是否自动调整 canvas 尺寸大小。
- 仅在 Web 模式下有效。
- @param enabled Whether enable automatic resize with browser's resize event
- */
- resizeWithBrowserSize(enabled: boolean): void;
- /**
- !#en
- Sets the callback function for cc.view's resize action,<br/>
- this callback will be invoked before applying resolution policy, <br/>
- so you can do any additional modifications within the callback.<br/>
- Useful only on web.
- !#zh 设置 cc.view 调整视窗尺寸行为的回调函数,
- 这个回调函数会在应用适配模式之前被调用,
- 因此你可以在这个回调函数内添加任意附加改变,
- 仅在 Web 平台下有效。
- @param callback The callback function
- */
- setResizeCallback(callback: Function|void): void;
- /**
- !#en
- Sets the orientation of the game, it can be landscape, portrait or auto.
- When set it to landscape or portrait, and screen w/h ratio doesn't fit,
- cc.view will automatically rotate the game canvas using CSS.
- Note that this function doesn't have any effect in native,
- in native, you need to set the application orientation in native project settings
- !#zh 设置游戏屏幕朝向,它能够是横版,竖版或自动。
- 当设置为横版或竖版,并且屏幕的宽高比例不匹配时,
- cc.view 会自动用 CSS 旋转游戏场景的 canvas,
- 这个方法不会对 native 部分产生任何影响,对于 native 而言,你需要在应用设置中的设置排版。
- @param orientation Possible values: cc.macro.ORIENTATION_LANDSCAPE | cc.macro.ORIENTATION_PORTRAIT | cc.macro.ORIENTATION_AUTO
- */
- setOrientation(orientation: number): void;
- /**
- !#en
- Sets whether the engine modify the "viewport" meta in your web page.<br/>
- It's enabled by default, we strongly suggest you not to disable it.<br/>
- And even when it's enabled, you can still set your own "viewport" meta, it won't be overridden<br/>
- Only useful on web
- !#zh 设置引擎是否调整 viewport meta 来配合屏幕适配。
- 默认设置为启动,我们强烈建议你不要将它设置为关闭。
- 即使当它启动时,你仍然能够设置你的 viewport meta,它不会被覆盖。
- 仅在 Web 模式下有效
- @param enabled Enable automatic modification to "viewport" meta
- */
- adjustViewportMeta(enabled: boolean): void;
- /**
- !#en
- Retina support is enabled by default for Apple device but disabled for other devices,<br/>
- it takes effect only when you called setDesignResolutionPolicy<br/>
- Only useful on web
- !#zh 对于 Apple 这种支持 Retina 显示的设备上默认进行优化而其他类型设备默认不进行优化,
- 它仅会在你调用 setDesignResolutionPolicy 方法时有影响。
- 仅在 Web 模式下有效。
- @param enabled Enable or disable retina display
- */
- enableRetina(enabled: boolean): void;
- /**
- !#en
- Check whether retina display is enabled.<br/>
- Only useful on web
- !#zh 检查是否对 Retina 显示设备进行优化。
- 仅在 Web 模式下有效。
- */
- isRetinaEnabled(): boolean;
- /**
- !#en Whether to Enable on anti-alias
- !#zh 控制抗锯齿是否开启
- @param enabled Enable or not anti-alias
- */
- enableAntiAlias(enabled: boolean): void;
- /**
- !#en Returns whether the current enable on anti-alias
- !#zh 返回当前是否抗锯齿
- */
- isAntiAliasEnabled(): boolean;
- /**
- !#en
- If enabled, the application will try automatically to enter full screen mode on mobile devices<br/>
- You can pass true as parameter to enable it and disable it by passing false.<br/>
- Only useful on web
- !#zh 启动时,移动端游戏会在移动端自动尝试进入全屏模式。
- 你能够传入 true 为参数去启动它,用 false 参数来关闭它。
- @param enabled Enable or disable auto full screen on mobile devices
- */
- enableAutoFullScreen(enabled: boolean): void;
- /**
- !#en
- Check whether auto full screen is enabled.<br/>
- Only useful on web
- !#zh 检查自动进入全屏模式是否启动。
- 仅在 Web 模式下有效。
- */
- isAutoFullScreenEnabled(): boolean;
- /**
- !#en
- Returns the canvas size of the view.<br/>
- On native platforms, it returns the screen size since the view is a fullscreen view.<br/>
- On web, it returns the size of the canvas element.
- !#zh 返回视图中 canvas 的尺寸。
- 在 native 平台下,它返回全屏视图下屏幕的尺寸。
- 在 Web 平台下,它返回 canvas 元素尺寸。
- */
- getCanvasSize(): Size;
- /**
- !#en
- Returns the frame size of the view.<br/>
- On native platforms, it returns the screen size since the view is a fullscreen view.<br/>
- On web, it returns the size of the canvas's outer DOM element.
- !#zh 返回视图中边框尺寸。
- 在 native 平台下,它返回全屏视图下屏幕的尺寸。
- 在 web 平台下,它返回 canvas 元素的外层 DOM 元素尺寸。
- */
- getFrameSize(): Size;
- /**
- !#en
- On native, it sets the frame size of view.<br/>
- On web, it sets the size of the canvas's outer DOM element.
- !#zh 在 native 平台下,设置视图框架尺寸。
- 在 web 平台下,设置 canvas 外层 DOM 元素尺寸。
- @param width width
- @param height height
- */
- setFrameSize(width: number, height: number): void;
- /**
- !#en
- Returns the visible area size of the view port.
- !#zh 返回视图窗口可见区域尺寸。
- */
- getVisibleSize(): Size;
- /**
- !#en
- Returns the visible area size of the view port.
- !#zh 返回视图窗口可见区域像素尺寸。
- */
- getVisibleSizeInPixel(): Size;
- /**
- !#en
- Returns the visible origin of the view port.
- !#zh 返回视图窗口可见区域原点。
- */
- getVisibleOrigin(): Vec2;
- /**
- !#en
- Returns the visible origin of the view port.
- !#zh 返回视图窗口可见区域像素原点。
- */
- getVisibleOriginInPixel(): Vec2;
- /**
- !#en
- Returns the current resolution policy
- !#zh 返回当前分辨率方案
- */
- getResolutionPolicy(): ResolutionPolicy;
- /**
- !#en
- Sets the current resolution policy
- !#zh 设置当前分辨率模式
- @param resolutionPolicy resolutionPolicy
- */
- setResolutionPolicy(resolutionPolicy: ResolutionPolicy|number): void;
- /**
- !#en
- Sets the resolution policy with designed view size in points.<br/>
- The resolution policy include: <br/>
- [1] ResolutionExactFit Fill screen by stretch-to-fit: if the design resolution ratio of width to height is different from the screen resolution ratio, your game view will be stretched.<br/>
- [2] ResolutionNoBorder Full screen without black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two areas of your game view will be cut.<br/>
- [3] ResolutionShowAll Full screen with black border: if the design resolution ratio of width to height is different from the screen resolution ratio, two black borders will be shown.<br/>
- [4] ResolutionFixedHeight Scale the content's height to screen's height and proportionally scale its width<br/>
- [5] ResolutionFixedWidth Scale the content's width to screen's width and proportionally scale its height<br/>
- [cc.ResolutionPolicy] [Web only feature] Custom resolution policy, constructed by cc.ResolutionPolicy<br/>
- !#zh 通过设置设计分辨率和匹配模式来进行游戏画面的屏幕适配。
- @param width Design resolution width.
- @param height Design resolution height.
- @param resolutionPolicy The resolution policy desired
- */
- setDesignResolutionSize(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void;
- /**
- !#en
- Returns the designed size for the view.
- Default resolution size is the same as 'getFrameSize'.
- !#zh 返回视图的设计分辨率。
- 默认下分辨率尺寸同 `getFrameSize` 方法相同
- */
- getDesignResolutionSize(): Size;
- /**
- !#en
- Sets the container to desired pixel resolution and fit the game content to it.
- This function is very useful for adaptation in mobile browsers.
- In some HD android devices, the resolution is very high, but its browser performance may not be very good.
- In this case, enabling retina display is very costy and not suggested, and if retina is disabled, the image may be blurry.
- But this API can be helpful to set a desired pixel resolution which is in between.
- This API will do the following:
- 1. Set viewport's width to the desired width in pixel
- 2. Set body width to the exact pixel resolution
- 3. The resolution policy will be reset with designed view size in points.
- !#zh 设置容器(container)需要的像素分辨率并且适配相应分辨率的游戏内容。
- @param width Design resolution width.
- @param height Design resolution height.
- @param resolutionPolicy The resolution policy desired
- */
- setRealPixelResolution(width: number, height: number, resolutionPolicy: ResolutionPolicy|number): void;
- /**
- !#en
- Sets view port rectangle with points.
- !#zh 用设计分辨率下的点尺寸来设置视窗。
- @param x x
- @param y y
- @param w width
- @param h height
- */
- setViewportInPoints(x: number, y: number, w: number, h: number): void;
- /**
- !#en
- Sets Scissor rectangle with points.
- !#zh 用设计分辨率下的点的尺寸来设置 scissor 剪裁区域。
- @param x x
- @param y y
- @param w w
- @param h h
- */
- setScissorInPoints(x: number, y: number, w: number, h: number): void;
- /**
- !#en
- Returns whether GL_SCISSOR_TEST is enable
- !#zh 检查 scissor 是否生效。
- */
- isScissorEnabled(): boolean;
- /**
- !#en
- Returns the current scissor rectangle
- !#zh 返回当前的 scissor 剪裁区域。
- */
- getScissorRect(): Rect;
- /**
- !#en
- Returns the view port rectangle.
- !#zh 返回视窗剪裁区域。
- */
- getViewportRect(): Rect;
- /**
- !#en
- Returns scale factor of the horizontal direction (X axis).
- !#zh 返回横轴的缩放比,这个缩放比是将画布像素分辨率放到设计分辨率的比例。
- */
- getScaleX(): number;
- /**
- !#en
- Returns scale factor of the vertical direction (Y axis).
- !#zh 返回纵轴的缩放比,这个缩放比是将画布像素分辨率缩放到设计分辨率的比例。
- */
- getScaleY(): number;
- /**
- !#en
- Returns device pixel ratio for retina display.
- !#zh 返回设备或浏览器像素比例。
- */
- getDevicePixelRatio(): number;
- /**
- !#en
- Returns the real location in view for a translation based on a related position
- !#zh 将屏幕坐标转换为游戏视图下的坐标。
- @param tx The X axis translation
- @param ty The Y axis translation
- @param relatedPos The related position object including "left", "top", "width", "height" informations
- */
- convertToLocationInView(tx: number, ty: number, relatedPos: any): Vec2;
- }
- /** <p>cc.game.containerStrategy class is the root strategy class of container's scale strategy,
- it controls the behavior of how to scale the cc.game.container and cc.game.canvas object</p> */
- export class ContainerStrategy {
- /**
- !#en
- Manipulation before appling the strategy
- !#zh 在应用策略之前的操作
- @param view The target view
- */
- preApply(view: View): void;
- /**
- !#en
- Function to apply this strategy
- !#zh 策略应用方法
- @param view view
- @param designedResolution designedResolution
- */
- apply(view: View, designedResolution: Size): void;
- /**
- !#en
- Manipulation after applying the strategy
- !#zh 策略调用之后的操作
- @param view The target view
- */
- postApply(view: View): void;
- }
- /** <p>cc.ContentStrategy class is the root strategy class of content's scale strategy,
- it controls the behavior of how to scale the scene and setup the viewport for the game</p> */
- export class ContentStrategy {
- /**
- !#en
- Manipulation before applying the strategy
- !#zh 策略应用前的操作
- @param view The target view
- */
- preApply(view: View): void;
- /**
- !#en Function to apply this strategy
- The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}},
- The target view can then apply these value to itself, it's preferred not to modify directly its private variables
- !#zh 调用策略方法
- @param view view
- @param designedResolution designedResolution
- */
- apply(view: View, designedResolution: Size): any;
- /**
- !#en
- Manipulation after applying the strategy
- !#zh 策略调用之后的操作
- @param view The target view
- */
- postApply(view: View): void;
- }
- /** undefined */
- export class EqualToFrame extends ContainerStrategy {
- }
- /** undefined */
- export class ProportionalToFrame extends ContainerStrategy {
- }
- /** undefined */
- export class EqualToWindow extends EqualToFrame {
- }
- /** undefined */
- export class ProportionalToWindow extends ProportionalToFrame {
- }
- /** undefined */
- export class OriginalContainer extends ContainerStrategy {
- }
- /** <p>cc.ResolutionPolicy class is the root strategy class of scale strategy,
- its main task is to maintain the compatibility with Cocos2d-x</p> */
- export class ResolutionPolicy {
- /**
-
- @param containerStg The container strategy
- @param contentStg The content strategy
- */
- constructor(containerStg: ContainerStrategy, contentStg: ContentStrategy);
- /**
- !#en Manipulation before applying the resolution policy
- !#zh 策略应用前的操作
- @param view The target view
- */
- preApply(view: View): void;
- /**
- !#en Function to apply this resolution policy
- The return value is {scale: [scaleX, scaleY], viewport: {cc.Rect}},
- The target view can then apply these value to itself, it's preferred not to modify directly its private variables
- !#zh 调用策略方法
- @param view The target view
- @param designedResolution The user defined design resolution
- */
- apply(view: View, designedResolution: Size): any;
- /**
- !#en Manipulation after appyling the strategy
- !#zh 策略应用之后的操作
- @param view The target view
- */
- postApply(view: View): void;
- /**
- !#en
- Setup the container's scale strategy
- !#zh 设置容器的适配策略
- @param containerStg containerStg
- */
- setContainerStrategy(containerStg: ContainerStrategy): void;
- /**
- !#en
- Setup the content's scale strategy
- !#zh 设置内容的适配策略
- @param contentStg contentStg
- */
- setContentStrategy(contentStg: ContentStrategy): void;
- /** The entire application is visible in the specified area without trying to preserve the original aspect ratio.<br/>
- Distortion can occur, and the application may appear stretched or compressed. */
- static EXACT_FIT: number;
- /** The entire application fills the specified area, without distortion but possibly with some cropping,<br/>
- while maintaining the original aspect ratio of the application. */
- static NO_BORDER: number;
- /** The entire application is visible in the specified area without distortion while maintaining the original<br/>
- aspect ratio of the application. Borders can appear on two sides of the application. */
- static SHOW_ALL: number;
- /** The application takes the height of the design resolution size and modifies the width of the internal<br/>
- canvas so that it fits the aspect ratio of the device<br/>
- no distortion will occur however you must make sure your application works on different<br/>
- aspect ratios */
- static FIXED_HEIGHT: number;
- /** The application takes the width of the design resolution size and modifies the height of the internal<br/>
- canvas so that it fits the aspect ratio of the device<br/>
- no distortion will occur however you must make sure your application works on different<br/>
- aspect ratios */
- static FIXED_WIDTH: number;
- /** Unknow policy */
- static UNKNOWN: number;
- }
- /** cc.visibleRect is a singleton object which defines the actual visible rect of the current view,
- it should represent the same rect as cc.view.getViewportRect() */
- export class visibleRect {
- /**
- initialize
- @param visibleRect visibleRect
- */
- init(visibleRect: Rect): void;
- /** Top left coordinate of the screen related to the game scene. */
- topLeft: Vec2;
- /** Top right coordinate of the screen related to the game scene. */
- topRight: Vec2;
- /** Top center coordinate of the screen related to the game scene. */
- top: Vec2;
- /** Bottom left coordinate of the screen related to the game scene. */
- bottomLeft: Vec2;
- /** Bottom right coordinate of the screen related to the game scene. */
- bottomRight: Vec2;
- /** Bottom center coordinate of the screen related to the game scene. */
- bottom: Vec2;
- /** Center coordinate of the screen related to the game scene. */
- center: Vec2;
- /** Left center coordinate of the screen related to the game scene. */
- left: Vec2;
- /** Right center coordinate of the screen related to the game scene. */
- right: Vec2;
- /** Width of the screen. */
- width: number;
- /** Height of the screen. */
- height: number;
- }
- /** !#en The callbacks invoker to handle and invoke callbacks by key.
- !#zh CallbacksInvoker 用来根据 Key 管理并调用回调方法。 */
- export class CallbacksInvoker {
- /**
- !#zh
- 检查指定事件是否已注册回调。
- !#en
- Check if the specified key has any registered callback. If a callback is also specified,
- it will only return true if the callback is registered.
- @param key key
- @param callback callback
- @param target target
- */
- hasEventListener(key: string, callback?: Function, target?: any): boolean;
- /**
- !#zh
- 移除在特定事件类型中注册的所有回调或在某个目标中注册的所有回调。
-
- !#en
- Removes all callbacks registered in a certain event type or all callbacks registered with a certain target
- @param keyOrTarget The event key to be removed or the target to be removed
- */
- removeAll(keyOrTarget: string|any): void;
- /**
- !#zh
- 删除之前与同类型,回调,目标注册的回调。
- @param key key
- @param callback callback
- @param target target
- */
- off(key: string, callback: Function, target?: any): void;
- /**
- !#en
- Trigger an event directly with the event name and necessary arguments.
- !#zh
- 通过事件名发送自定义事件
- @param key event type
- @param arg1 First argument
- @param arg2 Second argument
- @param arg3 Third argument
- @param arg4 Fourth argument
- @param arg5 Fifth argument
-
- @example
- ```js
- eventTarget.emit('fire', event);
- eventTarget.emit('fire', message, emitter);
- ```
- */
- emit(key: string, arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any): void;
- }
- /** !#en Contains information collected during deserialization
- !#zh 包含反序列化时的一些信息 */
- export class Details {
- /** list of the depends assets' uuid */
- uuidList: string[];
- /** the obj list whose field needs to load asset by uuid */
- uuidObjList: any[];
- /** the corresponding field name which referenced to the asset */
- uuidPropList: string[];
- reset(): void;
- /**
-
- @param obj obj
- @param propName propName
- @param uuid uuid
- */
- push(obj: any, propName: string, uuid: string): void;
- }
- /** undefined */
- export class url {
- /**
- Returns the url of raw assets, you will only need this if the raw asset is inside the "resources" folder.
- @param url url
-
- @example
- ```js
- ---
- var url = cc.url.raw("textures/myTexture.png");
- console.log(url); // "resources/raw/textures/myTexture.png"
-
- ```
- */
- static raw(url: string): string;
- }
- /** !#en The renderer object which provide access to render system APIs,
- detailed APIs will be available progressively.
- !#zh 提供基础渲染接口的渲染器对象,渲染层的基础接口将逐步开放给用户 */
- export class renderer {
- /** !#en The render engine is available only after cc.game.EVENT_ENGINE_INITED event.<br/>
- Normally it will be inited as the webgl render engine, but in wechat open context domain,
- it will be inited as the canvas render engine. Canvas render engine is no longer available for other use case since v2.0.
- !#zh 基础渲染引擎对象只在 cc.game.EVENT_ENGINE_INITED 事件触发后才可获取。<br/>
- 大多数情况下,它都会是 WebGL 渲染引擎实例,但是在微信开放数据域当中,它会是 Canvas 渲染引擎实例。请注意,从 2.0 开始,我们在其他平台和环境下都废弃了 Canvas 渲染器。 */
- static renderEngine: any;
- /** !#en The total draw call count in last rendered frame.
- !#zh 上一次渲染帧所提交的渲染批次总数。 */
- static drawCalls: number;
- }
- /** !#en The module provides utilities for working with file and directory paths
- !#zh 用于处理文件与目录的路径的模块 */
- export class path {
- /**
- !#en Join strings to be a path.
- !#zh 拼接字符串为 Path
-
- @example
- ```js
- ------------------------------
- cc.path.join("a", "b.png"); //-->"a/b.png"
- cc.path.join("a", "b", "c.png"); //-->"a/b/c.png"
- cc.path.join("a", "b"); //-->"a/b"
- cc.path.join("a", "b", "/"); //-->"a/b/"
- cc.path.join("a", "b/", "/"); //-->"a/b/"
-
- ```
- */
- static join(): string;
- /**
- !#en Get the ext name of a path including '.', like '.png'.
- !#zh 返回 Path 的扩展名,包括 '.',例如 '.png'。
- @param pathStr pathStr
-
- @example
- ```js
- ---------------------------
- cc.path.extname("a/b.png"); //-->".png"
- cc.path.extname("a/b.png?a=1&b=2"); //-->".png"
- cc.path.extname("a/b"); //-->null
- cc.path.extname("a/b?a=1&b=2"); //-->null
-
- ```
- */
- static extname(pathStr: string): any;
- /**
- !#en Get the main name of a file name
- !#zh 获取文件名的主名称
- @param fileName fileName
- */
- static mainFileName(fileName: string): string;
- /**
- !#en Get the file name of a file path.
- !#zh 获取文件路径的文件名。
- @param pathStr pathStr
- @param extname extname
-
- @example
- ```js
- ---------------------------------
- cc.path.basename("a/b.png"); //-->"b.png"
- cc.path.basename("a/b.png?a=1&b=2"); //-->"b.png"
- cc.path.basename("a/b.png", ".png"); //-->"b"
- cc.path.basename("a/b.png?a=1&b=2", ".png"); //-->"b"
- cc.path.basename("a/b.png", ".txt"); //-->"b.png"
-
- ```
- */
- static basename(pathStr: string, extname?: string): any;
- /**
- !#en Get dirname of a file path.
- !#zh 获取文件路径的目录名。
- @param pathStr pathStr
-
- @example
- ```js
- ---------------------------------
- * unix
- cc.path.driname("a/b/c.png"); //-->"a/b"
- cc.path.driname("a/b/c.png?a=1&b=2"); //-->"a/b"
- cc.path.dirname("a/b/"); //-->"a/b"
- cc.path.dirname("c.png"); //-->""
- * windows
- cc.path.driname("a\\b\\c.png"); //-->"a\b"
- cc.path.driname("a\\b\\c.png?a=1&b=2"); //-->"a\b"
-
- ```
- */
- static dirname(pathStr: string): any;
- /**
- !#en Change extname of a file path.
- !#zh 更改文件路径的扩展名。
- @param pathStr pathStr
- @param extname extname
-
- @example
- ```js
- ---------------------------------
- cc.path.changeExtname("a/b.png", ".plist"); //-->"a/b.plist"
- cc.path.changeExtname("a/b.png?a=1&b=2", ".plist"); //-->"a/b.plist?a=1&b=2"
-
- ```
- */
- static changeExtname(pathStr: string, extname?: string): string;
- }
- /** !#en
- AffineTransform class represent an affine transform matrix. It's composed basically by translation, rotation, scale transformations.<br/>
- !#zh
- AffineTransform 类代表一个仿射变换矩阵。它基本上是由平移旋转,缩放转变所组成。<br/> */
- export class AffineTransform {
- /**
- !#en Create a AffineTransform object with all contents in the matrix.
- !#zh 用在矩阵中的所有内容创建一个 AffineTransform 对象。
- @param a a
- @param b b
- @param c c
- @param d d
- @param tx tx
- @param ty ty
- */
- static create(a: number, b: number, c: number, d: number, tx: number, ty: number): AffineTransform;
- /**
- !#en
- Create a identity transformation matrix: <br/>
- [ 1, 0, 0, <br/>
- 0, 1, 0 ]
- !#zh
- 单位矩阵:<br/>
- [ 1, 0, 0, <br/>
- 0, 1, 0 ]
- */
- static identity(): AffineTransform;
- /**
- !#en Clone a AffineTransform object from the specified transform.
- !#zh 克隆指定的 AffineTransform 对象。
- @param t t
- */
- static clone(t: AffineTransform): AffineTransform;
- /**
- !#en
- Concatenate a transform matrix to another
- The results are reflected in the out affine transform
- out = t1 * t2
- This function is memory free, you should create the output affine transform by yourself and manage its memory.
- !#zh
- 拼接两个矩阵,将结果保存到 out 矩阵。这个函数不创建任何内存,你需要先创建 AffineTransform 对象用来存储结果,并作为第一个参数传入函数。
- out = t1 * t2
- @param out Out object to store the concat result
- @param t1 The first transform object.
- @param t2 The transform object to concatenate.
- */
- static concat(out: AffineTransform, t1: AffineTransform, t2: AffineTransform): AffineTransform;
- /**
- !#en Get the invert transform of an AffineTransform object.
- This function is memory free, you should create the output affine transform by yourself and manage its memory.
- !#zh 求逆矩阵。这个函数不创建任何内存,你需要先创建 AffineTransform 对象用来存储结果,并作为第一个参数传入函数。
- @param out out
- @param t t
- */
- static invert(out: AffineTransform, t: AffineTransform): AffineTransform;
- /**
- !#en Get an AffineTransform object from a given matrix 4x4.
- This function is memory free, you should create the output affine transform by yourself and manage its memory.
- !#zh 从一个 4x4 Matrix 获取 AffineTransform 对象。这个函数不创建任何内存,你需要先创建 AffineTransform 对象用来存储结果,并作为第一个参数传入函数。
- @param out out
- @param mat mat
- */
- static invert(out: AffineTransform, mat: Mat4): AffineTransform;
- /**
- !#en Apply the affine transformation on a point.
- This function is memory free, you should create the output Vec2 by yourself and manage its memory.
- !#zh 对一个点应用矩阵变换。这个函数不创建任何内存,你需要先创建一个 Vec2 对象用来存储结果,并作为第一个参数传入函数。
- @param out The output point to store the result
- @param point Point to apply transform or x.
- @param transOrY transform matrix or y.
- @param t transform matrix.
- */
- static transformVec2(out: Vec2, point: Vec2|number, transOrY: AffineTransform|number, t?: AffineTransform): Vec2;
- /**
- !#en Apply the affine transformation on a size.
- This function is memory free, you should create the output Size by yourself and manage its memory.
- !#zh 应用仿射变换矩阵到 Size 上。这个函数不创建任何内存,你需要先创建一个 Size 对象用来存储结果,并作为第一个参数传入函数。
- @param out The output point to store the result
- @param size size
- @param t t
- */
- static transformSize(out: Size, size: Size, t: AffineTransform): Size;
- /**
- !#en Apply the affine transformation on a rect.
- This function is memory free, you should create the output Rect by yourself and manage its memory.
- !#zh 应用仿射变换矩阵到 Rect 上。这个函数不创建任何内存,你需要先创建一个 Rect 对象用来存储结果,并作为第一个参数传入函数。
- @param out out
- @param rect rect
- @param anAffineTransform anAffineTransform
- */
- static transformRect(out: Rect, rect: Rect, anAffineTransform: AffineTransform): Rect;
- /**
- !#en Apply the affine transformation on a rect, and truns to an Oriented Bounding Box.
- This function is memory free, you should create the output vectors by yourself and manage their memory.
- !#zh 应用仿射变换矩阵到 Rect 上, 并转换为有向包围盒。这个函数不创建任何内存,你需要先创建包围盒的四个 Vector 对象用来存储结果,并作为前四个参数传入函数。
- @param out_bl out_bl
- @param out_tl out_tl
- @param out_tr out_tr
- @param out_br out_br
- @param rect rect
- @param anAffineTransform anAffineTransform
- */
- static transformObb(out_bl: Vec2, out_tl: Vec2, out_tr: Vec2, out_br: Vec2, rect: Rect, anAffineTransform: AffineTransform): void;
- }
- /** A base node for CCNode, it will:
- - maintain scene hierarchy and active logic
- - notifications if some properties changed
- - define some interfaces shares between CCNode
- - define machanisms for Enity Component Systems
- - define prefab and serialize functions */
- export class _BaseNode extends Object implements EventTarget {
- /** !#en Name of node.
- !#zh 该节点名称。 */
- name: string;
- /** !#en The uuid for editor, will be stripped before building project.
- !#zh 主要用于编辑器的 uuid,在编辑器下可用于持久化存储,在项目构建之后将变成自增的 id。 */
- uuid: string;
- /** !#en All children nodes.
- !#zh 节点的所有子节点。 */
- children: Node[];
- /** !#en All children nodes.
- !#zh 节点的子节点数量。 */
- childrenCount: number;
- /** !#en
- The local active state of this node.<br/>
- Note that a Node may be inactive because a parent is not active, even if this returns true.<br/>
- Use {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}} if you want to check if the Node is actually treated as active in the scene.
- !#zh
- 当前节点的自身激活状态。<br/>
- 值得注意的是,一个节点的父节点如果不被激活,那么即使它自身设为激活,它仍然无法激活。<br/>
- 如果你想检查节点在场景中实际的激活状态可以使用 {{#crossLink "Node/activeInHierarchy:property"}}{{/crossLink}}。 */
- active: boolean;
- /** !#en Indicates whether this node is active in the scene.
- !#zh 表示此节点是否在场景中激活。 */
- activeInHierarchy: boolean;
- /**
-
- @param name name
- */
- constructor(name?: string);
- /** !#en The parent of the node.
- !#zh 该节点的父节点。 */
- parent: Node;
- /**
- !#en Get parent of the node.
- !#zh 获取该节点的父节点。
-
- @example
- ```js
- var parent = this.node.getParent();
- ```
- */
- getParent(): Node;
- /**
- !#en Set parent of the node.
- !#zh 设置该节点的父节点。
- @param value value
-
- @example
- ```js
- node.setParent(newNode);
- ```
- */
- setParent(value: Node): void;
- /**
- !#en
- Properties configuration function <br/>
- All properties in attrs will be set to the node, <br/>
- when the setter of the node is available, <br/>
- the property will be set via setter function.<br/>
- !#zh 属性配置函数。在 attrs 的所有属性将被设置为节点属性。
- @param attrs Properties to be set to node
-
- @example
- ```js
- var attrs = { key: 0, num: 100 };
- node.attr(attrs);
- ```
- */
- attr(attrs: any): void;
- /**
- !#en Returns a child from the container given its uuid.
- !#zh 通过 uuid 获取节点的子节点。
- @param uuid The uuid to find the child node.
-
- @example
- ```js
- var child = node.getChildByUuid(uuid);
- ```
- */
- getChildByUuid(uuid: string): Node;
- /**
- !#en Returns a child from the container given its name.
- !#zh 通过名称获取节点的子节点。
- @param name A name to find the child node.
-
- @example
- ```js
- var child = node.getChildByName("Test Node");
- ```
- */
- getChildByName(name: string): Node;
- /**
- !#en
- Inserts a child to the node at a specified index.
- !#zh
- 插入子节点到指定位置
- @param child the child node to be inserted
- @param siblingIndex the sibling index to place the child in
-
- @example
- ```js
- node.insertChild(child, 2);
- ```
- */
- insertChild(child: Node, siblingIndex: number): void;
- /**
- !#en Get the sibling index.
- !#zh 获取同级索引。
-
- @example
- ```js
- var index = node.getSiblingIndex();
- ```
- */
- getSiblingIndex(): number;
- /**
- !#en Set the sibling index of this node.
- !#zh 设置节点同级索引。
- @param index index
-
- @example
- ```js
- node.setSiblingIndex(1);
- ```
- */
- setSiblingIndex(index: number): void;
- /**
- !#en Walk though the sub children tree of the current node.
- Each node, including the current node, in the sub tree will be visited two times, before all children and after all children.
- This function call is not recursive, it's based on stack.
- Please don't walk any other node inside the walk process.
- !#zh 遍历该节点的子树里的所有节点并按规则执行回调函数。
- 对子树中的所有节点,包含当前节点,会执行两次回调,prefunc 会在访问它的子节点之前调用,postfunc 会在访问所有子节点之后调用。
- 这个函数的实现不是基于递归的,而是基于栈展开递归的方式。
- 请不要在 walk 过程中对任何其他的节点嵌套执行 walk。
- @param prefunc The callback to process node when reach the node for the first time
- @param postfunc The callback to process node when re-visit the node after walked all children in its sub tree
-
- @example
- ```js
- node.walk(function (target) {
- console.log('Walked through node ' + target.name + ' for the first time');
- }, function (target) {
- console.log('Walked through node ' + target.name + ' after walked all children in its sub tree');
- });
- ```
- */
- walk(prefunc: (target: _BaseNode) => void, postfunc: (target: _BaseNode) => void): void;
- /**
- !#en
- Remove itself from its parent node. If cleanup is `true`, then also remove all events and actions. <br/>
- If the cleanup parameter is not passed, it will force a cleanup, so it is recommended that you always pass in the `false` parameter when calling this API.<br/>
- If the node orphan, then nothing happens.
- !#zh
- 从父节点中删除该节点。如果不传入 cleanup 参数或者传入 `true`,那么这个节点上所有绑定的事件、action 都会被删除。<br/>
- 因此建议调用这个 API 时总是传入 `false` 参数。<br/>
- 如果这个节点是一个孤节点,那么什么都不会发生。
- @param cleanup true if all actions and callbacks on this node should be removed, false otherwise.
-
- @example
- ```js
- node.removeFromParent();
- node.removeFromParent(false);
- ```
- */
- removeFromParent(cleanup?: boolean): void;
- /**
- !#en
- Removes a child from the container. It will also cleanup all running actions depending on the cleanup parameter. </p>
- If the cleanup parameter is not passed, it will force a cleanup. <br/>
- "remove" logic MUST only be on this method <br/>
- If a class wants to extend the 'removeChild' behavior it only needs <br/>
- to override this method.
- !#zh
- 移除节点中指定的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。<br/>
- 如果 cleanup 参数不传入,默认为 true 表示清理。<br/>
- @param child The child node which will be removed.
- @param cleanup true if all running actions and callbacks on the child node will be cleanup, false otherwise.
-
- @example
- ```js
- node.removeChild(newNode);
- node.removeChild(newNode, false);
- ```
- */
- removeChild(child: Node, cleanup?: boolean): void;
- /**
- !#en
- Removes all children from the container and do a cleanup all running actions depending on the cleanup parameter. <br/>
- If the cleanup parameter is not passed, it will force a cleanup.
- !#zh
- 移除节点所有的子节点,是否需要清理所有正在运行的行为取决于 cleanup 参数。<br/>
- 如果 cleanup 参数不传入,默认为 true 表示清理。
- @param cleanup true if all running actions on all children nodes should be cleanup, false otherwise.
-
- @example
- ```js
- node.removeAllChildren();
- node.removeAllChildren(false);
- ```
- */
- removeAllChildren(cleanup?: boolean): void;
- /**
- !#en Is this node a child of the given node?
- !#zh 是否是指定节点的子节点?
- @param parent parent
-
- @example
- ```js
- node.isChildOf(newNode);
- ```
- */
- isChildOf(parent: Node): boolean;
- /**
- !#en
- Returns the component of supplied type if the node has one attached, null if it doesn't.<br/>
- You can also get component in the node by passing in the name of the script.
- !#zh
- 获取节点上指定类型的组件,如果节点有附加指定类型的组件,则返回,如果没有则为空。<br/>
- 传入参数也可以是脚本的名称。
- @param typeOrClassName typeOrClassName
-
- @example
- ```js
- // get sprite component
- var sprite = node.getComponent(cc.Sprite);
- // get custom test class
- var test = node.getComponent("Test");
- ```
- */
- getComponent<T extends Component>(type: {prototype: T}): T;
- getComponent(className: string): any;
- /**
- !#en Returns all components of supplied type in the node.
- !#zh 返回节点上指定类型的所有组件。
- @param typeOrClassName typeOrClassName
-
- @example
- ```js
- var sprites = node.getComponents(cc.Sprite);
- var tests = node.getComponents("Test");
- ```
- */
- getComponents<T extends Component>(type: {prototype: T}): T[];
- getComponents(className: string): any[];
- /**
- !#en Returns the component of supplied type in any of its children using depth first search.
- !#zh 递归查找所有子节点中第一个匹配指定类型的组件。
- @param typeOrClassName typeOrClassName
-
- @example
- ```js
- var sprite = node.getComponentInChildren(cc.Sprite);
- var Test = node.getComponentInChildren("Test");
- ```
- */
- getComponentInChildren<T extends Component>(type: {prototype: T}): T;
- getComponentInChildren(className: string): any;
- /**
- !#en Returns all components of supplied type in self or any of its children.
- !#zh 递归查找自身或所有子节点中指定类型的组件
- @param typeOrClassName typeOrClassName
-
- @example
- ```js
- var sprites = node.getComponentsInChildren(cc.Sprite);
- var tests = node.getComponentsInChildren("Test");
- ```
- */
- getComponentsInChildren<T extends Component>(type: {prototype: T}): T[];
- getComponentsInChildren(className: string): any[];
- /**
- !#en Adds a component class to the node. You can also add component to node by passing in the name of the script.
- !#zh 向节点添加一个指定类型的组件类,你还可以通过传入脚本的名称来添加组件。
- @param typeOrClassName The constructor or the class name of the component to add
-
- @example
- ```js
- var sprite = node.addComponent(cc.Sprite);
- var test = node.addComponent("Test");
- ```
- */
- addComponent<T extends Component>(type: {new(): T}): T;
- addComponent(className: string): any;
- /**
- !#en
- Removes a component identified by the given name or removes the component object given.
- You can also use component.destroy() if you already have the reference.
- !#zh
- 删除节点上的指定组件,传入参数可以是一个组件构造函数或组件名,也可以是已经获得的组件引用。
- 如果你已经获得组件引用,你也可以直接调用 component.destroy()
- @param component The need remove component.
-
- @example
- ```js
- node.removeComponent(cc.Sprite);
- var Test = require("Test");
- node.removeComponent(Test);
- ```
- */
- removeComponent(component: string|Function|Component): void;
- /**
- !#en
- Destroy all children from the node, and release all their own references to other objects.<br/>
- Actual destruct operation will delayed until before rendering.
- !#zh
- 销毁所有子节点,并释放所有它们对其它对象的引用。<br/>
- 实际销毁操作会延迟到当前帧渲染前执行。
-
- @example
- ```js
- node.destroyAllChildren();
- ```
- */
- destroyAllChildren(): void;
- /**
- !#en Checks whether the EventTarget object has any callback registered for a specific type of event.
- !#zh 检查事件目标对象是否有为特定类型的事件注册的回调。
- @param type The type of event.
- */
- hasEventListener(type: string): boolean;
- /**
- !#en
- Register an callback of a specific event type on the EventTarget.
- This type of event should be triggered via `emit`.
- !#zh
- 注册事件目标的特定事件类型回调。这种类型的事件应该被 `emit` 触发。
- @param type A string representing the event type to listen for.
- @param callback The callback that will be invoked when the event is dispatched.
- The callback is ignored if it is a duplicate (the callbacks are unique).
- @param target The target (this object) to invoke the callback, can be null
-
- @example
- ```js
- eventTarget.on('fire', function () {
- cc.log("fire in the hole");
- }, node);
- ```
- */
- on<T extends Function>(type: string, callback: T, target?: any, useCapture?: boolean): T;
- /**
- !#en
- Removes the listeners previously registered with the same type, callback, target and or useCapture,
- if only type is passed as parameter, all listeners registered with that type will be removed.
- !#zh
- 删除之前用同类型,回调,目标或 useCapture 注册的事件监听器,如果只传递 type,将会删除 type 类型的所有事件监听器。
- @param type A string representing the event type being removed.
- @param callback The callback to remove.
- @param target The target (this object) to invoke the callback, if it's not given, only callback without target will be removed
-
- @example
- ```js
- // register fire eventListener
- var callback = eventTarget.on('fire', function () {
- cc.log("fire in the hole");
- }, target);
- // remove fire event listener
- eventTarget.off('fire', callback, target);
- // remove all fire event listeners
- eventTarget.off('fire');
- ```
- */
- off(type: string, callback?: Function, target?: any): void;
- /**
- !#en Removes all callbacks previously registered with the same target (passed as parameter).
- This is not for removing all listeners in the current event target,
- and this is not for removing all listeners the target parameter have registered.
- It's only for removing all listeners (callback and target couple) registered on the current event target by the target parameter.
- !#zh 在当前 EventTarget 上删除指定目标(target 参数)注册的所有事件监听器。
- 这个函数无法删除当前 EventTarget 的所有事件监听器,也无法删除 target 参数所注册的所有事件监听器。
- 这个函数只能删除 target 参数在当前 EventTarget 上注册的所有事件监听器。
- @param target The target to be searched for all related listeners
- */
- targetOff(target: any): void;
- /**
- !#en
- Register an callback of a specific event type on the EventTarget,
- the callback will remove itself after the first time it is triggered.
- !#zh
- 注册事件目标的特定事件类型回调,回调会在第一时间被触发后删除自身。
- @param type A string representing the event type to listen for.
- @param callback The callback that will be invoked when the event is dispatched.
- The callback is ignored if it is a duplicate (the callbacks are unique).
- @param target The target (this object) to invoke the callback, can be null
-
- @example
- ```js
- eventTarget.once('fire', function () {
- cc.log("this is the callback and will be invoked only once");
- }, node);
- ```
- */
- once(type: string, callback: (arg1?: any, arg2?: any, arg3?: any, arg4?: any, arg5?: any) => void, target?: any): void;
- /**
- !#en
- Send an event with the event object.
- !#zh
- 通过事件对象派发事件
- @param event event
- */
- dispatchEvent(event: Event): void;
- }
- /** misc utilities */
- export class misc {
- /**
- !#en Clamp a value between from and to.
- !#zh
- 限定浮点数的最大最小值。<br/>
- 数值大于 max_inclusive 则返回 max_inclusive。<br/>
- 数值小于 min_inclusive 则返回 min_inclusive。<br/>
- 否则返回自身。
- @param value value
- @param min_inclusive min_inclusive
- @param max_inclusive max_inclusive
-
- @example
- ```js
- var v1 = cc.misc.clampf(20, 0, 20); // 20;
- var v2 = cc.misc.clampf(-1, 0, 20); // 0;
- var v3 = cc.misc.clampf(10, 0, 20); // 10;
- ```
- */
- static clampf(value: number, min_inclusive: number, max_inclusive: number): number;
- /**
- !#en Clamp a value between 0 and 1.
- !#zh 限定浮点数的取值范围为 0 ~ 1 之间。
- @param value value
-
- @example
- ```js
- var v1 = cc.misc.clamp01(20); // 1;
- var v2 = cc.misc.clamp01(-1); // 0;
- var v3 = cc.misc.clamp01(0.5); // 0.5;
- ```
- */
- static clamp01(value: number): number;
- /**
- Linear interpolation between 2 numbers, the ratio sets how much it is biased to each end
- @param a number A
- @param b number B
- @param r ratio between 0 and 1
-
- @example
- ```js
- ----
- lerp
- cc.misc.lerp(2,10,0.5)//returns 6
- cc.misc.lerp(2,10,0.2)//returns 3.6
-
- ```
- */
- static lerp(a: number, b: number, r: number): number;
- /**
- converts degrees to radians
- @param angle angle
- */
- static degreesToRadians(angle: number): number;
- /**
- converts radians to degrees
- @param angle angle
- */
- static radiansToDegrees(angle: number): number;
- }
- /** !#en
- Representation of RGBA colors.
-
- Each color component is a floating point value with a range from 0 to 255.
-
- You can also use the convenience method {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} to create a new Color.
-
- !#zh
- cc.Color 用于表示颜色。
-
- 它包含 RGBA 四个以浮点数保存的颜色分量,每个的值都在 0 到 255 之间。
-
- 您也可以通过使用 {{#crossLink "cc/color:method"}}cc.color{{/crossLink}} 的便捷方法来创建一个新的 Color。 */
- export class Color extends ValueType {
- /**
-
- @param r red component of the color, default value is 0.
- @param g green component of the color, defualt value is 0.
- @param b blue component of the color, default value is 0.
- @param a alpha component of the color, default value is 255.
- */
- constructor(r?: number, g?: number, b?: number, a?: number);
- /** !#en Solid white, RGBA is [255, 255, 255, 255].
- !#zh 纯白色,RGBA 是 [255, 255, 255, 255]。 */
- static WHITE: Color;
- /** !#en Solid black, RGBA is [0, 0, 0, 255].
- !#zh 纯黑色,RGBA 是 [0, 0, 0, 255]。 */
- static BLACK: Color;
- /** !#en Transparent, RGBA is [0, 0, 0, 0].
- !#zh 透明,RGBA 是 [0, 0, 0, 0]。 */
- static TRANSPARENT: Color;
- /** !#en Grey, RGBA is [127.5, 127.5, 127.5].
- !#zh 灰色,RGBA 是 [127.5, 127.5, 127.5]。 */
- static GRAY: Color;
- /** !#en Solid red, RGBA is [255, 0, 0].
- !#zh 纯红色,RGBA 是 [255, 0, 0]。 */
- static RED: Color;
- /** !#en Solid green, RGBA is [0, 255, 0].
- !#zh 纯绿色,RGBA 是 [0, 255, 0]。 */
- static GREEN: Color;
- /** !#en Solid blue, RGBA is [0, 0, 255].
- !#zh 纯蓝色,RGBA 是 [0, 0, 255]。 */
- static BLUE: Color;
- /** !#en Yellow, RGBA is [255, 235, 4].
- !#zh 黄色,RGBA 是 [255, 235, 4]。 */
- static YELLOW: Color;
- /** !#en Orange, RGBA is [255, 127, 0].
- !#zh 橙色,RGBA 是 [255, 127, 0]。 */
- static ORANGE: Color;
- /** !#en Cyan, RGBA is [0, 255, 255].
- !#zh 青色,RGBA 是 [0, 255, 255]。 */
- static CYAN: Color;
- /** !#en Magenta, RGBA is [255, 0, 255].
- !#zh 洋红色(品红色),RGBA 是 [255, 0, 255]。 */
- static MAGENTA: Color;
- /**
- !#en Clone a new color from the current color.
- !#zh 克隆当前颜色。
-
- @example
- ```js
- var color = new cc.Color();
- var newColor = color.clone();// Color {r: 0, g: 0, b: 0, a: 255}
- ```
- */
- clone(): Color;
- /**
- !#en TODO
- !#zh 判断两个颜色是否相等。
- @param other other
-
- @example
- ```js
- var color1 = cc.Color.WHITE;
- var color2 = new cc.Color(255, 255, 255);
- cc.log(color1.equals(color2)); // true;
- color2 = cc.Color.RED;
- cc.log(color2.equals(color1)); // false;
- ```
- */
- equals(other: Color): boolean;
- /**
- !#en TODO
- !#zh 线性插值
- @param to to
- @param ratio the interpolation coefficient.
- @param out optional, the receiving vector.
-
- @example
- ```js
- // Converts a white color to a black one trough time.
- update: function (dt) {
- var color = this.node.color;
- if (color.equals(cc.Color.BLACK)) {
- return;
- }
- this.ratio += dt * 0.1;
- this.node.color = cc.Color.WHITE.lerp(cc.Color.BLACK, ratio);
- }
-
- ```
- */
- lerp(to: Color, ratio: number, out?: Color): Color;
- /**
- !#en TODO
- !#zh 转换为方便阅读的字符串。
-
- @example
- ```js
- var color = cc.Color.WHITE;
- color.toString(); // "rgba(255, 255, 255, 255)"
- ```
- */
- toString(): string;
- /**
- !#en Gets red channel value
- !#zh 获取当前颜色的红色值。
- */
- getR(): number;
- /**
- !#en Sets red value and return the current color object
- !#zh 设置当前的红色值,并返回当前对象。
- @param red the new Red component.
-
- @example
- ```js
- var color = new cc.Color();
- color.setR(255); // Color {r: 255, g: 0, b: 0, a: 255}
- ```
- */
- setR(red: number): Color;
- /**
- !#en Gets green channel value
- !#zh 获取当前颜色的绿色值。
- */
- getG(): number;
- /**
- !#en Sets green value and return the current color object
- !#zh 设置当前的绿色值,并返回当前对象。
- @param green the new Green component.
-
- @example
- ```js
- var color = new cc.Color();
- color.setG(255); // Color {r: 0, g: 255, b: 0, a: 255}
- ```
- */
- setG(green: number): Color;
- /**
- !#en Gets blue channel value
- !#zh 获取当前颜色的蓝色值。
- */
- getB(): number;
- /**
- !#en Sets blue value and return the current color object
- !#zh 设置当前的蓝色值,并返回当前对象。
- @param blue the new Blue component.
-
- @example
- ```js
- var color = new cc.Color();
- color.setB(255); // Color {r: 0, g: 0, b: 255, a: 255}
- ```
- */
- setB(blue: number): Color;
- /**
- !#en Gets alpha channel value
- !#zh 获取当前颜色的透明度值。
- */
- getA(): number;
- /**
- !#en Sets alpha value and return the current color object
- !#zh 设置当前的透明度,并返回当前对象。
- @param alpha the new Alpha component.
-
- @example
- ```js
- var color = new cc.Color();
- color.setA(0); // Color {r: 0, g: 0, b: 0, a: 0}
- ```
- */
- setA(alpha: number): Color;
- /**
- !#en Convert color to css format.
- !#zh 转换为 CSS 格式。
- @param opt "rgba", "rgb", "#rgb" or "#rrggbb".
-
- @example
- ```js
- var color = cc.Color.BLACK;
- color.toCSS(); // "#000";
- color.toCSS("rgba"); // "rgba(0,0,0,1.00)";
- color.toCSS("rgb"); // "rgba(0,0,0)";
- color.toCSS("#rgb"); // "#000";
- color.toCSS("#rrggbb"); // "#000000";
- ```
- */
- toCSS(opt: string): string;
- /**
- !#en Read hex string and store color data into the current color object, the hex string must be formated as rgba or rgb.
- !#zh 读取 16 进制颜色。
- @param hexString hexString
-
- @example
- ```js
- var color = cc.Color.BLACK;
- color.fromHEX("#FFFF33"); // Color {r: 255, g: 255, b: 51, a: 255};
- ```
- */
- fromHEX(hexString: string): Color;
- /**
- !#en convert Color to HEX color string.
- e.g. cc.color(255,6,255) to : "#ff06ff"
- !#zh 转换为 16 进制。
- @param fmt "#rgb", "#rrggbb" or "#rrggbbaa".
-
- @example
- ```js
- var color = cc.Color.BLACK;
- color.toHEX("#rgb"); // "000";
- color.toHEX("#rrggbb"); // "000000";
- ```
- */
- toHEX(fmt: string): string;
- /**
- !#en Convert to 24bit rgb value.
- !#zh 转换为 24bit 的 RGB 值。
-
- @example
- ```js
- var color = cc.Color.YELLOW;
- color.toRGBValue(); // 16771844;
- ```
- */
- toRGBValue(): number;
- /**
- !#en Read HSV model color and convert to RGB color
- !#zh 读取 HSV(色彩模型)格式。
- @param h h
- @param s s
- @param v v
-
- @example
- ```js
- var color = cc.Color.YELLOW;
- color.fromHSV(0, 0, 1); // Color {r: 255, g: 255, b: 255, a: 255};
- ```
- */
- fromHSV(h: number, s: number, v: number): Color;
- /**
- !#en Transform to HSV model color
- !#zh 转换为 HSV(色彩模型)格式。
-
- @example
- ```js
- var color = cc.Color.YELLOW;
- color.toHSV(); // Object {h: 0.1533864541832669, s: 0.9843137254901961, v: 1};
- ```
- */
- toHSV(): any;
- }
- /** !#en Representation of 4*4 matrix.
- !#zh 表示 4*4 矩阵 */
- export class Mat4 extends ValueType {
- /**
- !#en
- Constructor
- see {{#crossLink "cc/mat4:method"}}cc.mat4{{/crossLink}}
- !#zh
- 构造函数,可查看 {{#crossLink "cc/mat4:method"}}cc.mat4{{/crossLink}}
- @param m00 Component in column 0, row 0 position (index 0)
- @param m01 Component in column 0, row 1 position (index 1)
- @param m02 Component in column 0, row 2 position (index 2)
- @param m03 Component in column 0, row 3 position (index 3)
- @param m10 Component in column 1, row 0 position (index 4)
- @param m11 Component in column 1, row 1 position (index 5)
- @param m12 Component in column 1, row 2 position (index 6)
- @param m13 Component in column 1, row 3 position (index 7)
- @param m20 Component in column 2, row 0 position (index 8)
- @param m21 Component in column 2, row 1 position (index 9)
- @param m22 Component in column 2, row 2 position (index 10)
- @param m23 Component in column 2, row 3 position (index 11)
- @param m30 Component in column 3, row 0 position (index 12)
- @param m31 Component in column 3, row 1 position (index 13)
- @param m32 Component in column 3, row 2 position (index 14)
- @param m33 Component in column 3, row 3 position (index 15)
- */
- constructor(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number);
- /**
- !#en clone a Mat4 object
- !#zh 克隆一个 Mat4 对象
- */
- clone(): Mat4;
- /**
- !#en Sets the matrix with another one's value
- !#zh 用另一个矩阵设置这个矩阵的值。
- @param srcObj srcObj
- */
- set(srcObj: Mat4): Mat4;
- /**
- !#en Check whether two matrix equal
- !#zh 当前的矩阵是否与指定的矩阵相等。
- @param other other
- */
- equals(other: Mat4): boolean;
- /**
- !#en Check whether two matrix equal with default degree of variance.
- !#zh
- 近似判断两个矩阵是否相等。<br/>
- 判断 2 个矩阵是否在默认误差范围之内,如果在则返回 true,反之则返回 false。
- @param other other
- */
- fuzzyEquals(other: Mat4): boolean;
- /**
- !#en Transform to string with matrix informations
- !#zh 转换为方便阅读的字符串。
- */
- toString(): string;
- /**
- Set the matrix to the identity matrix
- */
- identity(): Mat4;
- /**
- Transpose the values of a mat4
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created.
- */
- transpose(out?: Mat4): Mat4;
- /**
- Inverts a mat4
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created.
- */
- invert(out?: Mat4): Mat4;
- /**
- Calculates the adjugate of a mat4
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created.
- */
- adjoint(out?: Mat4): Mat4;
- /**
- Calculates the determinant of a mat4
- */
- determinant(): number;
- /**
- Adds two Mat4
- @param other the second operand
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created.
- */
- add(other: Mat4, out?: Mat4): Mat4;
- /**
- Subtracts the current matrix with another one
- @param other the second operand
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- sub(other: Mat4, out?: Mat4): Mat4;
- /**
- Subtracts the current matrix with another one
- @param other the second operand
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- mul(other: Mat4, out?: Mat4): Mat4;
- /**
- Multiply each element of the matrix by a scalar.
- @param number amount to scale the matrix's elements by
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- mulScalar(number: number, out?: Mat4): Mat4;
- /**
- Translate a mat4 by the given vector
- @param v vector to translate by
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- translate(v: Vec3, out?: Mat4): Mat4;
- /**
- Scales the mat4 by the dimensions in the given vec3
- @param v vector to scale by
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- scale(v: Vec3, out?: Mat4): Mat4;
- /**
- Rotates a mat4 by the given angle around the given axis
- @param rad the angle to rotate the matrix by
- @param axis the axis to rotate around
- @param out the receiving matrix, you can pass the same matrix to save result to itself, if not provided, a new matrix will be created
- */
- rotate(rad: number, axis: Vec3, out?: Mat4): Mat4;
- /**
- Returns the translation vector component of a transformation matrix.
- @param out Vector to receive translation component, if not provided, a new vec3 will be created
- */
- getTranslation(out: Vec3): Vec3;
- /**
- Returns the scale factor component of a transformation matrix
- @param out Vector to receive scale component, if not provided, a new vec3 will be created
- */
- getScale(out: Vec3): Vec3;
- /**
- Returns the rotation factor component of a transformation matrix
- @param out Vector to receive rotation component, if not provided, a new quaternion object will be created
- */
- getRotation(out: Quat): Quat;
- /**
- Restore the matrix values from a quaternion rotation, vector translation and vector scale
- @param q Rotation quaternion
- @param v Translation vector
- @param s Scaling vector
- */
- fromRTS(q: Quat, v: Vec3, s: Vec3): Mat4;
- /**
- Restore the matrix values from a quaternion rotation
- @param q Rotation quaternion
- */
- fromQuat(q: Quat): Mat4;
- }
- /** !#en A 2D rectangle defined by x, y position and width, height.
- !#zh 通过位置和宽高定义的 2D 矩形。 */
- export class Rect extends ValueType {
- /**
- !#en
- Constructor of Rect class.
- see {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} for convenience method.
- !#zh
- Rect类的构造函数。可以通过 {{#crossLink "cc/rect:method"}} cc.rect {{/crossLink}} 简便方法进行创建。
- @param x x
- @param y y
- @param w w
- @param h h
- */
- constructor(x?: number, y?: number, w?: number, h?: number);
- x: number;
- y: number;
- width: number;
- height: number;
- /**
- !#en Creates a rectangle from two coordinate values.
- !#zh 根据指定 2 个坐标创建出一个矩形区域。
- @param v1 v1
- @param v2 v2
-
- @example
- ```js
- cc.Rect.fromMinMax(cc.v2(10, 10), cc.v2(20, 20)); // Rect {x: 10, y: 10, width: 10, height: 10};
- ```
- */
- static fromMinMax(v1: Vec2, v2: Vec2): Rect;
- /**
- !#en TODO
- !#zh 克隆一个新的 Rect。
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- a.clone();// Rect {x: 0, y: 0, width: 10, height: 10}
- ```
- */
- clone(): Rect;
- /**
- !#en TODO
- !#zh 是否等于指定的矩形。
- @param other other
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- var b = new cc.Rect(0, 0, 10, 10);
- a.equals(b);// true;
- ```
- */
- equals(other: Rect): boolean;
- /**
- !#en TODO
- !#zh 线性插值
- @param to to
- @param ratio the interpolation coefficient.
- @param out optional, the receiving vector.
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- var b = new cc.Rect(50, 50, 100, 100);
- update (dt) {
- // method 1;
- var c = a.lerp(b, dt * 0.1);
- // method 2;
- a.lerp(b, dt * 0.1, c);
- }
- ```
- */
- lerp(to: Rect, ratio: number, out?: Rect): Rect;
- /**
- !#en Check whether the current rectangle intersects with the given one
- !#zh 当前矩形与指定矩形是否相交。
- @param rect rect
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- var b = new cc.Rect(0, 0, 20, 20);
- a.intersects(b);// true
- ```
- */
- intersects(rect: Rect): boolean;
- /**
- !#en Returns the overlapping portion of 2 rectangles.
- !#zh 返回 2 个矩形重叠的部分。
- @param out Stores the result
- @param rectB rectB
-
- @example
- ```js
- var a = new cc.Rect(0, 10, 20, 20);
- var b = new cc.Rect(0, 10, 10, 10);
- var intersection = new cc.Rect();
- a.intersection(intersection, b); // intersection {x: 0, y: 10, width: 10, height: 10};
- ```
- */
- intersection(out: Rect, rectB: Rect): Rect;
- /**
- !#en Check whether the current rect contains the given point
- !#zh 当前矩形是否包含指定坐标点。
- Returns true if the point inside this rectangle.
- @param point point
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- var b = new cc.Vec2(0, 5);
- a.contains(b);// true
- ```
- */
- contains(point: Vec2): boolean;
- /**
- !#en Returns true if the other rect totally inside this rectangle.
- !#zh 当前矩形是否包含指定矩形。
- @param rect rect
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 20, 20);
- var b = new cc.Rect(0, 0, 10, 10);
- a.containsRect(b);// true
- ```
- */
- containsRect(rect: Rect): boolean;
- /**
- !#en Returns the smallest rectangle that contains the current rect and the given rect.
- !#zh 返回一个包含当前矩形和指定矩形的最小矩形。
- @param out Stores the result
- @param rectB rectB
-
- @example
- ```js
- var a = new cc.Rect(0, 10, 20, 20);
- var b = new cc.Rect(0, 10, 10, 10);
- var union = new cc.Rect();
- a.union(union, b); // union {x: 0, y: 10, width: 20, height: 20};
- ```
- */
- union(out: Rect, rectB: Rect): Rect;
- /**
- !#en Apply matrix4 to the rect.
- !#zh 使用 mat4 对矩形进行矩阵转换。
- @param out The output rect
- @param mat The matrix4
- */
- transformMat4(out: Rect, mat: Mat4): void;
- /**
- !#en Output rect informations to string
- !#zh 转换为方便阅读的字符串
-
- @example
- ```js
- var a = new cc.Rect(0, 0, 10, 10);
- a.toString();// "(0.00, 0.00, 10.00, 10.00)";
- ```
- */
- toString(): string;
- /** !#en The minimum x value, equals to rect.x
- !#zh 矩形 x 轴上的最小值,等价于 rect.x。 */
- xMin: number;
- /** !#en The minimum y value, equals to rect.y
- !#zh 矩形 y 轴上的最小值。 */
- yMin: number;
- /** !#en The maximum x value.
- !#zh 矩形 x 轴上的最大值。 */
- xMax: number;
- /** !#en The maximum y value.
- !#zh 矩形 y 轴上的最大值。 */
- yMax: number;
- /** !#en The position of the center of the rectangle.
- !#zh 矩形的中心点。 */
- center: Vec2;
- /** !#en The X and Y position of the rectangle.
- !#zh 矩形的 x 和 y 坐标。 */
- origin: Vec2;
- /** !#en Width and height of the rectangle.
- !#zh 矩形的大小。 */
- size: Size;
- }
- /** !#en Representation of 2D vectors and points.
- !#zh 表示 2D 向量和坐标 */
- export class Quat extends ValueType {
- /**
- !#en
- Constructor
- see {{#crossLink "cc/quat:method"}}cc.quat{{/crossLink}}
- !#zh
- 构造函数,可查看 {{#crossLink "cc/quat:method"}}cc.quat{{/crossLink}}
- @param x x
- @param y y
- @param z z
- @param w w
- */
- constructor(x?: number, y?: number, z?: number, w?: number);
- x: number;
- y: number;
- z: number;
- w: number;
- /**
- !#en clone a Quat object and return the new object
- !#zh 克隆一个四元数并返回
- */
- clone(): Quat;
- /**
- !#en Set values with another quaternion
- !#zh 用另一个四元数的值设置到当前对象上。
- @param newValue !#en new value to set. !#zh 要设置的新值
- */
- set(newValue: Quat): Quat;
- /**
- !#en Check whether current quaternion equals another
- !#zh 当前的四元数是否与指定的四元数相等。
- @param other other
- */
- equals(other: Quat): boolean;
- /**
- !#en Convert quaternion to euler
- !#zh 转换四元数到欧拉角
- @param out out
- */
- toEuler(out: Vec3): Vec3;
- /**
- !#en Convert euler to quaternion
- !#zh 转换欧拉角到四元数
- @param euler euler
- */
- fromEuler(euler: Vec3): Quat;
- /**
- !#en Calculate the interpolation result between this quaternion and another one with given ratio
- !#zh 计算四元数的插值结果
- @param to to
- @param ratio ratio
- @param out out
- */
- lerp(to: Quat, ratio: number, out?: Quat): Quat;
- /**
- !#en Calculate the multiply result between this quaternion and another one
- !#zh 计算四元数乘积的结果
- @param to to
- @param ratio ratio
- @param out out
- */
- lerp(to: Quat, ratio: number, out?: Quat): Quat;
- /**
- !#en Rotates a quaternion by the given angle (in radians) about a world space axis.
- !#zh 围绕世界空间轴按给定弧度旋转四元数
- @param rot Quaternion to rotate
- @param axis The axis around which to rotate in world space
- @param rad Angle (in radians) to rotate
- @param out Quaternion to store result
- */
- rotateAround(rot: Quat, axis: Vec3, rad: number, out?: Quat): Quat;
- }
- /** !#en
- cc.Size is the class for size object,<br/>
- please do not use its constructor to create sizes,<br/>
- use {{#crossLink "cc/size:method"}}{{/crossLink}} alias function instead.<br/>
- It will be deprecated soon, please use cc.Vec2 instead.
-
- !#zh
- cc.Size 是 size 对象的类。<br/>
- 请不要使用它的构造函数创建的 size,<br/>
- 使用 {{#crossLink "cc/size:method"}}{{/crossLink}} 别名函数。<br/>
- 它不久将被取消,请使用cc.Vec2代替。 */
- export class Size {
- /**
-
- @param width width
- @param height height
- */
- constructor(width: number|Size, height?: number);
- width: number;
- height: number;
- /** !#en return a Size object with width = 0 and height = 0.
- !#zh 返回一个宽度为 0 和高度为 0 的 Size 对象。 */
- static ZERO: Size;
- /**
- !#en TODO
- !#zh 克隆 size 对象。
-
- @example
- ```js
- var a = new cc.size(10, 10);
- a.clone();// return Size {width: 0, height: 0};
- ```
- */
- clone(): Size;
- /**
- !#en TODO
- !#zh 当前 Size 对象是否等于指定 Size 对象。
- @param other other
-
- @example
- ```js
- var a = new cc.size(10, 10);
- a.equals(new cc.size(10, 10));// return true;
- ```
- */
- equals(other: Size): boolean;
- /**
- !#en TODO
- !#zh 线性插值。
- @param to to
- @param ratio the interpolation coefficient.
- @param out optional, the receiving vector.
-
- @example
- ```js
- var a = new cc.size(10, 10);
- var b = new cc.rect(50, 50, 100, 100);
- update (dt) {
- // method 1;
- var c = a.lerp(b, dt * 0.1);
- // method 2;
- a.lerp(b, dt * 0.1, c);
- }
- ```
- */
- lerp(to: Rect, ratio: number, out?: Size): Size;
- /**
- !#en TODO
- !#zh 转换为方便阅读的字符串。
-
- @example
- ```js
- var a = new cc.size(10, 10);
- a.toString();// return "(10.00, 10.00)";
- ```
- */
- toString(): string;
- }
- /** !#en The base class of all value types.
- !#zh 所有值类型的基类。 */
- export class ValueType {
- /**
- !#en This method returns an exact copy of current value.
- !#zh 克隆当前值,该方法返回一个新对象,新对象的值和原对象相等。
- */
- clone(): ValueType;
- /**
- !#en Compares this object with the other one.
- !#zh 当前对象是否等于指定对象。
- @param other other
- */
- equals(other: ValueType): boolean;
- /**
- !#en
- Linearly interpolates between this value to to value by ratio which is in the range [0, 1].
- When ratio = 0 returns this. When ratio = 1 return to. When ratio = 0.5 returns the average of this and to.
- !#zh
- 线性插值。<br/>
- 当 ratio = 0 时返回自身,ratio = 1 时返回目标,ratio = 0.5 返回自身和目标的平均值。。
- @param to the to value
- @param ratio the interpolation coefficient
- */
- lerp(to: ValueType, ratio: number): ValueType;
- /**
- !#en
- Copys all the properties from another given object to this value.
- !#zh
- 从其它对象把所有属性复制到当前对象。
- @param source the source to copy
- */
- set(source: ValueType): void;
- /**
- !#en TODO
- !#zh 转换为方便阅读的字符串。
- */
- toString(): string;
- }
- /** !#en Representation of 2D vectors and points.
- !#zh 表示 2D 向量和坐标 */
- export class Vec2 extends ValueType {
- /**
- !#en
- Constructor
- see {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} or {{#crossLink "cc/p:method"}}cc.p{{/crossLink}}
- !#zh
- 构造函数,可查看 {{#crossLink "cc/vec2:method"}}cc.v2{{/crossLink}} 或者 {{#crossLink "cc/p:method"}}cc.p{{/crossLink}}
- @param x x
- @param y y
- */
- constructor(x?: number, y?: number);
- x: number;
- y: number;
- /**
- !#en clone a Vec2 object
- !#zh 克隆一个 Vec2 对象
- */
- clone(): Vec2;
- /**
- !#en Sets vector with another's value
- !#zh 设置向量值。
- @param newValue !#en new value to set. !#zh 要设置的新值
- */
- set(newValue: Vec2): Vec2;
- /**
- !#en Check whether two vector equal
- !#zh 当前的向量是否与指定的向量相等。
- @param other other
- */
- equals(other: Vec2): boolean;
- /**
- !#en Check whether two vector equal with some degree of variance.
- !#zh
- 近似判断两个点是否相等。<br/>
- 判断 2 个向量是否在指定数值的范围之内,如果在则返回 true,反之则返回 false。
- @param other other
- @param variance variance
- */
- fuzzyEquals(other: Vec2, variance: number): boolean;
- /**
- !#en Transform to string with vector informations
- !#zh 转换为方便阅读的字符串。
- */
- toString(): string;
- /**
- !#en Calculate linear interpolation result between this vector and another one with given ratio
- !#zh 线性插值。
- @param to to
- @param ratio the interpolation coefficient
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
- */
- lerp(to: Vec2, ratio: number, out?: Vec2): Vec2;
- /**
- !#en Clamp the vector between from float and to float.
- !#zh
- 返回指定限制区域后的向量。<br/>
- 向量大于 max_inclusive 则返回 max_inclusive。<br/>
- 向量小于 min_inclusive 则返回 min_inclusive。<br/>
- 否则返回自身。
- @param min_inclusive min_inclusive
- @param max_inclusive max_inclusive
-
- @example
- ```js
- var min_inclusive = cc.v2(0, 0);
- var max_inclusive = cc.v2(20, 20);
- var v1 = cc.v2(20, 20).clampf(min_inclusive, max_inclusive); // Vec2 {x: 20, y: 20};
- var v2 = cc.v2(0, 0).clampf(min_inclusive, max_inclusive); // Vec2 {x: 0, y: 0};
- var v3 = cc.v2(10, 10).clampf(min_inclusive, max_inclusive); // Vec2 {x: 10, y: 10};
- ```
- */
- clampf(min_inclusive: Vec2, max_inclusive: Vec2): Vec2;
- /**
- !#en Adds this vector. If you want to save result to another vector, use add() instead.
- !#zh 向量加法。如果你想保存结果到另一个向量,使用 add() 代替。
- @param vector vector
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.addSelf(cc.v2(5, 5));// return Vec2 {x: 15, y: 15};
- ```
- */
- addSelf(vector: Vec2): Vec2;
- /**
- !#en Adds two vectors, and returns the new result.
- !#zh 向量加法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.add(cc.v2(5, 5)); // return Vec2 {x: 15, y: 15};
- var v1;
- v.add(cc.v2(5, 5), v1); // return Vec2 {x: 15, y: 15};
- ```
- */
- add(vector: Vec2, out?: Vec2): Vec2;
- /**
- !#en Subtracts one vector from this. If you want to save result to another vector, use sub() instead.
- !#zh 向量减法。如果你想保存结果到另一个向量,可使用 sub() 代替。
- @param vector vector
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.subSelf(cc.v2(5, 5));// return Vec2 {x: 5, y: 5};
- ```
- */
- subSelf(vector: Vec2): Vec2;
- /**
- !#en Subtracts one vector from this, and returns the new result.
- !#zh 向量减法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.sub(cc.v2(5, 5)); // return Vec2 {x: 5, y: 5};
- var v1;
- v.sub(cc.v2(5, 5), v1); // return Vec2 {x: 5, y: 5};
- ```
- */
- sub(vector: Vec2, out?: Vec2): Vec2;
- /**
- !#en Multiplies this by a number. If you want to save result to another vector, use mul() instead.
- !#zh 缩放当前向量。如果你想结果保存到另一个向量,可使用 mul() 代替。
- @param num num
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.mulSelf(5);// return Vec2 {x: 50, y: 50};
- ```
- */
- mulSelf(num: number): Vec2;
- /**
- !#en Multiplies by a number, and returns the new result.
- !#zh 缩放向量,并返回新结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.mul(5); // return Vec2 {x: 50, y: 50};
- var v1;
- v.mul(5, v1); // return Vec2 {x: 50, y: 50};
- ```
- */
- mul(num: number, out?: Vec2): Vec2;
- /**
- !#en Multiplies two vectors.
- !#zh 分量相乘。
- @param vector vector
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.scaleSelf(cc.v2(5, 5));// return Vec2 {x: 50, y: 50};
- ```
- */
- scaleSelf(vector: Vec2): Vec2;
- /**
- !#en Multiplies two vectors, and returns the new result.
- !#zh 分量相乘,并返回新的结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.scale(cc.v2(5, 5)); // return Vec2 {x: 50, y: 50};
- var v1;
- v.scale(cc.v2(5, 5), v1); // return Vec2 {x: 50, y: 50};
- ```
- */
- scale(vector: Vec2, out?: Vec2): Vec2;
- /**
- !#en Divides by a number. If you want to save result to another vector, use div() instead.
- !#zh 向量除法。如果你想结果保存到另一个向量,可使用 div() 代替。
- @param num num
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.divSelf(5); // return Vec2 {x: 2, y: 2};
- ```
- */
- divSelf(num: number): Vec2;
- /**
- !#en Divides by a number, and returns the new result.
- !#zh 向量除法,并返回新的结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.div(5); // return Vec2 {x: 2, y: 2};
- var v1;
- v.div(5, v1); // return Vec2 {x: 2, y: 2};
- ```
- */
- div(num: number, out?: Vec2): Vec2;
- /**
- !#en Negates the components. If you want to save result to another vector, use neg() instead.
- !#zh 向量取反。如果你想结果保存到另一个向量,可使用 neg() 代替。
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.negSelf(); // return Vec2 {x: -10, y: -10};
- ```
- */
- negSelf(): Vec2;
- /**
- !#en Negates the components, and returns the new result.
- !#zh 返回取反后的新向量。
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
-
- @example
- ```js
- var v = cc.v2(10, 10);
- var v1;
- v.neg(v1); // return Vec2 {x: -10, y: -10};
- ```
- */
- neg(out?: Vec2): Vec2;
- /**
- !#en Dot product
- !#zh 当前向量与指定向量进行点乘。
- @param vector vector
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.dot(cc.v2(5, 5)); // return 100;
- ```
- */
- dot(vector?: Vec2): number;
- /**
- !#en Cross product
- !#zh 当前向量与指定向量进行叉乘。
- @param vector vector
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.cross(cc.v2(5, 5)); // return 0;
- ```
- */
- cross(vector?: Vec2): number;
- /**
- !#en Returns the length of this vector.
- !#zh 返回该向量的长度。
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.mag(); // return 14.142135623730951;
- ```
- */
- mag(): number;
- /**
- !#en Returns the squared length of this vector.
- !#zh 返回该向量的长度平方。
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.magSqr(); // return 200;
- ```
- */
- magSqr(): number;
- /**
- !#en Make the length of this vector to 1.
- !#zh 向量归一化,让这个向量的长度为 1。
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.normalizeSelf(); // return Vec2 {x: 0.7071067811865475, y: 0.7071067811865475};
- ```
- */
- normalizeSelf(): Vec2;
- /**
- !#en
- Returns this vector with a magnitude of 1.<br/>
- <br/>
- Note that the current vector is unchanged and a new normalized vector is returned. If you want to normalize the current vector, use normalizeSelf function.
- !#zh
- 返回归一化后的向量。<br/>
- <br/>
- 注意,当前向量不变,并返回一个新的归一化向量。如果你想来归一化当前向量,可使用 normalizeSelf 函数。
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
- */
- normalize(out?: Vec2): Vec2;
- /**
- !#en Get angle in radian between this and vector.
- !#zh 夹角的弧度。
- @param vector vector
- */
- angle(vector: Vec2): number;
- /**
- !#en Get angle in radian between this and vector with direction.
- !#zh 带方向的夹角的弧度。
- @param vector vector
- */
- signAngle(vector: Vec2): number;
- /**
- !#en rotate
- !#zh 返回旋转给定弧度后的新向量。
- @param radians radians
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
- */
- rotate(radians: number, out?: Vec2): Vec2;
- /**
- !#en rotate self
- !#zh 按指定弧度旋转向量。
- @param radians radians
- */
- rotateSelf(radians: number): Vec2;
- /**
- !#en Calculates the projection of the current vector over the given vector.
- !#zh 返回当前向量在指定 vector 向量上的投影向量。
- @param vector vector
-
- @example
- ```js
- var v1 = cc.v2(20, 20);
- var v2 = cc.v2(5, 5);
- v1.project(v2); // Vec2 {x: 20, y: 20};
- ```
- */
- project(vector: Vec2): Vec2;
- /**
- Transforms the vec2 with a mat4. 3rd vector component is implicitly '0', 4th vector component is implicitly '1'
- @param m matrix to transform with
- @param out the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
- */
- transformMat4(m: Mat4, out?: Vec2): Vec2;
- /** !#en return a Vec2 object with x = 1 and y = 1.
- !#zh 新 Vec2 对象。 */
- static ONE: Vec2;
- /** !#en return a Vec2 object with x = 0 and y = 0.
- !#zh 返回 x = 0 和 y = 0 的 Vec2 对象。 */
- static ZERO: Vec2;
- /** !#en return a Vec2 object with x = 0 and y = 1.
- !#zh 返回 x = 0 和 y = 1 的 Vec2 对象。 */
- static UP: Vec2;
- /** !#en return a Vec2 object with x = 1 and y = 0.
- !#zh 返回 x = 1 和 y = 0 的 Vec2 对象。 */
- static RIGHT: Vec2;
- }
- /** !#en Representation of 3D vectors and points.
- !#zh 表示 3D 向量和坐标 */
- export class Vec3 extends ValueType {
- /**
- !#en
- Constructor
- see {{#crossLink "cc/vec3:method"}}cc.v3{{/crossLink}}
- !#zh
- 构造函数,可查看 {{#crossLink "cc/vec3:method"}}cc.v3{{/crossLink}}
- @param x x
- @param y y
- @param z z
- */
- constructor(x?: number, y?: number, z?: number);
- x: number;
- y: number;
- z: number;
- /**
- !#en clone a Vec3 value
- !#zh 克隆一个 Vec3 值
- */
- clone(): Vec3;
- /**
- !#en Set the current vector value with the given vector.
- !#zh 用另一个向量设置当前的向量对象值。
- @param newValue !#en new value to set. !#zh 要设置的新值
- */
- set(newValue: Vec3): Vec3;
- /**
- !#en Check whether the vector equals another one
- !#zh 当前的向量是否与指定的向量相等。
- @param other other
- */
- equals(other: Vec3): boolean;
- /**
- !#en Check whether two vector equal with some degree of variance.
- !#zh
- 近似判断两个点是否相等。<br/>
- 判断 2 个向量是否在指定数值的范围之内,如果在则返回 true,反之则返回 false。
- @param other other
- @param variance variance
- */
- fuzzyEquals(other: Vec3, variance: number): boolean;
- /**
- !#en Transform to string with vector informations
- !#zh 转换为方便阅读的字符串。
- */
- toString(): string;
- /**
- !#en Calculate linear interpolation result between this vector and another one with given ratio
- !#zh 线性插值。
- @param to to
- @param ratio the interpolation coefficient
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- lerp(to: Vec3, ratio: number, out?: Vec3): Vec3;
- /**
- !#en Clamp the vector between from float and to float.
- !#zh
- 返回指定限制区域后的向量。<br/>
- 向量大于 max_inclusive 则返回 max_inclusive。<br/>
- 向量小于 min_inclusive 则返回 min_inclusive。<br/>
- 否则返回自身。
- @param min_inclusive min_inclusive
- @param max_inclusive max_inclusive
- */
- clampf(min_inclusive: Vec3, max_inclusive: Vec3): Vec3;
- /**
- !#en Adds this vector. If you want to save result to another vector, use add() instead.
- !#zh 向量加法。如果你想保存结果到另一个向量,使用 add() 代替。
- @param vector vector
- */
- addSelf(vector: Vec3): Vec3;
- /**
- !#en Adds two vectors, and returns the new result.
- !#zh 向量加法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- add(vector: Vec3, out?: Vec3): Vec3;
- /**
- !#en Subtracts one vector from this. If you want to save result to another vector, use sub() instead.
- !#zh 向量减法。如果你想保存结果到另一个向量,可使用 sub() 代替。
- @param vector vector
- */
- subSelf(vector: Vec3): Vec3;
- /**
- !#en Subtracts one vector from this, and returns the new result.
- !#zh 向量减法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- sub(vector: Vec3, out?: Vec3): Vec3;
- /**
- !#en Multiplies this by a number. If you want to save result to another vector, use mul() instead.
- !#zh 缩放当前向量。如果你想结果保存到另一个向量,可使用 mul() 代替。
- @param num num
- */
- mulSelf(num: number): Vec3;
- /**
- !#en Multiplies by a number, and returns the new result.
- !#zh 缩放向量,并返回新结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- mul(num: number, out?: Vec3): Vec3;
- /**
- !#en Multiplies two vectors.
- !#zh 分量相乘。
- @param vector vector
- */
- scaleSelf(vector: Vec3): Vec3;
- /**
- !#en Multiplies two vectors, and returns the new result.
- !#zh 分量相乘,并返回新的结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- scale(vector: Vec3, out?: Vec3): Vec3;
- /**
- !#en Divides by a number. If you want to save result to another vector, use div() instead.
- !#zh 向量除法。如果你想结果保存到另一个向量,可使用 div() 代替。
- @param num num
- */
- divSelf(num: number): Vec3;
- /**
- !#en Divides by a number, and returns the new result.
- !#zh 向量除法,并返回新的结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- div(num: number, out?: Vec3): Vec3;
- /**
- !#en Negates the components. If you want to save result to another vector, use neg() instead.
- !#zh 向量取反。如果你想结果保存到另一个向量,可使用 neg() 代替。
- */
- negSelf(): Vec3;
- /**
- !#en Negates the components, and returns the new result.
- !#zh 返回取反后的新向量。
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- neg(out?: Vec3): Vec3;
- /**
- !#en Dot product
- !#zh 当前向量与指定向量进行点乘。
- @param vector vector
- */
- dot(vector?: Vec3): number;
- /**
- !#en Cross product
- !#zh 当前向量与指定向量进行叉乘。
- @param vector vector
- @param out out
- */
- cross(vector: Vec3, out?: Vec3): Vec3;
- /**
- !#en Returns the length of this vector.
- !#zh 返回该向量的长度。
-
- @example
- ```js
- var v = cc.v2(10, 10);
- v.mag(); // return 14.142135623730951;
- ```
- */
- mag(): number;
- /**
- !#en Returns the squared length of this vector.
- !#zh 返回该向量的长度平方。
- */
- magSqr(): number;
- /**
- !#en Make the length of this vector to 1.
- !#zh 向量归一化,让这个向量的长度为 1。
- */
- normalizeSelf(): Vec3;
- /**
- !#en
- Returns this vector with a magnitude of 1.<br/>
- <br/>
- Note that the current vector is unchanged and a new normalized vector is returned. If you want to normalize the current vector, use normalizeSelf function.
- !#zh
- 返回归一化后的向量。<br/>
- <br/>
- 注意,当前向量不变,并返回一个新的归一化向量。如果你想来归一化当前向量,可使用 normalizeSelf 函数。
- @param out optional, the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- normalize(out?: Vec3): Vec3;
- /**
- Transforms the vec3 with a mat4. 4th vector component is implicitly '1'
- @param m matrix to transform with
- @param out the receiving vector, you can pass the same vec3 to save result to itself, if not provided, a new vec3 will be created
- */
- transformMat4(m: Mat4, out?: Vec3): Vec3;
- /**
- !#en Get angle in radian between this and vector.
- !#zh 夹角的弧度。
- @param vector vector
- */
- angle(vector: Vec3): number;
- /**
- !#en Calculates the projection of the current vector over the given vector.
- !#zh 返回当前向量在指定 vector 向量上的投影向量。
- @param vector vector
-
- @example
- ```js
- var v1 = cc.v3(20, 20, 20);
- var v2 = cc.v3(5, 5, 5);
- v1.project(v2); // Vec3 {x: 20, y: 20, z: 20};
- ```
- */
- project(vector: Vec3): Vec3;
- /**
- !#en Get angle in radian between this and vector with direction. <br/>
- In order to compatible with the vec2 API.
- !#zh 带方向的夹角的弧度。该方法仅用做兼容 2D 计算。
- @param vector vector
- */
- signAngle(vector: Vec3|Vec2): number;
- /**
- !#en rotate. In order to compatible with the vec2 API.
- !#zh 返回旋转给定弧度后的新向量。该方法仅用做兼容 2D 计算。
- @param radians radians
- @param out optional, the receiving vector, you can pass the same vec2 to save result to itself, if not provided, a new vec2 will be created
- */
- rotate(radians: number, out?: Vec3): Vec2;
- /**
- !#en rotate self. In order to compatible with the vec2 API.
- !#zh 按指定弧度旋转向量。该方法仅用做兼容 2D 计算。
- @param radians radians
- */
- rotateSelf(radians: number): Vec3;
- /** !#en return a Vec3 object with x = 1, y = 1, z = 1.
- !#zh 新 Vec3 对象。 */
- static ONE: Vec3;
- /** !#en return a Vec3 object with x = 0, y = 0, z = 0.
- !#zh 返回 x = 0,y = 0,z = 0 的 Vec3 对象。 */
- static ZERO: Vec3;
- /** !#en return a Vec3 object with x = 0, y = 1, z = 0.
- !#zh 返回 x = 0, y = 1, z = 0 的 Vec3 对象。 */
- static UP: Vec3;
- /** !#en return a Vec3 object with x = 1, y = 0, z = 0.
- !#zh 返回 x = 1,y = 0,z = 0 的 Vec3 对象。 */
- static RIGHT: Vec3;
- /** !#en return a Vec3 object with x = 0, y = 0, z = 1.
- !#zh 返回 x = 0,y = 0,z = 1 的 Vec3 对象。 */
- static FRONT: Vec3;
- }
- /** !#en Representation of 3D vectors and points.
- !#zh 表示 3D 向量和坐标 */
- export class Vec4 extends ValueType {
- /**
- !#en
- Constructor
- see {{#crossLink "cc/vec4:method"}}cc.v4{{/crossLink}}
- !#zh
- 构造函数,可查看 {{#crossLink "cc/vec4:method"}}cc.v4{{/crossLink}}
- @param x x
- @param y y
- @param z z
- @param w w
- */
- constructor(x?: number, y?: number, z?: number, w?: number);
- x: number;
- y: number;
- z: number;
- w: number;
- /**
- !#en clone a Vec4 value
- !#zh 克隆一个 Vec4 值
- */
- clone(): Vec4;
- /**
- !#en Set the current vector value with the given vector.
- !#zh 用另一个向量设置当前的向量对象值。
- @param newValue !#en new value to set. !#zh 要设置的新值
- */
- set(newValue: Vec4): Vec4;
- /**
- !#en Check whether the vector equals another one
- !#zh 当前的向量是否与指定的向量相等。
- @param other other
- */
- equals(other: Vec4): boolean;
- /**
- !#en Check whether two vector equal with some degree of variance.
- !#zh
- 近似判断两个点是否相等。<br/>
- 判断 2 个向量是否在指定数值的范围之内,如果在则返回 true,反之则返回 false。
- @param other other
- @param variance variance
- */
- fuzzyEquals(other: Vec4, variance: number): boolean;
- /**
- !#en Transform to string with vector informations
- !#zh 转换为方便阅读的字符串。
- */
- toString(): string;
- /**
- !#en Calculate linear interpolation result between this vector and another one with given ratio
- !#zh 线性插值。
- @param to to
- @param ratio the interpolation coefficient
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- lerp(to: Vec4, ratio: number, out?: Vec4): Vec4;
- /**
- !#en Clamp the vector between from float and to float.
- !#zh
- 返回指定限制区域后的向量。<br/>
- 向量大于 max_inclusive 则返回 max_inclusive。<br/>
- 向量小于 min_inclusive 则返回 min_inclusive。<br/>
- 否则返回自身。
- @param min_inclusive min_inclusive
- @param max_inclusive max_inclusive
- */
- clampf(min_inclusive: Vec4, max_inclusive: Vec4): Vec4;
- /**
- !#en Adds this vector. If you want to save result to another vector, use add() instead.
- !#zh 向量加法。如果你想保存结果到另一个向量,使用 add() 代替。
- @param vector vector
- */
- addSelf(vector: Vec4): Vec4;
- /**
- !#en Adds two vectors, and returns the new result.
- !#zh 向量加法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- add(vector: Vec4, out?: Vec4): Vec4;
- /**
- !#en Subtracts one vector from this. If you want to save result to another vector, use sub() instead.
- !#zh 向量减法。如果你想保存结果到另一个向量,可使用 sub() 代替。
- @param vector vector
- */
- subSelf(vector: Vec4): Vec4;
- /**
- !#en Subtracts one vector from this, and returns the new result.
- !#zh 向量减法,并返回新结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- sub(vector: Vec4, out?: Vec4): Vec4;
- /**
- !#en Multiplies this by a number. If you want to save result to another vector, use mul() instead.
- !#zh 缩放当前向量。如果你想结果保存到另一个向量,可使用 mul() 代替。
- @param num num
- */
- mulSelf(num: number): Vec4;
- /**
- !#en Multiplies by a number, and returns the new result.
- !#zh 缩放向量,并返回新结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- mul(num: number, out?: Vec4): Vec4;
- /**
- !#en Multiplies two vectors.
- !#zh 分量相乘。
- @param vector vector
- */
- scaleSelf(vector: Vec4): Vec4;
- /**
- !#en Multiplies two vectors, and returns the new result.
- !#zh 分量相乘,并返回新的结果。
- @param vector vector
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- scale(vector: Vec4, out?: Vec4): Vec4;
- /**
- !#en Divides by a number. If you want to save result to another vector, use div() instead.
- !#zh 向量除法。如果你想结果保存到另一个向量,可使用 div() 代替。
- @param num num
- */
- divSelf(num: number): Vec4;
- /**
- !#en Divides by a number, and returns the new result.
- !#zh 向量除法,并返回新的结果。
- @param num num
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- div(num: number, out?: Vec4): Vec4;
- /**
- !#en Negates the components. If you want to save result to another vector, use neg() instead.
- !#zh 向量取反。如果你想结果保存到另一个向量,可使用 neg() 代替。
- */
- negSelf(): Vec4;
- /**
- !#en Negates the components, and returns the new result.
- !#zh 返回取反后的新向量。
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- neg(out?: Vec4): Vec4;
- /**
- !#en Dot product
- !#zh 当前向量与指定向量进行点乘。
- @param vector vector
- */
- dot(vector?: Vec4): number;
- /**
- !#en Cross product
- !#zh 当前向量与指定向量进行叉乘。
- @param vector vector
- @param out out
- */
- cross(vector: Vec4, out?: Vec4): Vec4;
- /**
- !#en Returns the length of this vector.
- !#zh 返回该向量的长度。
-
- @example
- ```js
- var v = cc.v4(10, 10);
- v.mag(); // return 14.142135623730951;
- ```
- */
- mag(): number;
- /**
- !#en Returns the squared length of this vector.
- !#zh 返回该向量的长度平方。
- */
- magSqr(): number;
- /**
- !#en Make the length of this vector to 1.
- !#zh 向量归一化,让这个向量的长度为 1。
- */
- normalizeSelf(): Vec4;
- /**
- !#en
- Returns this vector with a magnitude of 1.<br/>
- <br/>
- Note that the current vector is unchanged and a new normalized vector is returned. If you want to normalize the current vector, use normalizeSelf function.
- !#zh
- 返回归一化后的向量。<br/>
- <br/>
- 注意,当前向量不变,并返回一个新的归一化向量。如果你想来归一化当前向量,可使用 normalizeSelf 函数。
- @param out optional, the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- normalize(out?: Vec4): Vec4;
- /**
- Transforms the vec4 with a mat4. 4th vector component is implicitly '1'
- @param m matrix to transform with
- @param out the receiving vector, you can pass the same vec4 to save result to itself, if not provided, a new vec4 will be created
- */
- transformMat4(m: Mat4, out?: Vec4): Vec4;
- }
- /** !#en .
- !#zh 。 */
- export class SkeletonAnimation extends Animation {
- }
- /** !#en SkeletonAnimationClip Asset.
- !#zh 骨骼动画剪辑。 */
- export class SkeletonAnimationClip extends AnimationClip {
- }
- /** !#en
- Skinned Mesh Renderer
- !#zh
- 蒙皮渲染组件 */
- export class SkinnedMeshRenderer {
- /** !#en
- Skeleton Asset
- !#zh
- 骨骼资源 */
- skeleton: sp.Skeleton;
- /** !#en
- Root Bone
- !#zh
- 骨骼根节点 */
- rootBone: Node;
- }
- /** !#en cc.EditBox is a component for inputing text, you can use it to gather small amounts of text from users.
- !#zh EditBox 组件,用于获取用户的输入文本。 */
- export class EditBox extends Component {
- /** !#en Input string of EditBox.
- !#zh 输入框的初始输入内容,如果为空则会显示占位符的文本。 */
- string: string;
- /** !#en The Label component attached to the node for EditBox's input text label
- !#zh 输入框输入文本节点上挂载的 Label 组件对象 */
- textLabel: Label;
- /** !en The Label component attached to the node for EditBox's placeholder text label
- !zh 输入框占位符节点上挂载的 Label 组件对象 */
- placeholderLabel: Label;
- /** !#en The Sprite component attached to the node for EditBox's background
- !#zh 输入框背景节点上挂载的 Sprite 组件对象 */
- background: Sprite;
- /** !#en The background image of EditBox. This property will be removed in the future, use editBox.background instead please.
- !#zh 输入框的背景图片。 该属性会在将来的版本中移除,请用 editBox.background */
- backgroundImage: SpriteFrame;
- /** !#en
- The return key type of EditBox.
- Note: it is meaningless for web platforms and desktop platforms.
- !#zh
- 指定移动设备上面回车按钮的样式。
- 注意:这个选项对 web 平台与 desktop 平台无效。 */
- returnType: EditBox.KeyboardReturnType;
- /** !#en Set the input flags that are to be applied to the EditBox.
- !#zh 指定输入标志位,可以指定输入方式为密码或者单词首字母大写。 */
- inputFlag: EditBox.InputFlag;
- /** !#en
- Set the input mode of the edit box.
- If you pass ANY, it will create a multiline EditBox.
- !#zh
- 指定输入模式: ANY表示多行输入,其它都是单行输入,移动平台上还可以指定键盘样式。 */
- inputMode: EditBox.InputMode;
- /** !#en Font size of the input text. This property will be removed in the future, use editBox.textLabel.fontSize instead please.
- !#zh 输入框文本的字体大小。 该属性会在将来的版本中移除,请使用 editBox.textLabel.fontSize。 */
- fontSize: number;
- /** !#en Change the lineHeight of displayed text. This property will be removed in the future, use editBox.textLabel.lineHeight instead.
- !#zh 输入框文本的行高。该属性会在将来的版本中移除,请使用 editBox.textLabel.lineHeight */
- lineHeight: number;
- /** !#en Font color of the input text. This property will be removed in the future, use editBox.textLabel.node.color instead.
- !#zh 输入框文本的颜色。该属性会在将来的版本中移除,请使用 editBox.textLabel.node.color */
- fontColor: Color;
- /** !#en The display text of placeholder.
- !#zh 输入框占位符的文本内容。 */
- placeholder: string;
- /** !#en The font size of placeholder. This property will be removed in the future, use editBox.placeholderLabel.fontSize instead.
- !#zh 输入框占位符的字体大小。该属性会在将来的版本中移除,请使用 editBox.placeholderLabel.fontSize */
- placeholderFontSize: number;
- /** !#en The font color of placeholder. This property will be removed in the future, use editBox.placeholderLabel.node.color instead.
- !#zh 输入框占位符的字体颜色。该属性会在将来的版本中移除,请使用 editBox.placeholderLabel.node.color */
- placeholderFontColor: Color;
- /** !#en The maximize input length of EditBox.
- - If pass a value less than 0, it won't limit the input number of characters.
- - If pass 0, it doesn't allow input any characters.
- !#zh 输入框最大允许输入的字符个数。
- - 如果值为小于 0 的值,则不会限制输入字符个数。
- - 如果值为 0,则不允许用户进行任何输入。 */
- maxLength: number;
- /** !#en The input is always visible and be on top of the game view (only useful on Web), this property will be removed on v2.1
- !zh 输入框总是可见,并且永远在游戏视图的上面(这个属性只有在 Web 上面修改有意义),该属性会在 v2.1 中移除
- Note: only available on Web at the moment. */
- stayOnTop: boolean;
- /** !#en Set the tabIndex of the DOM input element (only useful on Web).
- !#zh 修改 DOM 输入元素的 tabIndex(这个属性只有在 Web 上面修改有意义)。 */
- tabIndex: number;
- /** !#en The event handler to be called when EditBox began to edit text.
- !#zh 开始编辑文本输入框触发的事件回调。 */
- editingDidBegan: Component.EventHandler[];
- /** !#en The event handler to be called when EditBox text changes.
- !#zh 编辑文本输入框时触发的事件回调。 */
- textChanged: Component.EventHandler[];
- /** !#en The event handler to be called when EditBox edit ends.
- !#zh 结束编辑文本输入框时触发的事件回调。 */
- editingDidEnded: Component.EventHandler[];
- /** !#en The event handler to be called when return key is pressed. Windows is not supported.
- !#zh 当用户按下回车按键时的事件回调,目前不支持 windows 平台 */
- editingReturn: Component.EventHandler[];
- /**
- !#en Let the EditBox get focus, this method will be removed on v2.1
- !#zh 让当前 EditBox 获得焦点, 这个方法会在 v2.1 中移除
- */
- setFocus(): void;
- /**
- !#en Let the EditBox get focus
- !#zh 让当前 EditBox 获得焦点
- */
- focus(): void;
- /**
- !#en Let the EditBox lose focus
- !#zh 让当前 EditBox 失去焦点
- */
- blur(): void;
- /**
- !#en Determine whether EditBox is getting focus or not.
- !#zh 判断 EditBox 是否获得了焦点
- */
- isFocused(): void;
- /**
- !#en if you don't need the EditBox and it isn't in any running Scene, you should
- call the destroy method on this component or the associated node explicitly.
- Otherwise, the created DOM element won't be removed from web page.
- !#zh
- 如果你不再使用 EditBox,并且组件未添加到场景中,那么你必须手动对组件或所在节点调用 destroy。
- 这样才能移除网页上的 DOM 节点,避免 Web 平台内存泄露。
-
- @example
- ```js
- editbox.node.parent = null; // or editbox.node.removeFromParent(false);
- // when you don't need editbox anymore
- editbox.node.destroy();
- ```
- */
- destroy(): boolean;
- }
- /** undefined */
- export class PhysicsBoxCollider extends PhysicsCollider implements Collider.Box {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Box size
- !#zh 包围盒大小 */
- size: Size;
- }
- /** undefined */
- export class PhysicsChainCollider extends PolygonCollider {
- /** !#en Whether the chain is loop
- !#zh 链条是否首尾相连 */
- loop: boolean;
- /** !#en Chain points
- !#zh 链条顶点数组 */
- points: Vec2[];
- }
- /** undefined */
- export class PhysicsCircleCollider extends PhysicsCollider implements Collider.Circle {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Circle radius
- !#zh 圆形半径 */
- radius: number;
- }
- /** undefined */
- export class PhysicsCollider extends Collider {
- /** !#en
- The density.
- !#zh
- 密度 */
- density: number;
- /** !#en
- A sensor collider collects contact information but never generates a collision response
- !#zh
- 一个传感器类型的碰撞体会产生碰撞回调,但是不会发生物理碰撞效果。 */
- sensor: boolean;
- /** !#en
- The friction coefficient, usually in the range [0,1].
- !#zh
- 摩擦系数,取值一般在 [0, 1] 之间 */
- friction: number;
- /** !#en
- The restitution (elasticity) usually in the range [0,1].
- !#zh
- 弹性系数,取值一般在 [0, 1]之间 */
- restitution: number;
- /** !#en
- Physics collider will find the rigidbody component on the node and set to this property.
- !#zh
- 碰撞体会在初始化时查找节点上是否存在刚体,如果查找成功则赋值到这个属性上。 */
- body: RigidBody;
- /**
- !#en
- Apply current changes to collider, this will regenerate inner box2d fixtures.
- !#zh
- 应用当前 collider 中的修改,调用此函数会重新生成内部 box2d 的夹具。
- */
- apply(): void;
- /**
- !#en
- Get the world aabb of the collider
- !#zh
- 获取碰撞体的世界坐标系下的包围盒
- */
- getAABB(): void;
- }
- /** undefined */
- export class PhysicsPolygonCollider extends PhysicsCollider implements Collider.Polygon {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Polygon points
- !#zh 多边形顶点数组 */
- points: Vec2[];
- }
- /** !#en
- A distance joint constrains two points on two bodies
- to remain at a fixed distance from each other. You can view
- this as a massless, rigid rod.
- !#zh
- 距离关节通过一个固定的长度来约束关节链接的两个刚体。你可以将它想象成一个无质量,坚固的木棍。 */
- export class DistanceJoint extends Joint {
- /** !#en
- The distance separating the two ends of the joint.
- !#zh
- 关节两端的距离 */
- distance: number;
- /** !#en
- The spring frequency.
- !#zh
- 弹性系数。 */
- frequency: number;
- /** !#en
- The damping ratio.
- !#zh
- 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */
- dampingRatio: number;
- }
- /** !#en
- Base class for joints to connect rigidbody.
- !#zh
- 关节类的基类 */
- export class Joint extends Component {
- /** !#en
- The anchor of the rigidbody.
- !#zh
- 刚体的锚点。 */
- anchor: Vec2;
- /** !#en
- The anchor of the connected rigidbody.
- !#zh
- 关节另一端刚体的锚点。 */
- connectedAnchor: Vec2;
- /** !#en
- The rigidbody to which the other end of the joint is attached.
- !#zh
- 关节另一端链接的刚体 */
- connectedBody: RigidBody;
- /** !#en
- Should the two rigid bodies connected with this joint collide with each other?
- !#zh
- 链接到关节上的两个刚体是否应该相互碰撞? */
- collideConnected: boolean;
- /**
- !#en
- Apply current changes to joint, this will regenerate inner box2d joint.
- !#zh
- 应用当前关节中的修改,调用此函数会重新生成内部 box2d 的关节。
- */
- apply(): void;
- /**
- !#en
- Get the anchor point on rigidbody in world coordinates.
- !#zh
- 获取刚体世界坐标系下的锚点。
- */
- getWorldAnchor(): Vec2;
- /**
- !#en
- Get the anchor point on connected rigidbody in world coordinates.
- !#zh
- 获取链接刚体世界坐标系下的锚点。
- */
- getWorldConnectedAnchor(): Vec2;
- /**
- !#en
- Gets the reaction force of the joint.
- !#zh
- 获取关节的反作用力。
- @param timeStep The time to calculate the reaction force for.
- */
- getReactionForce(timeStep: number): Vec2;
- /**
- !#en
- Gets the reaction torque of the joint.
- !#zh
- 获取关节的反扭矩。
- @param timeStep The time to calculate the reaction torque for.
- */
- getReactionTorque(timeStep: number): number;
- }
- /** !#en
- A motor joint is used to control the relative motion
- between two bodies. A typical usage is to control the movement
- of a dynamic body with respect to the ground.
- !#zh
- 马达关节被用来控制两个刚体间的相对运动。
- 一个典型的例子是用来控制一个动态刚体相对于地面的运动。 */
- export class MotorJoint extends Joint {
- /** !#en
- The anchor of the rigidbody.
- !#zh
- 刚体的锚点。 */
- anchor: Vec2;
- /** !#en
- The anchor of the connected rigidbody.
- !#zh
- 关节另一端刚体的锚点。 */
- connectedAnchor: Vec2;
- /** !#en
- The linear offset from connected rigidbody to rigidbody.
- !#zh
- 关节另一端的刚体相对于起始端刚体的位置偏移量 */
- linearOffset: Vec2;
- /** !#en
- The angular offset from connected rigidbody to rigidbody.
- !#zh
- 关节另一端的刚体相对于起始端刚体的角度偏移量 */
- angularOffset: number;
- /** !#en
- The maximum force can be applied to rigidbody.
- !#zh
- 可以应用于刚体的最大的力值 */
- maxForce: number;
- /** !#en
- The maximum torque can be applied to rigidbody.
- !#zh
- 可以应用于刚体的最大扭矩值 */
- maxTorque: number;
- /** !#en
- The position correction factor in the range [0,1].
- !#zh
- 位置矫正系数,范围为 [0, 1] */
- correctionFactor: number;
- }
- /** !#en
- A mouse joint is used to make a point on a body track a
- specified world point. This a soft constraint with a maximum
- force. This allows the constraint to stretch and without
- applying huge forces.
- Mouse Joint will auto register the touch event with the mouse region node,
- and move the choosed rigidbody in touch move event.
- Note : generally mouse joint only used in test bed.
- !#zh
- 鼠标关节用于使刚体上的一个点追踪一个指定的世界坐标系下的位置。
- 鼠标关节可以指定一个最大的里来施加一个柔和的约束。
- 鼠标关节会自动使用 mouse region 节点来注册鼠标事件,并且在触摸移动事件中移动选中的刚体。
- 注意:一般鼠标关节只在测试环境中使用。 */
- export class MouseJoint extends Joint {
- /** !#en
- The anchor of the rigidbody.
- !#zh
- 刚体的锚点。 */
- anchor: Vec2;
- /** !#en
- The anchor of the connected rigidbody.
- !#zh
- 关节另一端刚体的锚点。 */
- connectedAnchor: Vec2;
- /** !#en
- The node used to register touch evnet.
- If this is null, it will be the joint's node.
- !#zh
- 用于注册触摸事件的节点。
- 如果没有设置这个值,那么将会使用关节的节点来注册事件。 */
- mouseRegion: Node;
- /** !#en
- The target point.
- The mouse joint will move choosed rigidbody to target point.
- !#zh
- 目标点,鼠标关节将会移动选中的刚体到指定的目标点 */
- target: Vec2;
- /** !#en
- The spring frequency.
- !#zh
- 弹簧系数。 */
- frequency: number;
- /** !#en
- The damping ratio.
- !#zh
- 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */
- 0: number;
- /** !#en
- The maximum force
- !#zh
- 最大阻力值 */
- maxForce: number;
- }
- /** !#en
- A prismatic joint. This joint provides one degree of freedom: translation
- along an axis fixed in rigidbody. Relative rotation is prevented. You can
- use a joint limit to restrict the range of motion and a joint motor to
- drive the motion or to model joint friction.
- !#zh
- 移动关节指定了只能在一个方向上移动刚体。
- 你可以开启关节限制来设置刚体运行移动的间距,也可以开启马达来使用关节马达驱动刚体的运行。 */
- export class PrismaticJoint extends Joint {
- /** !#en
- The local joint axis relative to rigidbody.
- !#zh
- 指定刚体可以移动的方向。 */
- localAxisA: Vec2;
- /** !#en
- The reference angle.
- !#zh
- 相对角度 */
- referenceAngle: number;
- /** !#en
- Enable joint distance limit?
- !#zh
- 是否开启关节的距离限制? */
- enableLimit: boolean;
- /** !#en
- Enable joint motor?
- !#zh
- 是否开启关节马达? */
- enableMotor: boolean;
- /** !#en
- The lower joint limit.
- !#zh
- 刚体能够移动的最小值 */
- lowerLimit: number;
- /** !#en
- The upper joint limit.
- !#zh
- 刚体能够移动的最大值 */
- upperLimit: number;
- /** !#en
- The maxium force can be applied to rigidbody to rearch the target motor speed.
- !#zh
- 可以施加到刚体的最大力。 */
- maxMotorForce: number;
- /** !#en
- The expected motor speed.
- !#zh
- 期望的马达速度。 */
- motorSpeed: number;
- }
- /** !#en
- A revolute joint constrains two bodies to share a common point while they
- are free to rotate about the point. The relative rotation about the shared
- point is the joint angle. You can limit the relative rotation with
- a joint limit that specifies a lower and upper angle. You can use a motor
- to drive the relative rotation about the shared point. A maximum motor torque
- is provided so that infinite forces are not generated.
- !#zh
- 旋转关节可以约束两个刚体围绕一个点来进行旋转。
- 你可以通过开启关节限制来限制旋转的最大角度和最小角度。
- 你可以通过开启马达来施加一个扭矩力来驱动这两个刚体在这一点上的相对速度。 */
- export class RevoluteJoint extends Joint {
- /** !#en
- The reference angle.
- An angle between bodies considered to be zero for the joint angle.
- !#zh
- 相对角度。
- 两个物体之间角度为零时可以看作相等于关节角度 */
- referenceAngle: number;
- /** !#en
- The lower angle.
- !#zh
- 角度的最低限制。 */
- lowerAngle: number;
- /** !#en
- The upper angle.
- !#zh
- 角度的最高限制。 */
- upperAngle: number;
- /** !#en
- The maxium torque can be applied to rigidbody to rearch the target motor speed.
- !#zh
- 可以施加到刚体的最大扭矩。 */
- maxMotorTorque: number;
- /** !#en
- The expected motor speed.
- !#zh
- 期望的马达速度。 */
- motorSpeed: number;
- /** !#en
- Enable joint limit?
- !#zh
- 是否开启关节的限制? */
- enableLimit: boolean;
- /** !#en
- Enable joint motor?
- !#zh
- 是否开启关节马达? */
- enableMotor: boolean;
- /**
- !#en
- Get the joint angle.
- !#zh
- 获取关节角度。
- */
- getJointAngle(): number;
- }
- /** !#en
- A rope joint enforces a maximum distance between two points
- on two bodies. It has no other effect.
- Warning: if you attempt to change the maximum length during
- the simulation you will get some non-physical behavior.
- !#zh
- 绳子关节只指定两个刚体间的最大距离,没有其他的效果。
- 注意:如果你试图动态修改关节的长度,这有可能会得到一些意外的效果。 */
- export class RopeJoint extends Joint {
- /** !#en
- The max length.
- !#zh
- 最大长度。 */
- maxLength: number;
- }
- /** !#en
- A weld joint essentially glues two bodies together. A weld joint may
- distort somewhat because the island constraint solver is approximate.
- !#zh
- 熔接关节相当于将两个刚体粘在了一起。
- 熔接关节可能会使某些东西失真,因为约束求解器算出的都是近似值。 */
- export class WeldJoint extends Joint {
- /** !#en
- The reference angle.
- !#zh
- 相对角度。 */
- referenceAngle: number;
- /** !#en
- The frequency.
- !#zh
- 弹性系数。 */
- frequency: number;
- /** !#en
- The damping ratio.
- !#zh
- 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */
- 0: number;
- }
- /** !#en
- A wheel joint. This joint provides two degrees of freedom: translation
- along an axis fixed in bodyA and rotation in the plane. You can use a joint motor to drive
- the rotation or to model rotational friction.
- This joint is designed for vehicle suspensions.
- !#zh
- 轮子关节提供两个维度的自由度:旋转和沿着指定方向上位置的移动。
- 你可以通过开启关节马达来使用马达驱动刚体的旋转。
- 轮组关节是专门为机动车类型设计的。 */
- export class WheelJoint extends Joint {
- /** !#en
- The local joint axis relative to rigidbody.
- !#zh
- 指定刚体可以移动的方向。 */
- localAxisA: Vec2;
- /** !#en
- The maxium torque can be applied to rigidbody to rearch the target motor speed.
- !#zh
- 可以施加到刚体的最大扭矩。 */
- maxMotorTorque: number;
- /** !#en
- The expected motor speed.
- !#zh
- 期望的马达速度。 */
- motorSpeed: number;
- /** !#en
- Enable joint motor?
- !#zh
- 是否开启关节马达? */
- enableMotor: boolean;
- /** !#en
- The spring frequency.
- !#zh
- 弹性系数。 */
- frequency: number;
- /** !#en
- The damping ratio.
- !#zh
- 阻尼,表示关节变形后,恢复到初始状态受到的阻力。 */
- dampingRatio: number;
- }
- /** !#en Material Asset.
- !#zh 材质资源类。 */
- export class Material extends Asset {
- }
- /** !#en Manager the dynamic atlas.
- !#zh 管理动态图集。 */
- export class DynamicAtlasManager {
- /** !#en Enabled or Disabled dynamic atlas.
- !#zh 开启或者关闭动态图集。 */
- enabled: boolean;
- /** !#en The maximum number of atlas that can be created.
- !#zh 可以创建的最大图集数量。 */
- maxAtlasCount: number;
- /** !#en Is enable textureBleeding.
- !#zh 是否开启 textureBleeding */
- textureBleeding: boolean;
- /** !#en The size of the atlas that was created
- !#zh 创建的图集的宽高 */
- textureSize: number;
- /** !#en The maximum size of the picture that can be added to the atlas.
- !#zh 可以添加进图集的图片的最大尺寸。 */
- maxFrameSize: number;
- /** !#en The minimum size of the picture that can be added to the atlas.
- !#zh 可以添加进图集的图片的最小尺寸。 */
- minFrameSize: number;
- /**
- !#en Append a sprite frame into the dynamic atlas.
- !#zh 添加碎图进入动态图集。
- @param spriteFrame spriteFrame
- */
- insertSpriteFrame(spriteFrame: SpriteFrame): void;
- /**
- !#en Resets all dynamic atlas, and the existing ones will be destroyed.
- !#zh 重置所有动态图集,已有的动态图集会被销毁。
- */
- reset(): void;
- /**
- !#en Displays all the dynamic atlas in the current scene, which you can use to view the current atlas state.
- !#zh 在当前场景中显示所有动态图集,可以用来查看当前的合图状态。
- @param show show
- */
- showDebug(show: boolean): void;
- }
- /****************************************************
- * debug
- *****************************************************/
-
- export namespace debug {
- /** !#en Enum for debug modes.
- !#zh 调试模式 */
- export enum DebugMode {
- NONE = 0,
- INFO = 0,
- WARN = 0,
- ERROR = 0,
- INFO_FOR_WEB_PAGE = 0,
- WARN_FOR_WEB_PAGE = 0,
- ERROR_FOR_WEB_PAGE = 0,
- }
- }
-
- /****************************************************
- * Node
- *****************************************************/
-
- export namespace Node {
- /** !#en Node's local dirty properties flag
- !#zh Node 的本地属性 dirty 状态位 */
- export enum _LocalDirtyFlag {
- POSITION = 0,
- SCALE = 0,
- ROTATION = 0,
- SKEW = 0,
- TRS = 0,
- RS = 0,
- ALL = 0,
- }
- }
-
- /****************************************************
- * Node
- *****************************************************/
-
- export namespace Node {
- /** !#en The event type supported by Node
- !#zh Node 支持的事件类型 */
- export class EventType {
- /** !#en The event type for touch start event, you can use its value directly: 'touchstart'
- !#zh 当手指触摸到屏幕时。 */
- static TOUCH_START: string;
- /** !#en The event type for touch move event, you can use its value directly: 'touchmove'
- !#zh 当手指在屏幕上移动时。 */
- static TOUCH_MOVE: string;
- /** !#en The event type for touch end event, you can use its value directly: 'touchend'
- !#zh 当手指在目标节点区域内离开屏幕时。 */
- static TOUCH_END: string;
- /** !#en The event type for touch end event, you can use its value directly: 'touchcancel'
- !#zh 当手指在目标节点区域外离开屏幕时。 */
- static TOUCH_CANCEL: string;
- /** !#en The event type for mouse down events, you can use its value directly: 'mousedown'
- !#zh 当鼠标按下时触发一次。 */
- static MOUSE_DOWN: string;
- /** !#en The event type for mouse move events, you can use its value directly: 'mousemove'
- !#zh 当鼠标在目标节点在目标节点区域中移动时,不论是否按下。 */
- static MOUSE_MOVE: string;
- /** !#en The event type for mouse enter target events, you can use its value directly: 'mouseenter'
- !#zh 当鼠标移入目标节点区域时,不论是否按下。 */
- static MOUSE_ENTER: string;
- /** !#en The event type for mouse leave target events, you can use its value directly: 'mouseleave'
- !#zh 当鼠标移出目标节点区域时,不论是否按下。 */
- static MOUSE_LEAVE: string;
- /** !#en The event type for mouse up events, you can use its value directly: 'mouseup'
- !#zh 当鼠标从按下状态松开时触发一次。 */
- static MOUSE_UP: string;
- /** !#en The event type for mouse wheel events, you can use its value directly: 'mousewheel'
- !#zh 当鼠标滚轮滚动时。 */
- static MOUSE_WHEEL: string;
- /** !#en The event type for position change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点位置改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static POSITION_CHANGED: string;
- /** !#en The event type for rotation change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点旋转改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static ROTATION_CHANGED: string;
- /** !#en The event type for scale change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点缩放改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static SCALE_CHANGED: string;
- /** !#en The event type for size change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点尺寸改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static SIZE_CHANGED: string;
- /** !#en The event type for anchor point change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点锚点改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static ANCHOR_CHANGED: string;
- /** !#en The event type for color change events.
- Performance note, this event will be triggered every time corresponding properties being changed,
- if the event callback have heavy logic it may have great performance impact, try to avoid such scenario.
- !#zh 当节点颜色改变时触发的事件。
- 性能警告:这个事件会在每次对应的属性被修改时触发,如果事件回调损耗较高,有可能对性能有很大的负面影响,请尽量避免这种情况。 */
- static COLOR_CHANGED: string;
- /** !#en The event type for new child added events.
- !#zh 当新的子节点被添加时触发的事件。 */
- static CHILD_ADDED: string;
- /** !#en The event type for child removed events.
- !#zh 当子节点被移除时触发的事件。 */
- static CHILD_REMOVED: string;
- /** !#en The event type for children reorder events.
- !#zh 当子节点顺序改变时触发的事件。 */
- static CHILD_REORDER: string;
- /** !#en The event type for node group changed events.
- !#zh 当节点归属群组发生变化时触发的事件。 */
- static GROUP_CHANGED: string;
- /** !#en The event type for node's sibling order changed.
- !#zh 当节点在兄弟节点中的顺序发生变化时触发的事件。 */
- static SIBLING_ORDER_CHANGED: string;
- }
- }
-
- /****************************************************
- * audioEngine
- *****************************************************/
-
- export namespace audioEngine {
- /** !#en Audio state.
- !#zh 声音播放状态 */
- export enum AudioState {
- ERROR = 0,
- INITIALZING = 0,
- PLAYING = 0,
- PAUSED = 0,
- STOPPED = 0,
- }
- }
-
- /****************************************************
- * ParticleSystem
- *****************************************************/
-
- export namespace ParticleSystem {
- /** !#en Enum for emitter modes
- !#zh 发射模式 */
- export enum EmitterMode {
- GRAVITY = 0,
- RADIUS = 0,
- }
- }
-
- /****************************************************
- * ParticleSystem
- *****************************************************/
-
- export namespace ParticleSystem {
- /** !#en Enum for particles movement type.
- !#zh 粒子位置类型 */
- export enum PositionType {
- FREE = 0,
- RELATIVE = 0,
- GROUPED = 0,
- }
- }
-
- /****************************************************
- * VideoPlayer
- *****************************************************/
-
- export namespace VideoPlayer {
- /** !#en Video event type
- !#zh 视频事件类型 */
- export enum EventType {
- PLAYING = 0,
- PAUSED = 0,
- STOPPED = 0,
- COMPLETED = 0,
- META_LOADED = 0,
- CLICKED = 0,
- READY_TO_PLAY = 0,
- }
- }
-
- /****************************************************
- * VideoPlayer
- *****************************************************/
-
- export namespace VideoPlayer {
- /** !#en Enum for video resouce type type.
- !#zh 视频来源 */
- export enum ResourceType {
- REMOTE = 0,
- LOCAL = 0,
- }
- }
-
- /****************************************************
- * TiledMap
- *****************************************************/
-
- export namespace TiledMap {
- /** !#en The orientation of tiled map.
- !#zh Tiled Map 地图方向。 */
- export enum Orientation {
- ORTHO = 0,
- HEX = 0,
- ISO = 0,
- NONE = 0,
- MAP = 0,
- LAYER = 0,
- OBJECTGROUP = 0,
- OBJECT = 0,
- TILE = 0,
- HORIZONTAL = 0,
- VERTICAL = 0,
- DIAGONAL = 0,
- FLIPPED_ALL = 0,
- FLIPPED_MASK = 0,
- STAGGERAXIS_X = 0,
- STAGGERAXIS_Y = 0,
- STAGGERINDEX_ODD = 0,
- STAGGERINDEX_EVEN = 0,
- STAGGERINDEX_ODD = 0,
- }
- }
-
- /****************************************************
- * TiledMap
- *****************************************************/
-
- export namespace TiledMap {
- /** !#en TiledMap Object Type
- !#zh 地图物体类型 */
- export enum TMXObjectType {
- RECT = 0,
- ELLIPSE = 0,
- POLYGON = 0,
- POLYLINE = 0,
- IMAGE = 0,
- TEXT = 0,
- }
- }
-
- /****************************************************
- * WebView
- *****************************************************/
-
- export namespace WebView {
- /** !#en WebView event type
- !#zh 网页视图事件类型 */
- export enum EventType {
- LOADED = 0,
- LOADING = 0,
- ERROR = 0,
- }
- }
-
- /****************************************************
- * Camera
- *****************************************************/
-
- export namespace Camera {
- /** !#en Values for Camera.clearFlags, determining what to clear when rendering a Camera.
- !#zh 摄像机清除标记位,决定摄像机渲染时会清除哪些状态 */
- export enum ClearFlags {
- COLOR = 0,
- DEPTH = 0,
- STENCIL = 0,
- }
- }
-
- /****************************************************
- * Light
- *****************************************************/
-
- export namespace Light {
- /** !#en The light source type
-
- !#zh 光源类型 */
- export enum Type {
- DIRECTIONAL = 0,
- POINT = 0,
- SPOT = 0,
- AMBIENT = 0,
- }
- }
-
- /****************************************************
- * Light
- *****************************************************/
-
- export namespace Light {
- /** !#en The shadow type
-
- !#zh 阴影类型 */
- export enum ShadowType {
- NONE = 0,
- HARD = 0,
- }
- }
-
- /****************************************************
- * Collider
- *****************************************************/
-
- export namespace Collider {
- /** !#en Defines a Box Collider .
- !#zh 用来定义包围盒碰撞体 */
- export class Box {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Box size
- !#zh 包围盒大小 */
- size: Size;
- }
- }
-
- /****************************************************
- * Collider
- *****************************************************/
-
- export namespace Collider {
- /** !#en Defines a Circle Collider .
- !#zh 用来定义圆形碰撞体 */
- export class Circle {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Circle radius
- !#zh 圆形半径 */
- radius: number;
- }
- }
-
- /****************************************************
- * Collider
- *****************************************************/
-
- export namespace Collider {
- /** !#en Defines a Polygon Collider .
- !#zh 用来定义多边形碰撞体 */
- export class Polygon {
- /** !#en Position offset
- !#zh 位置偏移量 */
- offset: Vec2;
- /** !#en Polygon points
- !#zh 多边形顶点数组 */
- points: Vec2[];
- }
- }
-
- /****************************************************
- * Event
- *****************************************************/
-
- export namespace Event {
- /** !#en The Custom event
- !#zh 自定义事件 */
- export class EventCustom extends Event {
- /**
-
- @param type The name of the event (case-sensitive), e.g. "click", "fire", or "submit"
- @param bubbles A boolean indicating whether the event bubbles up through the tree or not
- */
- constructor(type: string, bubbles: boolean);
- /** !#en A reference to the detailed data of the event
- !#zh 事件的详细数据 */
- detail: any;
- /**
- !#en Sets user data
- !#zh 设置用户数据
- @param data data
- */
- setUserData(data: any): void;
- /**
- !#en Gets user data
- !#zh 获取用户数据
- */
- getUserData(): any;
- /**
- !#en Gets event name
- !#zh 获取事件名称
- */
- getEventName(): string;
- }
- }
-
- /****************************************************
- * SystemEvent
- *****************************************************/
-
- export namespace SystemEvent {
- /** !#en The event type supported by SystemEvent
- !#zh SystemEvent 支持的事件类型 */
- export class EventType {
- /** !#en The event type for press the key down event, you can use its value directly: 'keydown'
- !#zh 当按下按键时触发的事件 */
- static KEY_DOWN: string;
- /** !#en The event type for press the key up event, you can use its value directly: 'keyup'
- !#zh 当松开按键时触发的事件 */
- static KEY_UP: string;
- /** !#en The event type for press the devicemotion event, you can use its value directly: 'devicemotion'
- !#zh 重力感应 */
- static DEVICEMOTION: string;
- }
- }
-
- /****************************************************
- * Animation
- *****************************************************/
-
- export namespace Animation {
- /** !#en The event type supported by Animation
- !#zh Animation 支持的事件类型 */
- export class EventType {
- /** !#en Emit when begin playing animation
- !#zh 开始播放时触发 */
- static PLAY: string;
- /** !#en Emit when stop playing animation
- !#zh 停止播放时触发 */
- static STOP: string;
- /** !#en Emit when pause animation
- !#zh 暂停播放时触发 */
- static PAUSE: string;
- /** !#en Emit when resume animation
- !#zh 恢复播放时触发 */
- static RESUME: string;
- /** !#en If animation repeat count is larger than 1, emit when animation play to the last frame
- !#zh 假如动画循环次数大于 1,当动画播放到最后一帧时触发 */
- static LASTFRAME: string;
- /** !#en Emit when finish playing animation
- !#zh 动画播放完成时触发 */
- static FINISHED: string;
- }
- }
-
- /****************************************************
- * Button
- *****************************************************/
-
- export namespace Button {
- /** !#en Enum for transition type.
- !#zh 过渡类型 */
- export enum Transition {
- NONE = 0,
- COLOR = 0,
- SPRITE = 0,
- SCALE = 0,
- }
- }
-
- /****************************************************
- * Component
- *****************************************************/
-
- export namespace Component {
- /** !#en
- Component will register a event to target component's handler.
- And it will trigger the handler when a certain event occurs.
-
- !@zh
- “EventHandler” 类用来设置场景中的事件回调,
- 该类允许用户设置回调目标节点,目标组件名,组件方法名,
- 并可通过 emit 方法调用目标函数。 */
- export class EventHandler {
- /** !#en the node that contains target callback, such as the node example script belongs to
- !#zh 事件响应函数所在节点 ,比如例子中脚本归属的节点本身 */
- target: Node;
- /** !#en name of the component(script) that contains target callback, such as the name 'MainMenu' of script in example
- !#zh 事件响应函数所在组件名(脚本名), 比如例子中的脚本名 'MainMenu' */
- component: string;
- /** !#en Event handler, such as function's name 'onClick' in example
- !#zh 响应事件函数名,比如例子中的 'onClick' */
- handler: string;
- /** !#en Custom Event Data, such as 'eventType' in example
- !#zh 自定义事件数据,比如例子中的 eventType */
- customEventData: string;
- /**
-
- @param events events
- @param params params
- */
- static emitEvents(events: EventHandler[], ...params: any[]): void;
- /**
- !#en Emit event with params
- !#zh 触发目标组件上的指定 handler 函数,该参数是回调函数的参数值(可不填)。
- @param params params
-
- @example
- ```js
- // Call Function
- var eventHandler = new cc.Component.EventHandler();
- eventHandler.target = newTarget;
- eventHandler.component = "MainMenu";
- eventHandler.handler = "OnClick"
- eventHandler.emit(["param1", "param2", ....]);
- ```
- */
- emit(params: any[]): void;
- }
- }
-
- /****************************************************
- * Label
- *****************************************************/
-
- export namespace Label {
- /** !#en Enum for text alignment.
- !#zh 文本横向对齐类型 */
- export enum HorizontalAlign {
- LEFT = 0,
- CENTER = 0,
- RIGHT = 0,
- }
- }
-
- /****************************************************
- * Label
- *****************************************************/
-
- export namespace Label {
- /** !#en Enum for vertical text alignment.
- !#zh 文本垂直对齐类型 */
- export enum VerticalAlign {
- TOP = 0,
- CENTER = 0,
- BOTTOM = 0,
- }
- }
-
- /****************************************************
- * Label
- *****************************************************/
-
- export namespace Label {
- /** !#en Enum for Overflow.
- !#zh Overflow 类型 */
- export enum Overflow {
- NONE = 0,
- CLAMP = 0,
- SHRINK = 0,
- RESIZE_HEIGHT = 0,
- }
- }
-
- /****************************************************
- * Label
- *****************************************************/
-
- export namespace Label {
- /** !#en Enum for font type.
- !#zh Type 类型 */
- export enum Type {
- TTF = 0,
- BMFont = 0,
- SystemFont = 0,
- }
- }
-
- /****************************************************
- * Label
- *****************************************************/
-
- export namespace Label {
- /** !#en Enum for cache mode.
- !#zh CacheMode 类型 */
- export enum CacheMode {
- NONE = 0,
- BITMAP = 0,
- CHAR = 0,
- }
- }
-
- /****************************************************
- * Layout
- *****************************************************/
-
- export namespace Layout {
- /** !#en Enum for Layout type
- !#zh 布局类型 */
- export enum Type {
- NONE = 0,
- HORIZONTAL = 0,
- VERTICAL = 0,
- GRID = 0,
- }
- }
-
- /****************************************************
- * Layout
- *****************************************************/
-
- export namespace Layout {
- /** !#en Enum for Layout Resize Mode
- !#zh 缩放模式 */
- export enum ResizeMode {
- NONE = 0,
- CONTAINER = 0,
- CHILDREN = 0,
- }
- }
-
- /****************************************************
- * Layout
- *****************************************************/
-
- export namespace Layout {
- /** !#en Enum for Grid Layout start axis direction.
- The items in grid layout will be arranged in each axis at first.;
- !#zh 布局轴向,只用于 GRID 布局。 */
- export enum AxisDirection {
- HORIZONTAL = 0,
- VERTICAL = 0,
- }
- }
-
- /****************************************************
- * Layout
- *****************************************************/
-
- export namespace Layout {
- /** !#en Enum for vertical layout direction.
- Used in Grid Layout together with AxisDirection is VERTICAL
- !#zh 垂直方向布局方式 */
- export enum VerticalDirection {
- BOTTOM_TO_TOP = 0,
- TOP_TO_BOTTOM = 0,
- }
- }
-
- /****************************************************
- * Layout
- *****************************************************/
-
- export namespace Layout {
- /** !#en Enum for horizontal layout direction.
- Used in Grid Layout together with AxisDirection is HORIZONTAL
- !#zh 水平方向布局方式 */
- export enum HorizontalDirection {
- LEFT_TO_RIGHT = 0,
- RIGHT_TO_LEFT = 0,
- }
- }
-
- /****************************************************
- * Mask
- *****************************************************/
-
- export namespace Mask {
- /** !#en the type for mask.
- !#zh 遮罩组件类型 */
- export enum Type {
- RECT = 0,
- ELLIPSE = 0,
- IMAGE_STENCIL = 0,
- }
- }
-
- /****************************************************
- * PageView
- *****************************************************/
-
- export namespace PageView {
- /** !#en The Page View Size Mode
- !#zh 页面视图每个页面统一的大小类型 */
- export enum SizeMode {
- Unified = 0,
- Free = 0,
- }
- }
-
- /****************************************************
- * PageView
- *****************************************************/
-
- export namespace PageView {
- /** !#en The Page View Direction
- !#zh 页面视图滚动类型 */
- export enum Direction {
- Horizontal = 0,
- Vertical = 0,
- }
- }
-
- /****************************************************
- * PageView
- *****************************************************/
-
- export namespace PageView {
- /** !#en Enum for ScrollView event type.
- !#zh 滚动视图事件类型 */
- export enum EventType {
- PAGE_TURNING = 0,
- }
- }
-
- /****************************************************
- * PageViewIndicator
- *****************************************************/
-
- export namespace PageViewIndicator {
- /** !#en Enum for PageView Indicator direction
- !#zh 页面视图指示器的摆放方向 */
- export enum Direction {
- HORIZONTAL = 0,
- VERTICAL = 0,
- }
- }
-
- /****************************************************
- * ProgressBar
- *****************************************************/
-
- export namespace ProgressBar {
- /** !#en Enum for ProgressBar mode
- !#zh 进度条模式 */
- export enum Mode {
- HORIZONTAL = 0,
- VERTICAL = 0,
- FILLED = 0,
- }
- }
-
- /****************************************************
- * Scrollbar
- *****************************************************/
-
- export namespace Scrollbar {
- /** Enum for Scrollbar direction */
- export enum Direction {
- HORIZONTAL = 0,
- VERTICAL = 0,
- }
- }
-
- /****************************************************
- * ScrollView
- *****************************************************/
-
- export namespace ScrollView {
- /** !#en Enum for ScrollView event type.
- !#zh 滚动视图事件类型 */
- export enum EventType {
- SCROLL_TO_TOP = 0,
- SCROLL_TO_BOTTOM = 0,
- SCROLL_TO_LEFT = 0,
- SCROLL_TO_RIGHT = 0,
- SCROLLING = 0,
- BOUNCE_TOP = 0,
- BOUNCE_BOTTOM = 0,
- BOUNCE_LEFT = 0,
- BOUNCE_RIGHT = 0,
- SCROLL_ENDED = 0,
- TOUCH_UP = 0,
- AUTOSCROLL_ENDED_WITH_THRESHOLD = 0,
- SCROLL_BEGAN = 0,
- }
- }
-
- /****************************************************
- * Slider
- *****************************************************/
-
- export namespace Slider {
- /** !#en The Slider Direction
- !#zh 滑动器方向 */
- export enum Direction {
- Horizontal = 0,
- Vertical = 0,
- }
- }
-
- /****************************************************
- * Sprite
- *****************************************************/
-
- export namespace Sprite {
- /** !#en Enum for sprite type.
- !#zh Sprite 类型 */
- export enum Type {
- SIMPLE = 0,
- SLICED = 0,
- TILED = 0,
- FILLED = 0,
- MESH = 0,
- }
- }
-
- /****************************************************
- * Sprite
- *****************************************************/
-
- export namespace Sprite {
- /** !#en Enum for fill type.
- !#zh 填充类型 */
- export enum FillType {
- HORIZONTAL = 0,
- VERTICAL = 0,
- RADIAL = 0,
- }
- }
-
- /****************************************************
- * Sprite
- *****************************************************/
-
- export namespace Sprite {
- /** !#en Sprite Size can track trimmed size, raw size or none.
- !#zh 精灵尺寸调整模式 */
- export enum SizeMode {
- CUSTOM = 0,
- TRIMMED = 0,
- RAW = 0,
- }
- }
-
- /****************************************************
- * Sprite
- *****************************************************/
-
- export namespace Sprite {
- /** !#en Sprite state can choice the normal or grayscale.
- !#zh 精灵颜色通道模式。 */
- export enum State {
- NORMAL = 0,
- GRAY = 0,
- }
- }
-
- /****************************************************
- * Widget
- *****************************************************/
-
- export namespace Widget {
- /** !#en Enum for Widget's alignment mode, indicating when the widget should refresh.
- !#zh Widget 的对齐模式,表示 Widget 应该何时刷新。 */
- export enum AlignMode {
- ONCE = 0,
- ON_WINDOW_RESIZE = 0,
- ALWAYS = 0,
- }
- }
-
- /****************************************************
- * Prefab
- *****************************************************/
-
- export namespace Prefab {
- /** !#zh
- Prefab 创建实例所用的优化策略,配合 {{#crossLink "Prefab.optimizationPolicy"}}cc.Prefab#optimizationPolicy{{/crossLink}} 使用。
- !#en
- An enumeration used with the {{#crossLink "Prefab.optimizationPolicy"}}cc.Prefab#optimizationPolicy{{/crossLink}}
- to specify how to optimize the instantiate operation. */
- export enum OptimizationPolicy {
- AUTO = 0,
- SINGLE_INSTANCE = 0,
- MULTI_INSTANCE = 0,
- }
- }
-
- /****************************************************
- * Texture2D
- *****************************************************/
-
- export namespace Texture2D {
- /** The texture pixel format, default value is RGBA8888,
- you should note that textures loaded by normal image files (png, jpg) can only support RGBA8888 format,
- other formats are supported by compressed file types or raw data. */
- export enum PixelFormat {
- RGB565 = 0,
- RGB5A1 = 0,
- RGBA4444 = 0,
- RGB888 = 0,
- RGBA8888 = 0,
- RGBA32F = 0,
- A8 = 0,
- I8 = 0,
- AI88 = 0,
- RGB_PVRTC_2BPPV1 = 0,
- RGBA_PVRTC_2BPPV1 = 0,
- RGB_A_PVRTC_2BPPV1 = 0,
- RGB_PVRTC_4BPPV1 = 0,
- RGBA_PVRTC_4BPPV1 = 0,
- RGB_A_PVRTC_4BPPV1 = 0,
- RGB_ETC1 = 0,
- RGBA_ETC1 = 0,
- RGB_ETC2 = 0,
- RGBA_ETC2 = 0,
- }
- }
-
- /****************************************************
- * Texture2D
- *****************************************************/
-
- export namespace Texture2D {
- /** The texture wrap mode */
- export enum WrapMode {
- REPEAT = 0,
- CLAMP_TO_EDGE = 0,
- MIRRORED_REPEAT = 0,
- }
- }
-
- /****************************************************
- * Texture2D
- *****************************************************/
-
- export namespace Texture2D {
- /** The texture filter mode */
- export enum Filter {
- LINEAR = 0,
- NEAREST = 0,
- }
- }
-
- /****************************************************
- * Event
- *****************************************************/
-
- export namespace Event {
- /** !#en The mouse event
- !#zh 鼠标事件类型 */
- export class EventMouse extends Event {
- /**
- !#en Sets scroll data.
- !#zh 设置鼠标的滚动数据。
- @param scrollX scrollX
- @param scrollY scrollY
- */
- setScrollData(scrollX: number, scrollY: number): void;
- /**
- !#en Returns the x axis scroll value.
- !#zh 获取鼠标滚动的X轴距离,只有滚动时才有效。
- */
- getScrollX(): number;
- /**
- !#en Returns the y axis scroll value.
- !#zh 获取滚轮滚动的 Y 轴距离,只有滚动时才有效。
- */
- getScrollY(): number;
- /**
- !#en Sets cursor location.
- !#zh 设置当前鼠标位置。
- @param x x
- @param y y
- */
- setLocation(x: number, y: number): void;
- /**
- !#en Returns cursor location.
- !#zh 获取鼠标位置对象,对象包含 x 和 y 属性。
- */
- getLocation(): Vec2;
- /**
- !#en Returns the current cursor location in screen coordinates.
- !#zh 获取当前事件在游戏窗口内的坐标位置对象,对象包含 x 和 y 属性。
- */
- getLocationInView(): Vec2;
- /**
- !#en Returns the previous touch location.
- !#zh 获取鼠标点击在上一次事件时的位置对象,对象包含 x 和 y 属性。
- */
- getPreviousLocation(): Vec2;
- /**
- !#en Returns the delta distance from the previous location to current location.
- !#zh 获取鼠标距离上一次事件移动的距离对象,对象包含 x 和 y 属性。
- */
- getDelta(): Vec2;
- /**
- !#en Returns the X axis delta distance from the previous location to current location.
- !#zh 获取鼠标距离上一次事件移动的 X 轴距离。
- */
- getDeltaX(): number;
- /**
- !#en Returns the Y axis delta distance from the previous location to current location.
- !#zh 获取鼠标距离上一次事件移动的 Y 轴距离。
- */
- getDeltaY(): number;
- /**
- !#en Sets mouse button.
- !#zh 设置鼠标按键。
- @param button button
- */
- setButton(button: number): void;
- /**
- !#en Returns mouse button.
- !#zh 获取鼠标按键。
- */
- getButton(): number;
- /**
- !#en Returns location X axis data.
- !#zh 获取鼠标当前位置 X 轴。
- */
- getLocationX(): number;
- /**
- !#en Returns location Y axis data.
- !#zh 获取鼠标当前位置 Y 轴。
- */
- getLocationY(): number;
- /** !#en The none event code of mouse event.
- !#zh 无。 */
- static NONE: number;
- /** !#en The event type code of mouse down event.
- !#zh 鼠标按下事件。 */
- static DOWN: number;
- /** !#en The event type code of mouse up event.
- !#zh 鼠标按下后释放事件。 */
- static UP: number;
- /** !#en The event type code of mouse move event.
- !#zh 鼠标移动事件。 */
- static MOVE: number;
- /** !#en The event type code of mouse scroll event.
- !#zh 鼠标滚轮事件。 */
- static SCROLL: number;
- /** !#en The tag of Mouse left button.
- !#zh 鼠标左键的标签。 */
- static BUTTON_LEFT: number;
- /** !#en The tag of Mouse right button (The right button number is 2 on browser).
- !#zh 鼠标右键的标签。 */
- static BUTTON_RIGHT: number;
- /** !#en The tag of Mouse middle button (The right button number is 1 on browser).
- !#zh 鼠标中键的标签。 */
- static BUTTON_MIDDLE: number;
- /** !#en The tag of Mouse button 4.
- !#zh 鼠标按键 4 的标签。 */
- static BUTTON_4: number;
- /** !#en The tag of Mouse button 5.
- !#zh 鼠标按键 5 的标签。 */
- static BUTTON_5: number;
- /** !#en The tag of Mouse button 6.
- !#zh 鼠标按键 6 的标签。 */
- static BUTTON_6: number;
- /** !#en The tag of Mouse button 7.
- !#zh 鼠标按键 7 的标签。 */
- static BUTTON_7: number;
- /** !#en The tag of Mouse button 8.
- !#zh 鼠标按键 8 的标签。 */
- static BUTTON_8: number;
- }
- }
-
- /****************************************************
- * Event
- *****************************************************/
-
- export namespace Event {
- /** !#en The touch event
- !#zh 触摸事件 */
- export class EventTouch extends Event {
- /**
-
- @param touchArr The array of the touches
- @param bubbles A boolean indicating whether the event bubbles up through the tree or not
- */
- constructor(touchArr: any[], bubbles: boolean);
- /** !#en The current touch object
- !#zh 当前触点对象 */
- touch: Touch;
- /**
- !#en Returns event code.
- !#zh 获取事件类型。
- */
- getEventCode(): number;
- /**
- !#en Returns touches of event.
- !#zh 获取触摸点的列表。
- */
- getTouches(): any[];
- /**
- !#en Sets touch location.
- !#zh 设置当前触点位置
- @param x x
- @param y y
- */
- setLocation(x: number, y: number): void;
- /**
- !#en Returns touch location.
- !#zh 获取触点位置。
- */
- getLocation(): Vec2;
- /**
- !#en Returns the current touch location in screen coordinates.
- !#zh 获取当前触点在游戏窗口中的位置。
- */
- getLocationInView(): Vec2;
- /**
- !#en Returns the previous touch location.
- !#zh 获取触点在上一次事件时的位置对象,对象包含 x 和 y 属性。
- */
- getPreviousLocation(): Vec2;
- /**
- !#en Returns the start touch location.
- !#zh 获取触点落下时的位置对象,对象包含 x 和 y 属性。
- */
- getStartLocation(): Vec2;
- /**
- !#en Returns the id of cc.Touch.
- !#zh 触点的标识 ID,可以用来在多点触摸中跟踪触点。
- */
- getID(): number;
- /**
- !#en Returns the delta distance from the previous location to current location.
- !#zh 获取触点距离上一次事件移动的距离对象,对象包含 x 和 y 属性。
- */
- getDelta(): Vec2;
- /**
- !#en Returns the X axis delta distance from the previous location to current location.
- !#zh 获取触点距离上一次事件移动的 x 轴距离。
- */
- getDeltaX(): number;
- /**
- !#en Returns the Y axis delta distance from the previous location to current location.
- !#zh 获取触点距离上一次事件移动的 y 轴距离。
- */
- getDeltaY(): number;
- /**
- !#en Returns location X axis data.
- !#zh 获取当前触点 X 轴位置。
- */
- getLocationX(): number;
- /**
- !#en Returns location Y axis data.
- !#zh 获取当前触点 Y 轴位置。
- */
- getLocationY(): number;
- }
- }
-
- /****************************************************
- * Event
- *****************************************************/
-
- export namespace Event {
- /** !#en The acceleration event
- !#zh 加速度事件 */
- export class EventAcceleration extends Event {
- }
- }
-
- /****************************************************
- * Event
- *****************************************************/
-
- export namespace Event {
- /** !#en The keyboard event
- !#zh 键盘事件 */
- export class EventKeyboard extends Event {
- /** !#en
- The keyCode read-only property represents a system and implementation dependent numerical code identifying the unmodified value of the pressed key.
- This is usually the decimal ASCII (RFC 20) or Windows 1252 code corresponding to the key.
- If the key can't be identified, this value is 0.
-
- !#zh
- keyCode 是只读属性它表示一个系统和依赖于实现的数字代码,可以识别按键的未修改值。
- 这通常是十进制 ASCII (RFC20) 或者 Windows 1252 代码,所对应的密钥。
- 如果无法识别该键,则该值为 0。 */
- keyCode: number;
- }
- }
-
- /****************************************************
- * Graphics
- *****************************************************/
-
- export namespace Graphics {
- /** !#en Enum for LineCap.
- !#zh 线段末端属性 */
- export enum LineCap {
- BUTT = 0,
- ROUND = 0,
- SQUARE = 0,
- }
- }
-
- /****************************************************
- * Graphics
- *****************************************************/
-
- export namespace Graphics {
- /** !#en Enum for LineJoin.
- !#zh 线段拐角属性 */
- export enum LineJoin {
- BEVEL = 0,
- ROUND = 0,
- MITER = 0,
- }
- }
-
- /****************************************************
- * MeshRenderer
- *****************************************************/
-
- export namespace MeshRenderer {
- /** !#en Shadow projection mode
-
- !#ch 阴影投射方式 */
- export enum ShadowCastingMode {
- OFF = 0,
- ON = 0,
- }
- }
-
- /****************************************************
- * Pipeline
- *****************************************************/
-
- export namespace Pipeline {
- /** The downloader pipe, it can download several types of files:
- 1. Text
- 2. Image
- 3. Script
- 4. Audio
- 5. Assets
- All unknown type will be downloaded as plain text.
- You can pass custom supported types in the constructor. */
- export class Downloader {
- /**
- Constructor of Downloader, you can pass custom supported types.
- @param extMap Custom supported types with corresponded handler
-
- @example
- ```js
- var downloader = new Downloader({
-
- 'scene' : function (url, callback) {}
- });
- ```
- */
- constructor(extMap: any);
- /**
- Add custom supported types handler or modify existing type handler.
- @param extMap Custom supported types with corresponded handler
- */
- addHandlers(extMap: any): void;
- /**
- !#en
- Load subpackage with name.
- !#zh
- 通过子包名加载子包代码。
- @param name Subpackage name
- @param completeCallback Callback invoked when subpackage loaded
- */
- loadSubpackage(name: string, completeCallback?: (error: Error) => void): void;
- }
- }
-
- /****************************************************
- * Pipeline
- *****************************************************/
-
- export namespace Pipeline {
- /** The loader pipe, it can load several types of files:
- 1. Images
- 2. JSON
- 3. Plist
- 4. Audio
- 5. Font
- 6. Cocos Creator scene
- It will not interfere with items of unknown type.
- You can pass custom supported types in the constructor. */
- export class Loader {
- /**
- Constructor of Loader, you can pass custom supported types.
- @param extMap Custom supported types with corresponded handler
-
- @example
- ```js
- var loader = new Loader({
-
- 'scene' : function (url, callback) {}
- });
- ```
- */
- constructor(extMap: any);
- /**
- Add custom supported types handler or modify existing type handler.
- @param extMap Custom supported types with corresponded handler
- */
- addHandlers(extMap: any): void;
- }
- }
-
- /****************************************************
- * LoadingItems
- *****************************************************/
-
- export namespace LoadingItems {
- /** !#en The item states of the LoadingItems, its value could be LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR
- !#zh LoadingItems 队列中的加载项状态,状态的值可能是 LoadingItems.ItemState.WORKING | LoadingItems.ItemState.COMPLETET | LoadingItems.ItemState.ERROR */
- export enum ItemState {
- WORKING = 0,
- COMPLETET = 0,
- ERROR = 0,
- }
- }
-
- /****************************************************
- * PhysicsManager
- *****************************************************/
-
- export namespace PhysicsManager {
- /** !#en
- The draw bits for drawing physics debug information.<br>
- example:<br>
- ```js
- cc.director.getPhysicsManager().debugDrawFlags =
- // cc.PhysicsManager.DrawBits.e_aabbBit |
- // cc.PhysicsManager.DrawBits.e_pairBit |
- // cc.PhysicsManager.DrawBits.e_centerOfMassBit |
- cc.PhysicsManager.DrawBits.e_jointBit |
- cc.PhysicsManager.DrawBits.e_shapeBit;
- ```
- !#zh
- 指定物理系统需要绘制哪些调试信息。<br>
- example:<br>
- ```js
- cc.director.getPhysicsManager().debugDrawFlags =
- // cc.PhysicsManager.DrawBits.e_aabbBit |
- // cc.PhysicsManager.DrawBits.e_pairBit |
- // cc.PhysicsManager.DrawBits.e_centerOfMassBit |
- cc.PhysicsManager.DrawBits.e_jointBit |
- cc.PhysicsManager.DrawBits.e_shapeBit;
- ``` */
- export enum DrawBits {
- e_aabbBit = 0,
- e_jointBit = 0,
- e_shapeBit = 0,
- }
- }
-
- /****************************************************
- * macro
- *****************************************************/
-
- export namespace macro {
- /** !#en Key map for keyboard event
- !#zh 键盘事件的按键值 */
- export enum KEY {
- none = 0,
- back = 0,
- menu = 0,
- backspace = 0,
- tab = 0,
- enter = 0,
- shift = 0,
- ctrl = 0,
- alt = 0,
- pause = 0,
- capslock = 0,
- escape = 0,
- space = 0,
- pageup = 0,
- pagedown = 0,
- end = 0,
- home = 0,
- left = 0,
- up = 0,
- right = 0,
- down = 0,
- select = 0,
- insert = 0,
- Delete = 0,
- a = 0,
- b = 0,
- c = 0,
- d = 0,
- e = 0,
- f = 0,
- g = 0,
- h = 0,
- i = 0,
- j = 0,
- k = 0,
- l = 0,
- m = 0,
- n = 0,
- o = 0,
- p = 0,
- q = 0,
- r = 0,
- s = 0,
- t = 0,
- u = 0,
- v = 0,
- w = 0,
- x = 0,
- y = 0,
- z = 0,
- num0 = 0,
- num1 = 0,
- num2 = 0,
- num3 = 0,
- num4 = 0,
- num5 = 0,
- num6 = 0,
- num7 = 0,
- num8 = 0,
- num9 = 0,
- '*' = 0,
- '+' = 0,
- '-' = 0,
- numdel = 0,
- '/' = 0,
- f1 = 0,
- f2 = 0,
- f3 = 0,
- f4 = 0,
- f5 = 0,
- f6 = 0,
- f7 = 0,
- f8 = 0,
- f9 = 0,
- f10 = 0,
- f11 = 0,
- f12 = 0,
- numlock = 0,
- scrolllock = 0,
- ';' = 0,
- semicolon = 0,
- equal = 0,
- '=' = 0,
- ',' = 0,
- comma = 0,
- dash = 0,
- '.' = 0,
- period = 0,
- forwardslash = 0,
- grave = 0,
- '[' = 0,
- openbracket = 0,
- backslash = 0,
- ']' = 0,
- closebracket = 0,
- quote = 0,
- dpadLeft = 0,
- dpadRight = 0,
- dpadUp = 0,
- dpadDown = 0,
- dpadCenter = 0,
- }
- }
-
- /****************************************************
- * macro
- *****************************************************/
-
- export namespace macro {
- /** Image formats */
- export enum ImageFormat {
- JPG = 0,
- PNG = 0,
- TIFF = 0,
- WEBP = 0,
- PVR = 0,
- ETC = 0,
- S3TC = 0,
- ATITC = 0,
- TGA = 0,
- RAWDATA = 0,
- UNKNOWN = 0,
- }
- }
-
- /****************************************************
- * macro
- *****************************************************/
-
- export namespace macro {
- /** !#en
- Enum for blend factor
- Refer to: http://www.andersriggelsen.dk/glblendfunc.php
- !#zh
- 混合因子
- 可参考: http://www.andersriggelsen.dk/glblendfunc.php */
- export enum BlendFactor {
- ONE = 0,
- ZERO = 0,
- SRC_ALPHA = 0,
- SRC_COLOR = 0,
- DST_ALPHA = 0,
- DST_COLOR = 0,
- ONE_MINUS_SRC_ALPHA = 0,
- ONE_MINUS_SRC_COLOR = 0,
- ONE_MINUS_DST_ALPHA = 0,
- ONE_MINUS_DST_COLOR = 0,
- }
- }
-
- /****************************************************
- * macro
- *****************************************************/
-
- export namespace macro {
- /** undefined */
- export enum TextAlignment {
- LEFT = 0,
- CENTER = 0,
- RIGHT = 0,
- }
- }
-
- /****************************************************
- * sys
- *****************************************************/
-
- export namespace sys {
- /** !#en
- Network type enumeration
- !#zh
- 网络类型枚举 */
- export enum NetworkType {
- NONE = 0,
- LAN = 0,
- WWAN = 0,
- }
- }
-
- /****************************************************
- * EditBox
- *****************************************************/
-
- export namespace EditBox {
- /** !#en Enum for keyboard return types
- !#zh 键盘的返回键类型 */
- export enum KeyboardReturnType {
- DEFAULT = 0,
- DONE = 0,
- SEND = 0,
- SEARCH = 0,
- GO = 0,
- NEXT = 0,
- }
- }
-
- /****************************************************
- * EditBox
- *****************************************************/
-
- export namespace EditBox {
- /** !#en The EditBox's InputMode defines the type of text that the user is allowed to enter.
- !#zh 输入模式 */
- export enum InputMode {
- ANY = 0,
- EMAIL_ADDR = 0,
- NUMERIC = 0,
- PHONE_NUMBER = 0,
- URL = 0,
- DECIMAL = 0,
- SINGLE_LINE = 0,
- }
- }
-
- /****************************************************
- * EditBox
- *****************************************************/
-
- export namespace EditBox {
- /** !#en Enum for the EditBox's input flags
- !#zh 定义了一些用于设置文本显示和文本格式化的标志位。 */
- export enum InputFlag {
- PASSWORD = 0,
- SENSITIVE = 0,
- INITIAL_CAPS_WORD = 0,
- INITIAL_CAPS_SENTENCE = 0,
- INITIAL_CAPS_ALL_CHARACTERS = 0,
- DEFAULT = 0,
- }
- }
-
- /****************************************************
- * primitive
- *****************************************************/
-
- export namespace primitive {
- /** undefined */
- export enum PolyhedronType {
- Tetrahedron = 0,
- Octahedron = 0,
- Dodecahedron = 0,
- Icosahedron = 0,
- Rhombicuboctahedron = 0,
- TriangularPrism = 0,
- PentagonalPrism = 0,
- HexagonalPrism = 0,
- SquarePyramid = 0,
- PentagonalPyramid = 0,
- TriangularDipyramid = 0,
- PentagonalDipyramid = 0,
- ElongatedSquareDipyramid = 0,
- ElongatedPentagonalDipyramid = 0,
- ElongatedPentagonalCupola = 0,
- }
- }
-
- /****************************************************
- * primitive
- *****************************************************/
-
- export namespace primitive {
- /** undefined */
- export class VertexData {
- positions: number[];
- normals: number[];
- uvs: number[];
- indices: number[];
- minPos: Vec3;
- maxPos: Vec3;
- boundingRadius: number;
- }
- }
-
- }
- /** !#en
- The global main namespace of DragonBones, all classes, functions,
- properties and constants of DragonBones are defined in this namespace
- !#zh
- DragonBones 的全局的命名空间,
- 与 DragonBones 相关的所有的类,函数,属性,常量都在这个命名空间中定义。 */
- declare namespace dragonBones {
- /** !#en
- The Armature Display of DragonBones <br/>
- <br/>
- (Armature Display has a reference to a DragonBonesAsset and stores the state for ArmatureDisplay instance,
- which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible. <br/>
- Multiple Armature Display can use the same DragonBonesAsset which includes all animations, skins, and attachments.) <br/>
- !#zh
- DragonBones 骨骼动画 <br/>
- <br/>
- (Armature Display 具有对骨骼数据的引用并且存储了骨骼实例的状态,
- 它由当前的骨骼动作,slot 颜色,和可见的 slot attachments 组成。<br/>
- 多个 Armature Display 可以使用相同的骨骼数据,其中包括所有的动画,皮肤和 attachments。)<br/> */
- export class ArmatureDisplay extends cc.RenderComponent {
- /** !#en
- The DragonBones data contains the armatures information (bind pose bones, slots, draw order,
- attachments, skins, etc) and animations but does not hold any state.<br/>
- Multiple ArmatureDisplay can share the same DragonBones data.
- !#zh
- 骨骼数据包含了骨骼信息(绑定骨骼动作,slots,渲染顺序,
- attachments,皮肤等等)和动画但不持有任何状态。<br/>
- 多个 ArmatureDisplay 可以共用相同的骨骼数据。 */
- dragonAsset: DragonBonesAsset;
- /** !#en
- The atlas asset for the DragonBones.
- !#zh
- 骨骼数据所需的 Atlas Texture 数据。 */
- dragonAtlasAsset: DragonBonesAtlasAsset;
- /** !#en The name of current armature.
- !#zh 当前的 Armature 名称。 */
- armatureName: string;
- /** !#en The name of current playing animation.
- !#zh 当前播放的动画名称。 */
- animationName: string;
- _defaultArmatureIndex: number;
- /** !#en The time scale of this armature.
- !#zh 当前骨骼中所有动画的时间缩放率。 */
- timeScale: number;
- /** !#en The play times of the default animation.
- -1 means using the value of config file;
- 0 means repeat for ever
- >0 means repeat times
- !#zh 播放默认动画的循环次数
- -1 表示使用配置文件中的默认值;
- 0 表示无限循环
- >0 表示循环次数 */
- playTimes: number;
- /** !#en Indicates whether to enable premultiplied alpha.
- You should disable this option when image's transparent area appears to have opaque pixels,
- or enable this option when image's half transparent area appears to be darken.
- !#zh 是否启用贴图预乘。
- 当图片的透明区域出现色块时需要关闭该选项,当图片的半透明区域颜色变黑时需要启用该选项。 */
- premultipliedAlpha: boolean;
- /** !#en Indicates whether open debug bones.
- !#zh 是否显示 bone 的 debug 信息。 */
- debugBones: boolean;
- /** !#en Enabled batch model, if skeleton is complex, do not enable batch, or will lower performance.
- !#zh 开启合批,如果渲染大量相同纹理,且结构简单的骨骼动画,开启合批可以降低drawcall,否则请不要开启,cpu消耗会上升。 */
- enableBatch: boolean;
- /**
- !#en
- The key of dragonbones cache data, which is regard as 'dragonbonesName', when you want to change dragonbones cloth.
- !#zh
- 缓存龙骨数据的key值,换装的时会使用到该值,作为dragonbonesName使用
-
- @example
- ```js
- let factory = dragonBones.CCFactory.getInstance();
- let needChangeSlot = needChangeArmature.armature().getSlot("changeSlotName");
- factory.replaceSlotDisplay(toChangeArmature.getArmatureKey(), "armatureName", "slotName", "displayName", needChangeSlot);
- ```
- */
- getArmatureKey(): void;
- /**
- !#en
- It's best to set cache mode before set property 'dragonAsset', or will waste some cpu time.
- If set the mode in editor, then no need to worry about order problem.
- !#zh
- 若想切换渲染模式,最好在设置'dragonAsset'之前,先设置好渲染模式,否则有运行时开销。
- 若在编辑中设置渲染模式,则无需担心设置次序的问题。
- @param cacheMode cacheMode
-
- @example
- ```js
- armatureDisplay.setAnimationCacheMode(dragonBones.ArmatureDisplay.AnimationCacheMode.SHARED_CACHE);
- ```
- */
- setAnimationCacheMode(cacheMode: ArmatureDisplay.AnimationCacheMode): void;
- /**
- !#en Whether in cached mode.
- !#zh 当前是否处于缓存模式。
- */
- isAnimationCached(): void;
- /**
- !#en
- Play the specified animation.
- Parameter animName specify the animation name.
- Parameter playTimes specify the repeat times of the animation.
- -1 means use the value of the config file.
- 0 means play the animation for ever.
- >0 means repeat times.
- !#zh
- 播放指定的动画.
- animName 指定播放动画的名称。
- playTimes 指定播放动画的次数。
- -1 为使用配置文件中的次数。
- 0 为无限循环播放。
- >0 为动画的重复次数。
- @param animName animName
- @param playTimes playTimes
- */
- playAnimation(animName: string, playTimes: number): dragonBones.AnimationState;
- /**
- !#en
- Updating an animation cache to calculate all frame data in the animation is a cost in
- performance due to calculating all data in a single frame.
- To update the cache, use the invalidAnimationCache method with high performance.
- !#zh
- 更新某个动画缓存, 预计算动画中所有帧数据,由于在单帧计算所有数据,所以较消耗性能。
- 若想更新缓存,可使用 invalidAnimationCache 方法,具有较高性能。
- @param animName animName
- */
- updateAnimationCache(animName: string): void;
- /**
- !#en
- Invalidates the animation cache, which is then recomputed on each frame..
- !#zh
- 使动画缓存失效,之后会在每帧重新计算。
- */
- invalidAnimationCache(): void;
- /**
- !#en
- Get the all armature names in the DragonBones Data.
- !#zh
- 获取 DragonBones 数据中所有的 armature 名称
- */
- getArmatureNames(): any[];
- /**
- !#en
- Get the all animation names of specified armature.
- !#zh
- 获取指定的 armature 的所有动画名称。
- @param armatureName armatureName
- */
- getAnimationNames(armatureName: string): any[];
- /**
- !#en
- Add event listener for the DragonBones Event, the same to addEventListener.
- !#zh
- 添加 DragonBones 事件监听器,与 addEventListener 作用相同。
- @param type A string representing the event type to listen for.
- @param listener The callback that will be invoked when the event is dispatched.
- @param target The target (this object) to invoke the callback, can be null
- */
- on(type: string, listener: (event: cc.Event) => void, target?: any): void;
- /**
- !#en
- Remove the event listener for the DragonBones Event, the same to removeEventListener.
- !#zh
- 移除 DragonBones 事件监听器,与 removeEventListener 作用相同。
- @param type A string representing the event type to listen for.
- @param listener listener
- @param target target
- */
- off(type: string, listener?: Function, target?: any): void;
- /**
- !#en
- Add DragonBones one-time event listener, the callback will remove itself after the first time it is triggered.
- !#zh
- 添加 DragonBones 一次性事件监听器,回调会在第一时间被触发后删除自身。
- @param type A string representing the event type to listen for.
- @param listener The callback that will be invoked when the event is dispatched.
- @param target The target (this object) to invoke the callback, can be null
- */
- once(type: string, listener: (event: cc.Event) => void, target?: any): void;
- /**
- !#en
- Add event listener for the DragonBones Event.
- !#zh
- 添加 DragonBones 事件监听器。
- @param type A string representing the event type to listen for.
- @param listener The callback that will be invoked when the event is dispatched.
- @param target The target (this object) to invoke the callback, can be null
- */
- addEventListener(type: string, listener: (event: cc.Event) => void, target?: any): void;
- /**
- !#en
- Remove the event listener for the DragonBones Event.
- !#zh
- 移除 DragonBones 事件监听器。
- @param type A string representing the event type to listen for.
- @param listener listener
- @param target target
- */
- removeEventListener(type: string, listener?: Function, target?: any): void;
- /**
- !#en
- Build the armature for specified name.
- !#zh
- 构建指定名称的 armature 对象
- @param armatureName armatureName
- @param node node
- */
- buildArmature(armatureName: string, node: cc.Node): ArmatureDisplay;
- /**
- !#en
- Get the current armature object of the ArmatureDisplay.
- !#zh
- 获取 ArmatureDisplay 当前使用的 Armature 对象
- */
- armature(): any;
- }
- /** undefined */
- export class CCFactory extends BaseFactory {
- /**
-
-
- @example
- ```js
- let factory = dragonBones.CCFactory.getInstance();
- ```
- */
- static getInstance(): CCFactory;
- }
- /** !#en The skeleton data of dragonBones.
- !#zh dragonBones 的 骨骼数据。 */
- export class DragonBonesAsset extends cc.Asset {
- /** !#en See http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html
- !#zh 可查看 DragonBones 官方文档 http://developer.egret.com/cn/github/egret-docs/DB/dbLibs/dataFormat/index.html */
- dragonBonesJson: string;
- }
- /** !#en The skeleton atlas data of dragonBones.
- !#zh dragonBones 的骨骼纹理数据。 */
- export class DragonBonesAtlasAsset extends cc.Asset {
- atlasJson: string;
- texture: cc.Texture2D;
- }
- /****************************************************
- * ArmatureDisplay
- *****************************************************/
-
- export namespace ArmatureDisplay {
- /** !#en Enum for cache mode type.
- !#zh Dragonbones渲染类型 */
- export enum AnimationCacheMode {
- REALTIME = 0,
- SHARED_CACHE = 0,
- PRIVATE_CACHE = 0,
- }
- }
-
- }
- /** !#en
- The global main namespace of Spine, all classes, functions,
- properties and constants of Spine are defined in this namespace
- !#zh
- Spine 的全局的命名空间,
- 与 Spine 相关的所有的类,函数,属性,常量都在这个命名空间中定义。 */
- declare namespace sp {
- /** !#en
- The skeleton of Spine <br/>
- <br/>
- (Skeleton has a reference to a SkeletonData and stores the state for skeleton instance,
- which consists of the current pose's bone SRT, slot colors, and which slot attachments are visible. <br/>
- Multiple skeletons can use the same SkeletonData which includes all animations, skins, and attachments.) <br/>
- !#zh
- Spine 骨骼动画 <br/>
- <br/>
- (Skeleton 具有对骨骼数据的引用并且存储了骨骼实例的状态,
- 它由当前的骨骼动作,slot 颜色,和可见的 slot attachments 组成。<br/>
- 多个 Skeleton 可以使用相同的骨骼数据,其中包括所有的动画,皮肤和 attachments。 */
- export class Skeleton extends cc.RenderComponent {
-
- paused: boolean;
-
- skeletonData: SkeletonData;
-
- defaultSkin: string;
-
- defaultAnimation: string;
-
- animation: string;
- _defaultSkinIndex: number;
-
- loop: boolean;
-
- premultipliedAlpha: boolean;
-
- timeScale: number;
-
- debugSlots: boolean;
-
- debugBones: boolean;
-
- debugMesh: boolean;
-
- useTint: boolean;
-
- enableBatch: boolean;
-
- setSkeletonData(skeletonData: sp.spine.SkeletonData): void;
-
- setSlotsRange(startSlotIndex: number, endSlotIndex: number): void;
-
- setAnimationStateData(stateData: sp.spine.AnimationStateData): void;
-
- setAnimationCacheMode(cacheMode: Skeleton.AnimationCacheMode): void;
-
- isAnimationCached(): boolean;
-
- setVertexEffectDelegate(effectDelegate: VertexEffectDelegate): void;
-
- updateWorldTransform(): void;
-
- setToSetupPose(): void;
-
- setBonesToSetupPose(): void;
-
- setSlotsToSetupPose(): void;
-
- updateAnimationCache(animName: string): void;
-
- invalidAnimationCache(): void;
-
- findBone(boneName: string): sp.spine.Bone;
-
- findSlot(slotName: string): sp.spine.Slot;
-
- setSkin(skinName: string): void;
-
- getAttachment(slotName: string, attachmentName: string): sp.spine.Attachment;
-
- setAttachment(slotName: string, attachmentName: string): void;
-
- getTextureAtlas(regionAttachment: sp.spine.RegionAttachment|spine.BoundingBoxAttachment): sp.spine.TextureAtlasRegion;
-
- setMix(fromAnimation: string, toAnimation: string, duration: number): void;
-
- setAnimation(trackIndex: number, name: string, loop: boolean): sp.spine.TrackEntry;
-
- addAnimation(trackIndex: number, name: string, loop: boolean, delay?: number): sp.spine.TrackEntry;
-
- findAnimation(name: string): sp.spine.Animation;
-
- getCurrent(trackIndex: any): sp.spine.TrackEntry;
-
- clearTracks(): void;
-
- clearTrack(trackIndex: number): void;
-
- setStartListener(listener: Function): void;
-
- setInterruptListener(listener: Function): void;
-
- setEndListener(listener: Function): void;
-
- setDisposeListener(listener: Function): void;
-
- setCompleteListener(listener: Function): void;
-
- setEventListener(listener: Function): void;
-
- setTrackStartListener(entry: sp.spine.TrackEntry, listener: Function): void;
-
- setTrackInterruptListener(entry: sp.spine.TrackEntry, listener: Function): void;
-
- setTrackEndListener(entry: sp.spine.TrackEntry, listener: Function): void;
-
- setTrackDisposeListener(entry: sp.spine.TrackEntry, listener: Function): void;
-
- setTrackCompleteListener(entry: sp.spine.TrackEntry, listener: (entry: sp.spine.TrackEntry, loopCount: number) => void): void;
-
- setTrackEventListener(entry: sp.spine.TrackEntry, listener: Function): void;
-
- setTrackEventListener(): sp.spine.AnimationState;
- }
-
- export enum AnimationEventType {
- START = 0,
- END = 0,
- COMPLETE = 0,
- EVENT = 0,
- }
-
- export class SkeletonData extends cc.Asset {
-
- skeletonJson: any;
- atlasText: string;
- textures: cc.Texture2D[];
-
- scale: number;
-
- getRuntimeData(quiet?: boolean): sp.spine.SkeletonData;
- }
-
- export class VertexEffectDelegate {
-
- clear(): void;
-
- initJitter(jitterX: float, jitterY: float): void;
-
- initSwirlWithPow(radius: float, power: float): void;
-
- initSwirlWithPowOut(radius: float, power: float): void;
-
- getJitterVertexEffect(): void;
-
- getSwirlVertexEffect(): void;
-
- getVertexEffect(): void;
-
- getEffectType(): void;
- }
-
-
- export namespace Skeleton {
-
- export enum AnimationCacheMode {
- REALTIME = 0,
- SHARED_CACHE = 0,
- PRIVATE_CACHE = 0,
- }
- }
-
- }
- declare namespace sp.spine {
- }
- declare namespace cc._decorator {
-
- export function ccclass(name?: string): Function;
- export function ccclass(_class?: Function): void;
-
- export function property(options?: {type?: any; visible?: boolean|(() => boolean); displayName?: string; tooltip?: string; multiline?: boolean; readonly?: boolean; min?: number; max?: number; step?: number; range?: number[]; slide?: boolean; serializable?: boolean; formerlySerializedAs?: string; editorOnly?: boolean; override?: boolean; animatable?: boolean} | any[]|Function|cc.ValueType|number|string|boolean): Function;
- export function property(_target: Object, _key: any, _desc?: any): void;
-
- export function executeInEditMode(): Function;
- export function executeInEditMode(_class: Function): void;
-
- export function requireComponent(requiredComponent: typeof cc.Component): Function;
-
- export function menu(path: string): Function;
-
- export function executionOrder(order: number): Function;
-
- export function disallowMultiple(): Function;
- export function disallowMultiple(_class: Function): void;
-
- export function playOnFocus(): Function;
- export function playOnFocus(_class: Function): void;
-
- export function inspector(path: string): Function;
-
- export function help(path: string): Function;
-
- export function mixins(ctor: Function, ...rest: Function[]): Function;
- }
- declare namespace cc.js {
-
- export function isNumber(obj: any): boolean;
-
- export function isString(obj: any): boolean;
-
- export function addon(obj: any, ...sourceObj: any[]): any;
-
- export function mixin(obj: any, ...sourceObj: any[]): any;
-
- export function extend(cls: Function, base: Function): Function;
-
- export function getSuper(ctor: Function): Function;
-
- export function isChildClassOf(subclass: Function, superclass: Function): boolean;
-
- export function clear(obj: any): void;
-
- export function isEmptyObject(obj: any): boolean;
-
- export function getPropertyDescriptor(obj: any, name: string): any;
-
- export function value(obj: any, prop: string, value: any, writable?: boolean, enumerable?: boolean): void;
-
- export function getset(obj: any, prop: string, getter: Function, setter?: Function, enumerable?: boolean, configurable?: boolean): void;
-
- export function get(obj: any, prop: string, getter: Function, enumerable?: boolean, configurable?: boolean): void;
-
- export function set(obj: any, prop: string, setter: Function, enumerable?: boolean, configurable?: boolean): void;
-
- export function getClassName(objOrCtor: any|Function): string;
-
- export var _registeredClassIds: any;
-
- export var _registeredClassNames: any;
-
- export function setClassName(className: string, constructor: Function): void;
-
- export function unregisterClass(...constructor: Function[]): void;
-
- export function getClassByName(classname: string): Function;
-
- export function obsolete(obj: any, obsoleted: string, newExpr: string, writable?: boolean): void;
-
- export function obsoletes(obj: any, objName: any, props: any, writable?: boolean): void;
-
- export function formatStr(msg: string|any, ...subst: any[]): string;
-
- export function createMap(forceDictMode?: boolean): any;
-
- export class array {
-
- static removeAt(array: any[], index: number): void;
-
- static fastRemoveAt(array: any[], index: number): void;
-
- static remove(array: any[], value: any): boolean;
-
- static fastRemove(array: any[], value: number): void;
-
- static verifyType(array: any[], type: Function): boolean;
-
- static removeArray(array: any[], minusArr: any[]): void;
-
- static appendObjectsAt(array: any[], addObjs: any[], index: number): any[];
-
- static indexOf(searchElement: any, fromIndex?: number): number;
-
- static contains(array: any[], value: any): boolean;
-
- static copy(array: any[]): any[];
- }
-
- export class Pool {
-
- constructor(cleanupFunc: (obj: any) => void, size: number);
- constructor(size: number);
-
- get(...params: any[]): any;
-
- count: number;
-
- _get(): any;
-
- put(): void;
-
- resize(): void;
- }
- }
- declare namespace cc.primitive {
-
- export function box(width: number, height: number, length: number, opts: {widthSegments: number; heightSegments: number; lengthSegments: number; }): cc.VertexData;
-
- export function cone(radius: number, height: number, opts: {radialSegments: number; heightSegments: number; capped: boolean; arc: number; }): cc.VertexData;
-
- export function cylinder(radiusTop: number, radiusBottom: number, height: number, opts: {radialSegments: number; heightSegments: number; capped: boolean; arc: number; }): cc.VertexData;
-
- export function plane(width: number, length: number, opts: {widthSegments: number; lengthSegments: number; }): cc.VertexData;
-
- export function quad(): cc.VertexData;
-
- export function sphere(radius: number, opts: {segments: number; }): cc.VertexData;
-
- export function torus(radius: number, tube: number, opts: {radialSegments: number; tubularSegments: number; arc: number; }): cc.VertexData;
-
- export function capsule(radiusTop: number, radiusBottom: number, height: number, opts: {sides: number; heightSegments: number; capped: boolean; arc: number; }): cc.VertexData;
-
- export function polyhedron(type: cc.primitive.PolyhedronType, Size: number, opts: {sizeX: number; sizeY: number; sizeZ: number; }): cc.VertexData;
- }
- declare namespace dragonBones {
-
- const webAssemblyModule: {
- HEAP16: Int16Array;
- _malloc(byteSize: number): number;
- _free(pointer: number): void;
- setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void;
- };
- }
- declare namespace dragonBones {
-
- const enum BinaryOffset {
- WeigthBoneCount = 0,
- WeigthFloatOffset = 1,
- WeigthBoneIndices = 2,
- MeshVertexCount = 0,
- MeshTriangleCount = 1,
- MeshFloatOffset = 2,
- MeshWeightOffset = 3,
- MeshVertexIndices = 4,
- TimelineScale = 0,
- TimelineOffset = 1,
- TimelineKeyFrameCount = 2,
- TimelineFrameValueCount = 3,
- TimelineFrameValueOffset = 4,
- TimelineFrameOffset = 5,
- FramePosition = 0,
- FrameTweenType = 1,
- FrameTweenEasingOrCurveSampleCount = 2,
- FrameCurveSamples = 3,
- DeformMeshOffset = 0,
- DeformCount = 1,
- DeformValueCount = 2,
- DeformValueOffset = 3,
- DeformFloatOffset = 4,
- }
-
- const enum ArmatureType {
- Armature = 0,
- MovieClip = 1,
- Stage = 2,
- }
-
- const enum BoneType {
- Bone = 0,
- Surface = 1,
- }
-
- const enum DisplayType {
- Image = 0,
- Armature = 1,
- Mesh = 2,
- BoundingBox = 3,
- }
-
-
- const enum BoundingBoxType {
- Rectangle = 0,
- Ellipse = 1,
- Polygon = 2,
- }
-
- const enum ActionType {
- Play = 0,
- Frame = 10,
- Sound = 11,
- }
-
- const enum BlendMode {
- Normal = 0,
- Add = 1,
- Alpha = 2,
- Darken = 3,
- Difference = 4,
- Erase = 5,
- HardLight = 6,
- Invert = 7,
- Layer = 8,
- Lighten = 9,
- Multiply = 10,
- Overlay = 11,
- Screen = 12,
- Subtract = 13,
- }
-
- const enum TweenType {
- None = 0,
- Line = 1,
- Curve = 2,
- QuadIn = 3,
- QuadOut = 4,
- QuadInOut = 5,
- }
-
- const enum TimelineType {
- Action = 0,
- ZOrder = 1,
- BoneAll = 10,
- BoneTranslate = 11,
- BoneRotate = 12,
- BoneScale = 13,
- Surface = 50,
- SlotDisplay = 20,
- SlotColor = 21,
- SlotFFD = 22,
- IKConstraint = 30,
- AnimationTime = 40,
- AnimationWeight = 41,
- }
-
-
- const enum OffsetMode {
- None = 0,
- Additive = 1,
- Override = 2,
- }
-
-
- const enum AnimationFadeOutMode {
-
-
- None = 0,
-
-
- SameLayer = 1,
-
-
- SameGroup = 2,
-
-
- SameLayerAndGroup = 3,
-
-
- All = 4,
-
-
- Single = 5,
- }
-
- interface Map<T> {
- [key: string]: T;
- }
-
- class DragonBones {
- static readonly VERSION: string;
- static yDown: boolean;
- static debug: boolean;
- static debugDraw: boolean;
- static webAssembly: boolean;
- private readonly _clock;
- private readonly _events;
- private readonly _objects;
- private _eventManager;
- constructor(eventManager: IEventDispatcher);
- advanceTime(passedTime: number): void;
- bufferEvent(value: EventObject): void;
- bufferObject(object: BaseObject): void;
- readonly clock: WorldClock;
- readonly eventManager: IEventDispatcher;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class BaseObject {
- private static _hashCode;
- private static _defaultMaxCount;
- private static readonly _maxCountMap;
- private static readonly _poolsMap;
- private static _returnObject(object);
- static toString(): string;
-
-
- static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void;
-
-
- static clearPool(objectConstructor?: (typeof BaseObject) | null): void;
-
-
- static borrowObject<T extends BaseObject>(objectConstructor: {
- new (): T;
- }): T;
-
-
- readonly hashCode: number;
- private _isInPool;
-
- protected abstract _onClear(): void;
-
-
- returnToPool(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class Matrix {
-
-
- a: number;
-
-
- b: number;
-
-
- c: number;
-
-
- d: number;
-
-
- tx: number;
-
-
- ty: number;
-
- constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);
- toString(): string;
-
- copyFrom(value: Matrix): Matrix;
-
- copyFromArray(value: Array<number>, offset?: number): Matrix;
-
-
- identity(): Matrix;
-
-
- concat(value: Matrix): Matrix;
-
-
- invert(): Matrix;
-
-
- transformPoint(x: number, y: number, result: {
- x: number;
- y: number;
- }, delta?: boolean): void;
-
- transformRectangle(rectangle: {
- x: number;
- y: number;
- width: number;
- height: number;
- }, delta?: boolean): void;
- }
- }
- declare namespace dragonBones {
-
-
- class Transform {
-
- static readonly PI: number;
-
- static readonly PI_D: number;
-
- static readonly PI_H: number;
-
- static readonly PI_Q: number;
-
- static readonly RAD_DEG: number;
-
- static readonly DEG_RAD: number;
-
- static normalizeRadian(value: number): number;
-
-
- x: number;
-
-
- y: number;
-
-
- skew: number;
-
-
- rotation: number;
-
-
- scaleX: number;
-
-
- scaleY: number;
-
- constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number);
- toString(): string;
-
- copyFrom(value: Transform): Transform;
-
- identity(): Transform;
-
- add(value: Transform): Transform;
-
- minus(value: Transform): Transform;
-
- fromMatrix(matrix: Matrix): Transform;
-
- toMatrix(matrix: Matrix): Transform;
- }
- }
- declare namespace dragonBones {
-
- class ColorTransform {
- alphaMultiplier: number;
- redMultiplier: number;
- greenMultiplier: number;
- blueMultiplier: number;
- alphaOffset: number;
- redOffset: number;
- greenOffset: number;
- blueOffset: number;
- constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number);
- copyFrom(value: ColorTransform): void;
- identity(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class Point {
-
-
- x: number;
-
-
- y: number;
-
-
- constructor(x?: number, y?: number);
-
- copyFrom(value: Point): void;
-
- clear(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class Rectangle {
-
-
- x: number;
-
-
- y: number;
-
-
- width: number;
-
-
- height: number;
-
- constructor(x?: number, y?: number, width?: number, height?: number);
-
- copyFrom(value: Rectangle): void;
-
- clear(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class UserData extends BaseObject {
- static toString(): string;
-
-
- readonly ints: Array<number>;
-
-
- readonly floats: Array<number>;
-
-
- readonly strings: Array<string>;
-
- protected _onClear(): void;
-
- addInt(value: number): void;
-
- addFloat(value: number): void;
-
- addString(value: string): void;
-
-
- getInt(index?: number): number;
-
-
- getFloat(index?: number): number;
-
-
- getString(index?: number): string;
- }
-
- class ActionData extends BaseObject {
- static toString(): string;
- type: ActionType;
- name: string;
- bone: BoneData | null;
- slot: SlotData | null;
- data: UserData | null;
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class DragonBonesData extends BaseObject {
- static toString(): string;
-
- autoSearch: boolean;
-
-
- frameRate: number;
-
-
- version: string;
-
-
- name: string;
-
- stage: ArmatureData | null;
-
- readonly frameIndices: Array<number>;
-
- readonly cachedFrames: Array<number>;
-
-
- readonly armatureNames: Array<string>;
-
- readonly armatures: Map<ArmatureData>;
-
- binary: ArrayBuffer;
-
- intArray: Int16Array;
-
- floatArray: Float32Array;
-
- frameIntArray: Int16Array;
-
- frameFloatArray: Float32Array;
-
- frameArray: Int16Array;
-
- timelineArray: Uint16Array;
-
- userData: UserData | null;
-
- protected _onClear(): void;
-
- addArmature(value: ArmatureData): void;
-
-
- getArmature(name: string): ArmatureData | null;
-
-
- dispose(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class ArmatureData extends BaseObject {
- static toString(): string;
-
- type: ArmatureType;
-
-
- frameRate: number;
-
- cacheFrameRate: number;
-
- scale: number;
-
-
- name: string;
-
- readonly aabb: Rectangle;
-
-
- readonly animationNames: Array<string>;
-
- readonly sortedBones: Array<BoneData>;
-
- readonly sortedSlots: Array<SlotData>;
-
- readonly defaultActions: Array<ActionData>;
-
- readonly actions: Array<ActionData>;
-
- readonly bones: Map<BoneData>;
-
- readonly slots: Map<SlotData>;
-
- readonly constraints: Map<ConstraintData>;
-
- readonly skins: Map<SkinData>;
-
- readonly animations: Map<AnimationData>;
-
-
- defaultSkin: SkinData | null;
-
-
- defaultAnimation: AnimationData | null;
-
- canvas: CanvasData | null;
-
- userData: UserData | null;
-
- parent: DragonBonesData;
-
- protected _onClear(): void;
-
- sortBones(): void;
-
- cacheFrames(frameRate: number): void;
-
- setCacheFrame(globalTransformMatrix: Matrix, transform: Transform): number;
-
- getCacheFrame(globalTransformMatrix: Matrix, transform: Transform, arrayOffset: number): void;
-
- addBone(value: BoneData): void;
-
- addSlot(value: SlotData): void;
-
- addConstraint(value: ConstraintData): void;
-
- addSkin(value: SkinData): void;
-
- addAnimation(value: AnimationData): void;
-
- addAction(value: ActionData, isDefault: boolean): void;
-
-
- getBone(name: string): BoneData | null;
-
-
- getSlot(name: string): SlotData | null;
-
- getConstraint(name: string): ConstraintData | null;
-
-
- getSkin(name: string): SkinData | null;
-
- getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null;
-
-
- getAnimation(name: string): AnimationData | null;
- }
-
-
- class BoneData extends BaseObject {
- static toString(): string;
-
- inheritTranslation: boolean;
-
- inheritRotation: boolean;
-
- inheritScale: boolean;
-
- inheritReflection: boolean;
-
- type: BoneType;
-
-
- length: number;
-
-
- name: string;
-
- readonly transform: Transform;
-
- userData: UserData | null;
-
-
- parent: BoneData | null;
-
- protected _onClear(): void;
- }
-
- class SurfaceData extends BoneData {
- static toString(): string;
- segmentX: number;
- segmentY: number;
- readonly vertices: Array<number>;
-
- protected _onClear(): void;
- }
-
-
- class SlotData extends BaseObject {
-
- static readonly DEFAULT_COLOR: ColorTransform;
-
- static createColor(): ColorTransform;
- static toString(): string;
-
- blendMode: BlendMode;
-
- displayIndex: number;
-
- zOrder: number;
-
-
- name: string;
-
- color: ColorTransform;
-
- userData: UserData | null;
-
-
- parent: BoneData;
-
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
- abstract class ConstraintData extends BaseObject {
- order: number;
- name: string;
- target: BoneData;
- root: BoneData;
- bone: BoneData | null;
- protected _onClear(): void;
- }
-
- class IKConstraintData extends ConstraintData {
- static toString(): string;
- scaleEnabled: boolean;
- bendPositive: boolean;
- weight: number;
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
- class CanvasData extends BaseObject {
- static toString(): string;
- hasBackground: boolean;
- color: number;
- x: number;
- y: number;
- width: number;
- height: number;
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class SkinData extends BaseObject {
- static toString(): string;
-
-
- name: string;
-
- readonly displays: Map<Array<DisplayData | null>>;
-
- parent: ArmatureData;
-
- protected _onClear(): void;
-
- addDisplay(slotName: string, value: DisplayData | null): void;
-
- getDisplay(slotName: string, displayName: string): DisplayData | null;
-
- getDisplays(slotName: string): Array<DisplayData | null> | null;
- }
- }
- declare namespace dragonBones {
-
- abstract class DisplayData extends BaseObject {
- type: DisplayType;
- name: string;
- path: string;
- parent: SkinData;
- readonly transform: Transform;
- protected _onClear(): void;
- }
-
- class ImageDisplayData extends DisplayData {
- static toString(): string;
- readonly pivot: Point;
- texture: TextureData | null;
- protected _onClear(): void;
- }
-
- class ArmatureDisplayData extends DisplayData {
- static toString(): string;
- inheritAnimation: boolean;
- readonly actions: Array<ActionData>;
- armature: ArmatureData | null;
- protected _onClear(): void;
-
- addAction(value: ActionData): void;
- }
-
- class MeshDisplayData extends DisplayData {
- static toString(): string;
- inheritDeform: boolean;
- offset: number;
- weight: WeightData | null;
- glue: GlueData | null;
- texture: TextureData | null;
- protected _onClear(): void;
- }
-
- class BoundingBoxDisplayData extends DisplayData {
- static toString(): string;
- boundingBox: BoundingBoxData | null;
- protected _onClear(): void;
- }
-
- class WeightData extends BaseObject {
- static toString(): string;
- count: number;
- offset: number;
- readonly bones: Array<BoneData>;
- protected _onClear(): void;
- addBone(value: BoneData): void;
- }
-
- class GlueData extends BaseObject {
- static toString(): string;
- readonly weights: Array<number>;
- readonly meshes: Array<MeshDisplayData | null>;
- protected _onClear(): void;
- addMesh(value: MeshDisplayData | null): void;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class BoundingBoxData extends BaseObject {
-
-
- type: BoundingBoxType;
-
- color: number;
-
- width: number;
-
- height: number;
-
- protected _onClear(): void;
-
-
- abstract containsPoint(pX: number, pY: number): boolean;
-
-
- abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: {
- x: number;
- y: number;
- } | null, intersectionPointB: {
- x: number;
- y: number;
- } | null, normalRadians: {
- x: number;
- y: number;
- } | null): number;
- }
-
-
- class RectangleBoundingBoxData extends BoundingBoxData {
- static toString(): string;
-
- private static _computeOutCode(x, y, xMin, yMin, xMax, yMax);
-
- static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
-
- protected _onClear(): void;
-
- containsPoint(pX: number, pY: number): boolean;
-
- intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
- }
-
-
- class EllipseBoundingBoxData extends BoundingBoxData {
- static toString(): string;
-
- static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
-
- protected _onClear(): void;
-
- containsPoint(pX: number, pY: number): boolean;
-
- intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
- }
-
-
- class PolygonBoundingBoxData extends BoundingBoxData {
- static toString(): string;
-
- static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array<number>, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
-
- x: number;
-
- y: number;
-
-
- readonly vertices: Array<number>;
-
- weight: WeightData | null;
-
- protected _onClear(): void;
-
- containsPoint(pX: number, pY: number): boolean;
-
- intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
- }
- }
- declare namespace dragonBones {
-
-
- class AnimationData extends BaseObject {
- static toString(): string;
-
- frameIntOffset: number;
-
- frameFloatOffset: number;
-
- frameOffset: number;
-
-
- frameCount: number;
-
-
- playTimes: number;
-
-
- duration: number;
-
- scale: number;
-
-
- fadeInTime: number;
-
- cacheFrameRate: number;
-
-
- name: string;
-
- readonly cachedFrames: Array<boolean>;
-
- readonly boneTimelines: Map<Array<TimelineData>>;
-
- readonly surfaceTimelines: Map<Array<TimelineData>>;
-
- readonly slotTimelines: Map<Array<TimelineData>>;
-
- readonly constraintTimelines: Map<Array<TimelineData>>;
-
- readonly animationTimelines: Map<Array<TimelineData>>;
-
- readonly boneCachedFrameIndices: Map<Array<number>>;
-
- readonly slotCachedFrameIndices: Map<Array<number>>;
-
- actionTimeline: TimelineData | null;
-
- zOrderTimeline: TimelineData | null;
-
- parent: ArmatureData;
-
- protected _onClear(): void;
-
- cacheFrames(frameRate: number): void;
-
- addBoneTimeline(bone: BoneData, timeline: TimelineData): void;
-
- addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void;
-
- addSlotTimeline(slot: SlotData, timeline: TimelineData): void;
-
- addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void;
-
- addAnimationTimeline(name: string, timeline: TimelineData): void;
-
- getBoneTimelines(name: string): Array<TimelineData> | null;
-
- getSurfaceTimelines(name: string): Array<TimelineData> | null;
-
- getSlotTimelines(name: string): Array<TimelineData> | null;
-
- getConstraintTimelines(name: string): Array<TimelineData> | null;
-
- getAnimationTimelines(name: string): Array<TimelineData> | null;
-
- getBoneCachedFrameIndices(name: string): Array<number> | null;
-
- getSlotCachedFrameIndices(name: string): Array<number> | null;
- }
-
- class TimelineData extends BaseObject {
- static toString(): string;
- type: TimelineType;
- offset: number;
- frameIndicesOffset: number;
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
-
- class AnimationConfig extends BaseObject {
- static toString(): string;
-
- pauseFadeOut: boolean;
-
-
- fadeOutMode: AnimationFadeOutMode;
-
- fadeOutTweenType: TweenType;
-
- fadeOutTime: number;
-
- pauseFadeIn: boolean;
-
- actionEnabled: boolean;
-
- additiveBlending: boolean;
-
-
- displayControl: boolean;
-
-
- resetToPose: boolean;
-
- fadeInTweenType: TweenType;
-
-
- playTimes: number;
-
-
- layer: number;
-
-
- position: number;
-
-
- duration: number;
-
-
- timeScale: number;
-
-
- weight: number;
-
-
- fadeInTime: number;
-
-
- autoFadeOutTime: number;
-
-
- name: string;
-
-
- animation: string;
-
-
- group: string;
-
- readonly boneMask: Array<string>;
-
- protected _onClear(): void;
-
- clear(): void;
-
- copyFrom(value: AnimationConfig): void;
-
- containsBoneMask(name: string): boolean;
-
- addBoneMask(armature: Armature, name: string, recursive?: boolean): void;
-
- removeBoneMask(armature: Armature, name: string, recursive?: boolean): void;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class TextureAtlasData extends BaseObject {
-
- autoSearch: boolean;
-
- width: number;
-
- height: number;
-
- scale: number;
-
-
- name: string;
-
-
- imagePath: string;
-
- readonly textures: Map<TextureData>;
-
- protected _onClear(): void;
-
- copyFrom(value: TextureAtlasData): void;
-
- abstract createTexture(): TextureData;
-
- addTexture(value: TextureData): void;
-
- getTexture(name: string): TextureData | null;
- }
-
- abstract class TextureData extends BaseObject {
- static createRectangle(): Rectangle;
- rotated: boolean;
- name: string;
- readonly region: Rectangle;
- parent: TextureAtlasData;
- frame: Rectangle | null;
- protected _onClear(): void;
- copyFrom(value: TextureData): void;
- }
- }
- declare namespace dragonBones {
-
-
- interface IArmatureProxy extends IEventDispatcher {
-
- dbInit(armature: Armature): void;
-
- dbClear(): void;
-
- dbUpdate(): void;
-
-
- dispose(disposeProxy: boolean): void;
-
-
- readonly armature: Armature;
-
-
- readonly animation: Animation;
- }
- }
- declare namespace dragonBones {
-
-
- class Armature extends BaseObject implements IAnimatable {
- static toString(): string;
- private static _onSortSlots(a, b);
-
-
- inheritAnimation: boolean;
-
- userData: any;
- private _lockUpdate;
- private _bonesDirty;
- private _slotsDirty;
- private _zOrderDirty;
- private _flipX;
- private _flipY;
-
- _cacheFrameIndex: number;
- private readonly _bones;
- private readonly _slots;
-
- readonly _glueSlots: Array<Slot>;
-
- readonly _constraints: Array<Constraint>;
- private readonly _actions;
-
- _armatureData: ArmatureData;
- private _animation;
- private _proxy;
- private _display;
-
- _replaceTextureAtlasData: TextureAtlasData | null;
- private _replacedTexture;
-
- _dragonBones: DragonBones;
- private _clock;
-
- _parent: Slot | null;
-
- protected _onClear(): void;
- private _sortBones();
- private _sortSlots();
-
- _sortZOrder(slotIndices: Array<number> | Int16Array | null, offset: number): void;
-
- _addBoneToBoneList(value: Bone): void;
-
- _removeBoneFromBoneList(value: Bone): void;
-
- _addSlotToSlotList(value: Slot): void;
-
- _removeSlotFromSlotList(value: Slot): void;
-
- _bufferAction(action: ActionData, append: boolean): void;
-
-
- dispose(): void;
-
- init(armatureData: ArmatureData, proxy: IArmatureProxy, display: any, dragonBones: DragonBones): void;
-
- advanceTime(passedTime: number): void;
-
-
- invalidUpdate(boneName?: string | null, updateSlot?: boolean): void;
-
-
- containsPoint(x: number, y: number): Slot | null;
-
-
- intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): Slot | null;
-
-
- getBone(name: string): Bone | null;
-
-
- getBoneByDisplay(display: any): Bone | null;
-
-
- getSlot(name: string): Slot | null;
-
-
- getSlotByDisplay(display: any): Slot | null;
-
- addBone(value: Bone, parentName: string): void;
-
- addSlot(value: Slot, parentName: string): void;
-
- addConstraint(value: Constraint): void;
-
- removeBone(value: Bone): void;
-
- removeSlot(value: Slot): void;
-
-
- getBones(): Array<Bone>;
-
-
- getSlots(): Array<Slot>;
-
-
- flipX: boolean;
-
-
- flipY: boolean;
-
-
- cacheFrameRate: number;
-
-
- readonly name: string;
-
-
- readonly armatureData: ArmatureData;
-
-
- readonly animation: Animation;
-
- readonly proxy: IArmatureProxy;
-
-
- readonly eventDispatcher: IEventDispatcher;
-
-
- readonly display: any;
-
- replacedTexture: any;
-
- clock: WorldClock | null;
-
-
- readonly parent: Slot | null;
-
- replaceTexture(texture: any): void;
-
-
- hasEventListener(type: EventStringType): boolean;
-
-
- addEventListener(type: EventStringType, listener: Function, target: any): void;
-
-
- removeEventListener(type: EventStringType, listener: Function, target: any): void;
-
-
- enableAnimationCache(frameRate: number): void;
-
-
- getDisplay(): any;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class TransformObject extends BaseObject {
-
- protected static readonly _helpMatrix: Matrix;
-
- protected static readonly _helpTransform: Transform;
-
- protected static readonly _helpPoint: Point;
-
-
- readonly globalTransformMatrix: Matrix;
-
-
- readonly global: Transform;
-
-
- readonly offset: Transform;
-
- origin: Transform | null;
-
- userData: any;
-
- protected _globalDirty: boolean;
-
- _armature: Armature;
-
- _parent: Bone;
-
- protected _onClear(): void;
-
- _setArmature(value: Armature | null): void;
-
- _setParent(value: Bone | null): void;
-
-
- updateGlobalTransform(): void;
-
-
- readonly armature: Armature;
-
-
- readonly parent: Bone;
- }
- }
- declare namespace dragonBones {
-
-
- class Bone extends TransformObject {
- static toString(): string;
-
-
- offsetMode: OffsetMode;
-
- readonly animationPose: Transform;
-
- _transformDirty: boolean;
-
- _childrenTransformDirty: boolean;
- protected _localDirty: boolean;
-
- _hasConstraint: boolean;
- private _visible;
- protected _cachedFrameIndex: number;
-
- readonly _blendState: BlendState;
-
- _boneData: BoneData;
-
- _cachedFrameIndices: Array<number> | null;
-
- protected _onClear(): void;
-
- protected _updateGlobalTransformMatrix(isCache: boolean): void;
-
- _setArmature(value: Armature | null): void;
-
- init(boneData: BoneData): void;
-
- update(cacheFrameIndex: number): void;
-
- updateByConstraint(): void;
-
-
- invalidUpdate(): void;
-
-
- contains(value: TransformObject): boolean;
-
-
- readonly boneData: BoneData;
-
-
- visible: boolean;
-
-
- readonly name: string;
-
-
- getBones(): Array<Bone>;
-
-
- getSlots(): Array<Slot>;
-
-
- readonly slot: Slot | null;
- }
- }
- declare namespace dragonBones {
-
- class Surface extends Bone {
- static toString(): string;
- private _dX;
- private _dY;
- private _k;
- private _kX;
- private _kY;
-
- readonly _vertices: Array<number>;
-
- readonly _deformVertices: Array<number>;
-
- private readonly _hullCache;
-
- private readonly _matrixCahce;
-
- protected _onClear(): void;
- private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown);
- private _updateVertices();
-
- protected _updateGlobalTransformMatrix(isCache: boolean): void;
- _getGlobalTransformMatrix(x: number, y: number): Matrix;
- init(surfaceData: SurfaceData): void;
-
- update(cacheFrameIndex: number): void;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class Slot extends TransformObject {
-
-
- displayController: string | null;
-
- protected _displayDirty: boolean;
-
- protected _zOrderDirty: boolean;
-
- protected _visibleDirty: boolean;
-
- protected _blendModeDirty: boolean;
-
- _colorDirty: boolean;
-
- _meshDirty: boolean;
-
- protected _transformDirty: boolean;
-
- protected _visible: boolean;
-
- protected _blendMode: BlendMode;
-
- protected _displayIndex: number;
-
- protected _animationDisplayIndex: number;
-
- _zOrder: number;
-
- protected _cachedFrameIndex: number;
-
- _pivotX: number;
-
- _pivotY: number;
-
- protected readonly _localMatrix: Matrix;
-
- readonly _colorTransform: ColorTransform;
-
- readonly _deformVertices: Array<number>;
-
- readonly _displayDatas: Array<DisplayData | null>;
-
- protected readonly _displayList: Array<any | Armature>;
-
- protected readonly _meshBones: Array<Bone | null>;
-
- protected readonly _meshSlots: Array<Slot | null>;
-
- _slotData: SlotData;
-
- protected _rawDisplayDatas: Array<DisplayData | null> | null;
-
- protected _displayData: DisplayData | null;
-
- protected _textureData: TextureData | null;
-
- _meshData: MeshDisplayData | null;
-
- protected _boundingBoxData: BoundingBoxData | null;
-
- protected _rawDisplay: any;
-
- protected _meshDisplay: any;
-
- protected _display: any;
-
- protected _childArmature: Armature | null;
-
- _cachedFrameIndices: Array<number> | null;
-
- protected _onClear(): void;
-
- protected abstract _initDisplay(value: any, isRetain: boolean): void;
-
- protected abstract _disposeDisplay(value: any, isRelease: boolean): void;
-
- protected abstract _onUpdateDisplay(): void;
-
- protected abstract _addDisplay(): void;
-
- protected abstract _replaceDisplay(value: any): void;
-
- protected abstract _removeDisplay(): void;
-
- protected abstract _updateZOrder(): void;
-
- abstract _updateVisible(): void;
-
- protected abstract _updateBlendMode(): void;
-
- protected abstract _updateColor(): void;
-
- protected abstract _updateFrame(): void;
-
- protected abstract _updateMesh(): void;
-
- abstract _updateGlueMesh(): void;
-
- protected abstract _updateTransform(): void;
-
- protected abstract _identityTransform(): void;
-
- protected _getDefaultRawDisplayData(): DisplayData | null;
-
- protected _updateDisplayData(): void;
-
- protected _updateDisplay(): void;
-
- protected _updateGlobalTransformMatrix(isCache: boolean): void;
-
- protected _isMeshBonesUpdate(): boolean;
-
- _setArmature(value: Armature | null): void;
-
- _setDisplayIndex(value: number, isAnimation?: boolean): boolean;
-
- _setZorder(value: number): boolean;
-
- _setColor(value: ColorTransform): boolean;
-
- _setDisplayList(value: Array<any> | null): boolean;
-
- init(slotData: SlotData, displayDatas: Array<DisplayData | null> | null, rawDisplay: any, meshDisplay: any): void;
-
- update(cacheFrameIndex: number): void;
-
- updateTransformAndMatrix(): void;
-
- replaceDisplayData(value: DisplayData | null, displayIndex?: number): void;
-
-
- containsPoint(x: number, y: number): boolean;
-
-
- intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {
- x: number;
- y: number;
- } | null, intersectionPointB?: {
- x: number;
- y: number;
- } | null, normalRadians?: {
- x: number;
- y: number;
- } | null): number;
-
-
- invalidUpdate(): void;
-
-
- visible: boolean;
-
-
- displayIndex: number;
-
-
- readonly name: string;
-
-
- displayList: Array<any>;
-
-
- readonly slotData: SlotData;
-
- rawDisplayDatas: Array<DisplayData | null> | null;
-
-
- readonly boundingBoxData: BoundingBoxData | null;
-
- readonly rawDisplay: any;
-
- readonly meshDisplay: any;
-
-
- display: any;
-
-
- childArmature: Armature | null;
-
-
- getDisplay(): any;
-
-
- setDisplay(value: any): void;
- }
- }
- declare namespace dragonBones {
-
- abstract class Constraint extends BaseObject {
- protected static readonly _helpMatrix: Matrix;
- protected static readonly _helpTransform: Transform;
- protected static readonly _helpPoint: Point;
-
- _constraintData: ConstraintData;
- protected _armature: Armature;
-
- _target: Bone;
-
- _root: Bone;
- protected _bone: Bone | null;
- protected _onClear(): void;
- abstract init(constraintData: ConstraintData, armature: Armature): void;
- abstract update(): void;
- abstract invalidUpdate(): void;
- readonly name: string;
- }
-
- class IKConstraint extends Constraint {
- static toString(): string;
- private _scaleEnabled;
-
- _bendPositive: boolean;
-
- _weight: number;
- protected _onClear(): void;
- private _computeA();
- private _computeB();
- init(constraintData: ConstraintData, armature: Armature): void;
- update(): void;
- invalidUpdate(): void;
- }
- }
- declare namespace dragonBones {
-
-
- interface IAnimatable {
-
-
- advanceTime(passedTime: number): void;
-
-
- clock: WorldClock | null;
- }
- }
- declare namespace dragonBones {
-
-
- class WorldClock implements IAnimatable {
-
-
- time: number;
-
-
- timeScale: number;
- private readonly _animatebles;
- private _clock;
-
-
- constructor(time?: number);
-
-
- advanceTime(passedTime: number): void;
-
-
- contains(value: IAnimatable): boolean;
-
-
- add(value: IAnimatable): void;
-
-
- remove(value: IAnimatable): void;
-
-
- clear(): void;
-
- clock: WorldClock | null;
-
-
- static readonly clock: WorldClock;
- }
- }
- declare namespace dragonBones {
-
-
- class Animation extends BaseObject {
- static toString(): string;
-
-
- timeScale: number;
- private _lockUpdate;
- private _animationDirty;
- private _inheritTimeScale;
- private readonly _animationNames;
- private readonly _animationStates;
- private readonly _animations;
- private _armature;
- private _animationConfig;
- private _lastAnimationState;
-
- protected _onClear(): void;
- private _fadeOut(animationConfig);
-
- init(armature: Armature): void;
-
- advanceTime(passedTime: number): void;
-
-
- reset(): void;
-
-
- stop(animationName?: string | null): void;
-
-
- playConfig(animationConfig: AnimationConfig): AnimationState | null;
-
-
- play(animationName?: string | null, playTimes?: number): AnimationState | null;
-
-
- fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null;
-
-
- gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null;
-
-
- gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null;
-
-
- gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null;
-
-
- gotoAndStopByTime(animationName: string, time?: number): AnimationState | null;
-
-
- gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null;
-
-
- gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null;
-
-
- getState(animationName: string): AnimationState | null;
-
-
- hasAnimation(animationName: string): boolean;
-
-
- getStates(): Array<AnimationState>;
-
-
- readonly isPlaying: boolean;
-
-
- readonly isCompleted: boolean;
-
-
- readonly lastAnimationName: string;
-
-
- readonly animationNames: Array<string>;
-
-
- animations: Map<AnimationData>;
-
-
- readonly animationConfig: AnimationConfig;
-
-
- readonly lastAnimationState: AnimationState | null;
-
-
- gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;
-
-
- gotoAndStop(animationName: string, time?: number): AnimationState | null;
-
-
- readonly animationList: Array<string>;
-
-
- readonly animationDataList: Array<AnimationData>;
- }
- }
- declare namespace dragonBones {
-
-
- class AnimationState extends BaseObject {
- static toString(): string;
-
- actionEnabled: boolean;
-
- additiveBlending: boolean;
-
-
- displayControl: boolean;
-
-
- resetToPose: boolean;
-
-
- playTimes: number;
-
-
- layer: number;
-
-
- timeScale: number;
-
-
- weight: number;
-
-
- autoFadeOutTime: number;
-
- fadeTotalTime: number;
-
-
- name: string;
-
-
- group: string;
- private _timelineDirty;
-
- _playheadState: number;
-
- _fadeState: number;
-
- _subFadeState: number;
-
- _position: number;
-
- _duration: number;
- private _fadeTime;
- private _time;
-
- _fadeProgress: number;
-
- _weightResult: number;
-
- readonly _blendState: BlendState;
- private readonly _boneMask;
- private readonly _boneTimelines;
- private readonly _surfaceTimelines;
- private readonly _slotTimelines;
- private readonly _constraintTimelines;
- private readonly _animationTimelines;
- private readonly _poseTimelines;
- private readonly _bonePoses;
-
- _animationData: AnimationData;
- private _armature;
-
- _actionTimeline: ActionTimelineState;
- private _zOrderTimeline;
-
- _parent: AnimationState;
-
- protected _onClear(): void;
- private _updateTimelines();
- private _updateBoneAndSlotTimelines();
- private _advanceFadeTime(passedTime);
-
- init(armature: Armature, animationData: AnimationData, animationConfig: AnimationConfig): void;
-
- advanceTime(passedTime: number, cacheFrameRate: number): void;
-
-
- play(): void;
-
-
- stop(): void;
-
-
- fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void;
-
-
- containsBoneMask(name: string): boolean;
-
-
- addBoneMask(name: string, recursive?: boolean): void;
-
-
- removeBoneMask(name: string, recursive?: boolean): void;
-
-
- removeAllBoneMask(): void;
-
-
- readonly isFadeIn: boolean;
-
-
- readonly isFadeOut: boolean;
-
-
- readonly isFadeComplete: boolean;
-
-
- readonly isPlaying: boolean;
-
-
- readonly isCompleted: boolean;
-
-
- readonly currentPlayTimes: number;
-
-
- readonly totalTime: number;
-
-
- currentTime: number;
-
-
- readonly animationData: AnimationData;
- }
-
- class BonePose extends BaseObject {
- static toString(): string;
- readonly current: Transform;
- readonly delta: Transform;
- readonly result: Transform;
- protected _onClear(): void;
- }
-
- class BlendState {
- dirty: boolean;
- layer: number;
- leftWeight: number;
- layerWeight: number;
- blendWeight: number;
- update(weight: number, layer: number): number;
- clear(): void;
- }
- }
- declare namespace dragonBones {
-
- const enum TweenState {
- None = 0,
- Once = 1,
- Always = 2,
- }
-
- abstract class TimelineState extends BaseObject {
- playState: number;
- currentPlayTimes: number;
- currentTime: number;
- protected _tweenState: TweenState;
- protected _frameRate: number;
- protected _frameValueOffset: number;
- protected _frameCount: number;
- protected _frameOffset: number;
- protected _frameIndex: number;
- protected _frameRateR: number;
- protected _position: number;
- protected _duration: number;
- protected _timeScale: number;
- protected _timeOffset: number;
- protected _dragonBonesData: DragonBonesData;
- protected _animationData: AnimationData;
- protected _timelineData: TimelineData | null;
- protected _armature: Armature;
- protected _animationState: AnimationState;
- protected _actionTimeline: TimelineState;
- protected _frameArray: Array<number> | Int16Array;
- protected _frameIntArray: Array<number> | Int16Array;
- protected _frameFloatArray: Array<number> | Int16Array;
- protected _timelineArray: Array<number> | Uint16Array;
- protected _frameIndices: Array<number>;
- protected _onClear(): void;
- protected abstract _onArriveAtFrame(): void;
- protected abstract _onUpdateFrame(): void;
- protected _setCurrentTime(passedTime: number): boolean;
- init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
- fadeOut(): void;
- update(passedTime: number): void;
- }
-
- abstract class TweenTimelineState extends TimelineState {
- private static _getEasingValue(tweenType, progress, easing);
- private static _getEasingCurveValue(progress, samples, count, offset);
- protected _tweenType: TweenType;
- protected _curveCount: number;
- protected _framePosition: number;
- protected _frameDurationR: number;
- protected _tweenProgress: number;
- protected _tweenEasing: number;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- }
-
- abstract class BoneTimelineState extends TweenTimelineState {
- bone: Bone;
- bonePose: BonePose;
- protected _onClear(): void;
- blend(state: number): void;
- }
-
- abstract class SlotTimelineState extends TweenTimelineState {
- slot: Slot;
- protected _onClear(): void;
- }
-
- abstract class ConstraintTimelineState extends TweenTimelineState {
- constraint: Constraint;
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
- class ActionTimelineState extends TimelineState {
- static toString(): string;
- private _onCrossFrame(frameIndex);
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- update(passedTime: number): void;
- setCurrentTime(value: number): void;
- }
-
- class ZOrderTimelineState extends TimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- }
-
- class BoneAllTimelineState extends BoneTimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- fadeOut(): void;
- }
-
- class BoneTranslateTimelineState extends BoneTimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- }
-
- class BoneRotateTimelineState extends BoneTimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- fadeOut(): void;
- }
-
- class BoneScaleTimelineState extends BoneTimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- }
-
- class SurfaceTimelineState extends TweenTimelineState {
- static toString(): string;
- surface: Surface;
- private _frameFloatOffset;
- private _valueCount;
- private _deformCount;
- private _valueOffset;
- private readonly _current;
- private readonly _delta;
- private readonly _result;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
- blend(state: number): void;
- }
-
- class SlotDislayTimelineState extends SlotTimelineState {
- static toString(): string;
- protected _onArriveAtFrame(): void;
- }
-
- class SlotColorTimelineState extends SlotTimelineState {
- static toString(): string;
- private _dirty;
- private readonly _current;
- private readonly _delta;
- private readonly _result;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- fadeOut(): void;
- update(passedTime: number): void;
- }
-
- class SlotFFDTimelineState extends SlotTimelineState {
- static toString(): string;
- meshOffset: number;
- private _dirty;
- private _frameFloatOffset;
- private _valueCount;
- private _deformCount;
- private _valueOffset;
- private readonly _current;
- private readonly _delta;
- private readonly _result;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;
- fadeOut(): void;
- update(passedTime: number): void;
- }
-
- class IKConstraintTimelineState extends ConstraintTimelineState {
- static toString(): string;
- private _current;
- private _delta;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- }
-
- class AnimationTimelineState extends TweenTimelineState {
- static toString(): string;
- animationState: AnimationState;
- private readonly _floats;
- protected _onClear(): void;
- protected _onArriveAtFrame(): void;
- protected _onUpdateFrame(): void;
- blend(state: number): void;
- }
- }
- declare namespace dragonBones {
-
-
- class EventObject extends BaseObject {
-
-
- static readonly START: string;
-
-
- static readonly LOOP_COMPLETE: string;
-
-
- static readonly COMPLETE: string;
-
-
- static readonly FADE_IN: string;
-
-
- static readonly FADE_IN_COMPLETE: string;
-
-
- static readonly FADE_OUT: string;
-
-
- static readonly FADE_OUT_COMPLETE: string;
-
-
- static readonly FRAME_EVENT: string;
-
-
- static readonly SOUND_EVENT: string;
- static toString(): string;
-
-
- time: number;
-
-
- type: EventStringType;
-
-
- name: string;
-
-
- armature: Armature;
-
-
- bone: Bone | null;
-
-
- slot: Slot | null;
-
-
- animationState: AnimationState;
-
-
- data: UserData | null;
-
- protected _onClear(): void;
- }
- }
- declare namespace dragonBones {
-
- type EventStringType = string | "start" | "loopComplete" | "complete" | "fadeIn" | "fadeInComplete" | "fadeOut" | "fadeOutComplete" | "frameEvent" | "soundEvent";
-
-
- interface IEventDispatcher {
-
-
- hasDBEventListener(type: EventStringType): boolean;
-
-
- dispatchDBEvent(type: EventStringType, eventObject: EventObject): void;
-
-
- addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-
-
- removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;
-
-
- hasEvent(type: EventStringType): boolean;
-
-
- addEvent(type: EventStringType, listener: Function, thisObject: any): void;
-
-
- removeEvent(type: EventStringType, listener: Function, thisObject: any): void;
- }
- }
- declare namespace dragonBones {
-
- abstract class DataParser {
- protected static readonly DATA_VERSION_2_3: string;
- protected static readonly DATA_VERSION_3_0: string;
- protected static readonly DATA_VERSION_4_0: string;
- protected static readonly DATA_VERSION_4_5: string;
- protected static readonly DATA_VERSION_5_0: string;
- protected static readonly DATA_VERSION_5_5: string;
- protected static readonly DATA_VERSION: string;
- protected static readonly DATA_VERSIONS: Array<string>;
- protected static readonly TEXTURE_ATLAS: string;
- protected static readonly SUB_TEXTURE: string;
- protected static readonly FORMAT: string;
- protected static readonly IMAGE_PATH: string;
- protected static readonly WIDTH: string;
- protected static readonly HEIGHT: string;
- protected static readonly ROTATED: string;
- protected static readonly FRAME_X: string;
- protected static readonly FRAME_Y: string;
- protected static readonly FRAME_WIDTH: string;
- protected static readonly FRAME_HEIGHT: string;
- protected static readonly DRADON_BONES: string;
- protected static readonly USER_DATA: string;
- protected static readonly ARMATURE: string;
- protected static readonly BONE: string;
- protected static readonly SURFACE: string;
- protected static readonly SLOT: string;
- protected static readonly CONSTRAINT: string;
- protected static readonly IK: string;
- protected static readonly SKIN: string;
- protected static readonly DISPLAY: string;
- protected static readonly ANIMATION: string;
- protected static readonly Z_ORDER: string;
- protected static readonly FFD: string;
- protected static readonly FRAME: string;
- protected static readonly TRANSLATE_FRAME: string;
- protected static readonly ROTATE_FRAME: string;
- protected static readonly SCALE_FRAME: string;
- protected static readonly DISPLAY_FRAME: string;
- protected static readonly COLOR_FRAME: string;
- protected static readonly DEFAULT_ACTIONS: string;
- protected static readonly ACTIONS: string;
- protected static readonly EVENTS: string;
- protected static readonly INTS: string;
- protected static readonly FLOATS: string;
- protected static readonly STRINGS: string;
- protected static readonly CANVAS: string;
- protected static readonly TRANSFORM: string;
- protected static readonly PIVOT: string;
- protected static readonly AABB: string;
- protected static readonly COLOR: string;
- protected static readonly VERSION: string;
- protected static readonly COMPATIBLE_VERSION: string;
- protected static readonly FRAME_RATE: string;
- protected static readonly TYPE: string;
- protected static readonly SUB_TYPE: string;
- protected static readonly NAME: string;
- protected static readonly PARENT: string;
- protected static readonly TARGET: string;
- protected static readonly STAGE: string;
- protected static readonly SHARE: string;
- protected static readonly PATH: string;
- protected static readonly LENGTH: string;
- protected static readonly DISPLAY_INDEX: string;
- protected static readonly BLEND_MODE: string;
- protected static readonly INHERIT_TRANSLATION: string;
- protected static readonly INHERIT_ROTATION: string;
- protected static readonly INHERIT_SCALE: string;
- protected static readonly INHERIT_REFLECTION: string;
- protected static readonly INHERIT_ANIMATION: string;
- protected static readonly INHERIT_DEFORM: string;
- protected static readonly SEGMENT_X: string;
- protected static readonly SEGMENT_Y: string;
- protected static readonly BEND_POSITIVE: string;
- protected static readonly CHAIN: string;
- protected static readonly WEIGHT: string;
- protected static readonly FADE_IN_TIME: string;
- protected static readonly PLAY_TIMES: string;
- protected static readonly SCALE: string;
- protected static readonly OFFSET: string;
- protected static readonly POSITION: string;
- protected static readonly DURATION: string;
- protected static readonly TWEEN_EASING: string;
- protected static readonly TWEEN_ROTATE: string;
- protected static readonly TWEEN_SCALE: string;
- protected static readonly CLOCK_WISE: string;
- protected static readonly CURVE: string;
- protected static readonly SOUND: string;
- protected static readonly EVENT: string;
- protected static readonly ACTION: string;
- protected static readonly X: string;
- protected static readonly Y: string;
- protected static readonly SKEW_X: string;
- protected static readonly SKEW_Y: string;
- protected static readonly SCALE_X: string;
- protected static readonly SCALE_Y: string;
- protected static readonly VALUE: string;
- protected static readonly ROTATE: string;
- protected static readonly SKEW: string;
- protected static readonly ALPHA_OFFSET: string;
- protected static readonly RED_OFFSET: string;
- protected static readonly GREEN_OFFSET: string;
- protected static readonly BLUE_OFFSET: string;
- protected static readonly ALPHA_MULTIPLIER: string;
- protected static readonly RED_MULTIPLIER: string;
- protected static readonly GREEN_MULTIPLIER: string;
- protected static readonly BLUE_MULTIPLIER: string;
- protected static readonly UVS: string;
- protected static readonly VERTICES: string;
- protected static readonly TRIANGLES: string;
- protected static readonly WEIGHTS: string;
- protected static readonly SLOT_POSE: string;
- protected static readonly BONE_POSE: string;
- protected static readonly GLUE_WEIGHTS: string;
- protected static readonly GLUE_MESHES: string;
- protected static readonly GOTO_AND_PLAY: string;
- protected static readonly DEFAULT_NAME: string;
- protected static _getArmatureType(value: string): ArmatureType;
- protected static _getBoneType(value: string): BoneType;
- protected static _getDisplayType(value: string): DisplayType;
- protected static _getBoundingBoxType(value: string): BoundingBoxType;
- protected static _getActionType(value: string): ActionType;
- protected static _getBlendMode(value: string): BlendMode;
- abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;
- abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;
-
-
- static parseDragonBonesData(rawData: any): DragonBonesData | null;
-
-
- static parseTextureAtlasData(rawData: any, scale?: number): any;
- }
- }
- declare namespace dragonBones {
-
- class ObjectDataParser extends DataParser {
- protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;
- protected static _getNumber(rawData: any, key: string, defaultValue: number): number;
- protected static _getString(rawData: any, key: string, defaultValue: string): string;
- protected _rawTextureAtlasIndex: number;
- protected readonly _rawBones: Array<BoneData>;
- protected _data: DragonBonesData;
- protected _armature: ArmatureData;
- protected _bone: BoneData;
- protected _surface: SurfaceData;
- protected _slot: SlotData;
- protected _skin: SkinData;
- protected _mesh: MeshDisplayData;
- protected _animation: AnimationData;
- protected _timeline: TimelineData;
- protected _rawTextureAtlases: Array<any> | null;
- private _defaultColorOffset;
- private _prevClockwise;
- private _prevRotation;
- private readonly _helpMatrixA;
- private readonly _helpMatrixB;
- private readonly _helpTransform;
- private readonly _helpColorTransform;
- private readonly _helpPoint;
- private readonly _helpArray;
- private readonly _intArray;
- private readonly _floatArray;
- private readonly _frameIntArray;
- private readonly _frameFloatArray;
- private readonly _frameArray;
- private readonly _timelineArray;
- private readonly _cacheRawMeshes;
- private readonly _cacheMeshes;
- private readonly _actionFrames;
- private readonly _weightSlotPose;
- private readonly _weightBonePoses;
- private readonly _cacheBones;
- private readonly _slotChildActions;
- private _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, t, result);
- private _samplingEasingCurve(curve, samples);
- private _parseActionDataInFrame(rawData, frameStart, bone, slot);
- private _mergeActionFrame(rawData, frameStart, type, bone, slot);
- protected _parseArmature(rawData: any, scale: number): ArmatureData;
- protected _parseBone(rawData: any): BoneData;
- protected _parseIKConstraint(rawData: any): ConstraintData | null;
- protected _parseSlot(rawData: any, zOrder: number): SlotData;
- protected _parseSkin(rawData: any): SkinData;
- protected _parseDisplay(rawData: any): DisplayData | null;
- protected _parsePivot(rawData: any, display: ImageDisplayData): void;
- protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
- protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;
- protected _parseBoundingBox(rawData: any): BoundingBoxData | null;
- protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;
- protected _parseAnimation(rawData: any): AnimationData;
- protected _parseTimeline(rawData: any, rawFrames: Array<any> | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;
- protected _parseBoneTimeline(rawData: any): void;
- protected _parseSlotTimeline(rawData: any): void;
- protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;
- protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;
- protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array<ActionData>;
- protected _parseTransform(rawData: any, transform: Transform, scale: number): void;
- protected _parseColorTransform(rawData: any, color: ColorTransform): void;
- protected _parseArray(rawData: any): void;
- protected _modifyArray(): void;
- parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
- parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean;
- private static _objectDataParserInstance;
-
-
- static getInstance(): ObjectDataParser;
- }
-
- class ActionFrame {
- frameStart: number;
- readonly actions: Array<number>;
- }
- }
- declare namespace dragonBones {
-
- class BinaryDataParser extends ObjectDataParser {
- private _binaryOffset;
- private _binary;
- private _intArrayBuffer;
- private _floatArrayBuffer;
- private _frameIntArrayBuffer;
- private _frameFloatArrayBuffer;
- private _frameArrayBuffer;
- private _timelineArrayBuffer;
- private _inRange(a, min, max);
- private _decodeUTF8(data);
- private _getUTF16Key(value);
- private _parseBinaryTimeline(type, offset, timelineData?);
- protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;
- protected _parseAnimation(rawData: any): AnimationData;
- protected _parseArray(rawData: any): void;
- parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;
- private static _binaryDataParserInstance;
-
-
- static getInstance(): BinaryDataParser;
- }
- }
- declare namespace dragonBones {
-
-
- abstract class BaseFactory {
-
- protected static _objectParser: ObjectDataParser;
-
- protected static _binaryParser: BinaryDataParser;
-
- autoSearch: boolean;
-
- protected readonly _dragonBonesDataMap: Map<DragonBonesData>;
-
- protected readonly _textureAtlasDataMap: Map<Array<TextureAtlasData>>;
-
- protected _dragonBones: DragonBones;
-
- protected _dataParser: DataParser;
-
-
- constructor(dataParser?: DataParser | null);
-
- protected _isSupportMesh(): boolean;
-
- protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null;
-
- protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean;
-
- protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void;
-
- protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;
-
- protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;
-
- protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;
-
- protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;
-
- protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;
-
- protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, displays: Array<DisplayData | null> | null, armature: Armature): Slot;
-
-
- parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null;
-
-
- parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;
-
- updateTextureAtlasData(name: string, textureAtlases: Array<any>): void;
-
-
- getDragonBonesData(name: string): DragonBonesData | null;
-
-
- addDragonBonesData(data: DragonBonesData, name?: string | null): void;
-
-
- removeDragonBonesData(name: string, disposeData?: boolean): void;
-
-
- getTextureAtlasData(name: string): Array<TextureAtlasData> | null;
-
-
- addTextureAtlasData(data: TextureAtlasData, name?: string | null): void;
-
-
- removeTextureAtlasData(name: string, disposeData?: boolean): void;
-
-
- getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null;
-
-
- clear(disposeData?: boolean): void;
-
-
- buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null;
-
- replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;
-
-
- replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean;
-
- replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean;
-
-
- replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array<string> | null): boolean;
-
-
- replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean;
-
- getAllDragonBonesData(): Map<DragonBonesData>;
-
- getAllTextureAtlasData(): Map<Array<TextureAtlasData>>;
-
-
- readonly clock: WorldClock;
-
- readonly dragonBones: DragonBones;
-
-
- changeSkin(armature: Armature, skin: SkinData, exclude?: Array<string> | null): boolean;
-
-
- copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;
- }
-
- class BuildArmaturePackage {
- dataName: string;
- textureAtlasName: string;
- data: DragonBonesData;
- armature: ArmatureData;
- skin: SkinData | null;
- }
- }
- declare let jsb: any;
- declare const CC_EDITOR: boolean;
- declare const CC_PREVIEW: boolean;
- declare const CC_DEV: boolean;
- declare const CC_DEBUG: boolean;
- declare const CC_BUILD: boolean;
- declare const CC_JSB: boolean;
- declare const CC_TEST: boolean;
- declare const CC_WECHATGAME: boolean;
|