2013年9月13日 星期五

load swf as BitmapMovieClip

BitmapMCManager: getBitmapMC -> new a BitmapMovieClip with Vector.<BitmapFrameInfo> as null then ResManager loadRes -> 將swf用urlLoader將所得data以byteArray形式 load出來,byteArray完成後呼叫該resource(byteArray)的complete callback,也就是BitmapMCManager.loadComplete: 將load出來的swf進行cacheAsBitmapMC且updateBitmapMovieClip將res url對應到load出來的BitmapMovieClip。cacheAsBitmapMC(將load好的resource當成MovieClip後將此MovieClip轉成BitmapMovieClip): call BitmapCacher.cacheBitmapMovie

2013年8月26日 星期一

Background map loading

In BackGroundRender.as
also check BackGroundManager

Radar map

set the mini map sprite, it is the same sprite that is used in MapPanel
In SceneUIView.as : case SceneUI.SET_MINI_MAP:
scenePanel.setSmallMap(params["map"]); :called in SceneUI.as. setMinimap -> add mini map Sprite in ScenePanel.as.setSmallMap (search "curMap");

MiniMap.as: Sprite

Why mini map doesn't exceed to radar? see mainUISkin.fla -> SmallMap(ASLinkage name) -> layer 5 (mask layer)

panel basic logic

use UiAppDomainMemory.getAppDomain to load swf(material)

monsters' and other players' positions display

In MapInfoFightObject.setWorldPosition(x, y) : unit is pixel

setWorldPosition: the data listeners are in "MapInfoMonsterView.as" and "WorldUserView.as" to set the View object position


MapInfoFightObject.scheduleMove: retrieve next move in m_movePtList (FightObj's move list) and move to that position<br> FightObj includes monsters and other players

scheduleUserMove:由mainTimer執行更新所有FightObj的移動

WorldUserSelf.scheduleMove定義玩家本身人物移動(在mainTimer.scheduleUserMove裡update)

2013年8月23日 星期五

map panel (open by top right map button)

swf path: /res/swf/ui/mapPanel.swf
small map icon swf: base.swf
map panel

MiniMap.as: callBackMouseXXX:Function :defined in MapPanel.as (this.minimap.callBackXXX) : defined in MiniMapLogic.as ?? mouse event handling functions, function name: mouseXXX, load icons (NPC, monster...)

MiniMap.as: control what to be drawn on the mini map and the icon positions on the minimap

MiniMapView.as : handle user's action on mini map and call related function to control what to display

load mini map: in (setup in init() in ResManager) ResManager's loaderCompleteHandler -> call (GameResource.callBack) tempRes.callback(tempRes.resourse) -> call (loadRes() in ResManager) loadMapData() in MapInfoManager

WorldScene.process -> call MapInfoManager.loadMapData -> call MapInfoManager.loadMiniMapCompleteCallback "OR" call ResManager.loadRes -> call MapInfoManager.loadMiniMapCompleteCallBack -> call MapInfoManager.loadMiniMapComplete


2013年8月22日 星期四

generate NPC

NPC.as : npc data: name, task...
NPCManager.as: define NPC type (shop, storage...) , get NPC, NPC status..
NPCControl.as: npc control functions (task progress control...)
NPCControlView: Control what to display (control NPCPanel
MapInfoNPCView.as: show NPC on the map, add mouse event listeners (load /res/swf/npc/)