Cocos2d 项目的初始化过程

2013-5-12 雨辰 Cocos2D

Cocos2d项目的初始化过程,见下图:

读者可以结合断点调试来理解这个序列图。

刨去这个过程的一些细节,我们需要掌握这里面的一个主线,这个主线也是我们理解并运用Cocos2d-x的基础:

这一主线包括:

1.Application级别初始化。通过AppDelegate到CCApplication到CCApplicationProtocol。

2.openGL级别初始化。通过CCEGLView。

3.Director级别初始化。通过CCDirector,以CCEGLView对象为参数,CCDirector是一个核心控制类,他主导整个View。

4.Scene级别初始化。通过CCDirector来运行整个场景,以及进行场景切换。

Scene级别以上的三个都是单例,而Scene则可以有很多个,事实上Cocos2d游戏的实现逻辑即在于不同Scene间的切换。

标签: Cocos2d

评论:

ihatemmos
2021-06-04 19:24
<a href="https://www.dalezeskind.com/spigen-tough-armor-designed-for-apple-iphone-xr-hoesje-hoesjea">spigen tough armor designed for apple iphone xr hoesje</a> <a href="https://www.cetdomain.com/nfl-nike-new-york-giants-27-darian-thompson-royal-blue-name-number-logo-t-shirt-jerseyc">nfl nike new york giants 27 darian thompson royal blue name number logo t shirt</a> <a href="https://www.ibmwsc.com/other-stories-bum-torba-torebkid">other stories bum torba</a> <a href="https://www.winzuk.com/huawei-mediapad-m5-case-casec">huawei mediapad m5 case</a> <a href="https://www.physalisfruit.com/brahmin-woven-handtas-tassenb">brahmin woven handtas</a> <a href="https://www.pangsuankaew.com/samsung-s9-plus-led-kryt-pouzdro-pouzdroe">samsung s9 plus led kryt pouzdro</a>
ihatemmos https://www.ihatemmos.com/
dhactun
2021-06-01 00:14
<a href="http://www.sugiftofhope.com/puff-sleeve-midi-ruha-ruhakb">puff sleeve midi ruha</a> <a href="http://www.tillagesunn.com/cincinnati-reds-new-era-mlb-memorial-day-9twenty-casquette-chapeauc">cincinnati reds new era mlb memorial day 9twenty casquette</a> <a href="http://www.huionmexico.com/zte-max-xl-phone-sag-walmart-saga">zte max xl phone sag walmart</a> <a href="http://www.filmbutcher.com/czarny-suede-wedge-ankle-buty-tenisc">czarny suede wedge ankle buty</a> <a href="http://www.toisondeoro.com/hvit-embroidered-midi-kjole-kjoleb">hvit embroidered midi kjole</a> <a href="http://www.predaktor.com/adidas-stella-tasche-tasched">adidas stella tasche</a>
dhactun http://www.dhactun.com/
cheshmeh
2021-05-21 03:26
<a href="http://www.raphaelcruz.net/shimano-spd-bike-shoes-bootsa">shimano spd bike shoes</a> <a href="http://www.gebruikers.net/gabor-rollingsoft-neue-kollektion-stiefeld">gabor rollingsoft neue kollektion</a> <a href="http://www.kalamatagreek.net/supreme-apple-airpods-hoesje-hoesjea">supreme apple airpods hoesje</a> <a href="http://www.fathiotmani.net/denver-broncos-phillip-lindsay-womens-limited-orange-nike-jersey-30-nfl-therma-long-sleeve-jerseyc">denver broncos phillip lindsay womens limited orange nike jersey 30 nfl therma long sleeve</a> <a href="http://www.tourmino.net/tectonic-2-large-plecak-torebkid">tectonic 2 large plecak</a> <a href="http://www.bukovina.net/honor-7s-phone-case-casec">honor 7s phone case</a>
cheshmeh http://www.cheshmeh.net/
hwacompendium
2021-04-29 08:19
<a href="http://www.smippen.com/burkley-s9-sag-saga">burkley s9 sag</a> <a href="http://www.vaddar.com/buty-ccc-sanda%C5%82y-tenisc">buty ccc sanda艂y</a> <a href="http://www.luzudu.com/gull-l%C3%A6r-kjole-kjoleb">gull l忙r kjole</a> <a href="http://www.guiacinefila.com/rosa-gummy-money-rucksack-tasched">rosa gummy money rucksack</a> <a href="http://www.bursain.com/tuta-adidas-stretta-tutab">tuta adidas stretta</a> <a href="http://www.analizkolik.com/nike-air-force-1-ultra-flyknit-faible-rose-chaussures1">nike air force 1 ultra flyknit faible rose</a>
[url=http://www.hwacompendium.com/]hwacompendium[/url]
johnaustince
2021-04-28 15:13
<a href="http://us.pixcorpdesign.com/industrial-scientific-display-cases-amb">industrial scientific display cases</a> <a href="http://us.cpbocai.com/girls-hats-caps-4-amc">girls hats caps 4</a> <a href="http://us.tatilblogu.com/mens-athletic-sport-sandals-slides-1-amc">mens athletic sport sandals slides 1</a> <a href="http://us.realtorjane.com/mens-sleep-tops-amc">mens sleep tops</a> <a href="http://us.drivectl.com/mens-snow-boots-2-ama">mens snow boots 2</a> <a href="http://us.nubroduction.com/tools-home-improvement-soldering-torches-amb">tools home improvement soldering torches</a>
johnaustince http://us.johnaustince.com/

发表评论:

淘气男孩 朱文华 joyimp|@2011-2021 京ICP备16030765号-2