---++!! !MapAppDev __description__: 鎻愪緵2D銆?D鐨勫湴鍥炬湇鍔★細鍖呮嫭鍦扮悆灏哄害鐨勮櫄鎷熷湡鍦扮殑娴忚銆佷拱鍗栥€佷氦鏄撱€佸熀浜嶮ap鐨勫箍鍛娿€佷釜浜哄湴鍥俱€佹悳绱㈢瓑绛 %TOC{title="Contents:"}% %STARTINCLUDE% ---++ Map app for Paraworld | *Title* | Map app for Paraworld | | *Author(s)* | ParaEngine Map Team | | *Date* | 2008/1/24 | | *File* | script/kids/3DMapSystemUI/Map/app_main.lua | ---+++ Description ---++ Get Tile By ID more info, see code doc. <verbatim> Map3DSystem.App.Map.GetTileByID(tileID, callback, param1) </verbatim> INSERT INTO apps VALUES (NULL, 'Map_GUID', 'Map', '1.0.0', 'http://www.paraengine.com/apps/Map_v1.zip', 'YourCompany', 'enUS', 'script/kids/3DMapSystemUI/Map/IP.xml', '', 'script/kids/3DMapSystemUI/Map/app_main.lua', 'Map3DSystem.App.Map.MSGProc', 1); %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/app_main.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Map.OnConnection requires create class commonlib.setfield("Map3DSystem.App.Map", {}); ------------------------------------------- event handlers ------------------------------------------- OnConnection method is the obvious point to place your UI (menus, mainbars, tool buttons) through which the user will communicate to the app. This method is also the place to put your validation code if you are licensing the add-in. You would normally do this before putting up the UI. If the user is not a valid user, you would not want to put the UI into the IDE. * _param_ __app__ : the object representing the current application in the IDE. * _param_ __connectMode__ : type of Map3DSystem.App.ConnectMode. __syntax__ <verbatim>function Map3DSystem.App.Map.OnConnection(app, connectMode)</verbatim> __parameters__ | *app* | the object representing the current application in the IDE. | | *connectMode* | | ---++++ !Map3DSystem.App.Map.OnDisconnection Receives notification that the Add-in is being unloaded. __syntax__ <verbatim>function Map3DSystem.App.Map.OnDisconnection(app, disconnectMode)</verbatim> __parameters__ | *app* | | | *disconnectMode* | | ---++++ !Map3DSystem.App.Map.OnQueryStatus This is called when the command's availability is updated When the user clicks a command (menu or mainbar button), the QueryStatus event is fired. The QueryStatus event returns the current status of the specified named command, whether it is enabled, disabled, or hidden in the CommandStatus parameter, which is passed to the msg by reference (or returned in the event handler). * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". * _param_ __statusWanted__ : what status of the command is queried. it is of type Map3DSystem.App.CommandStatusWanted * _return_ ____ : returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. __syntax__ <verbatim>function Map3DSystem.App.Map.OnQueryStatus(app, commandName, statusWanted)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *statusWanted* | | | *return* | returns according to statusWanted. it may return an integer by adding values in Map3DSystem.App.CommandStatus. | ---++++ !Map3DSystem.App.Map.OnExec This is called when the command is invoked.The Exec is fired after the QueryStatus event is fired, assuming that the return to the statusOption parameter of QueryStatus is supported and enabled. This is the event where you place the actual code for handling the response to the user click on the command. * _param_ __commandName__ : The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". __syntax__ <verbatim>function Map3DSystem.App.Map.OnExec(app, commandName, params)</verbatim> __parameters__ | *app* | | | *commandName* | The name of the command to determine state for. Usually in the string format "Category.SubCate.Name". | | *params* | | ---++++ !Map3DSystem.App.Map.OnRenderBox Change and render the 3D world with mcml data that is usually retrieved from the current user's profile page for this application. __syntax__ <verbatim>function Map3DSystem.App.Map.OnRenderBox(mcmlData)</verbatim> __parameters__ | *mcmlData* | | ---++++ !Map3DSystem.App.Map.Navigate called when the user wants to nagivate to the 3D world location relavent to this application __syntax__ <verbatim>function Map3DSystem.App.Map.Navigate()</verbatim> ---++++ !Map3DSystem.App.Map.GotoHomepage called when user clicks to check out the homepage of this application. Homepage usually includes: developer info, support, developer worlds information, app global news, app updates, all community user rating, active users, trade, currency transfer, etc. __syntax__ <verbatim>function Map3DSystem.App.Map.GotoHomepage()</verbatim> ---++++ !Map3DSystem.App.Map.DoQuickAction called when user clicks the quick action for this application. __syntax__ <verbatim>function Map3DSystem.App.Map.DoQuickAction()</verbatim> ---++++ !Map3DSystem.App.Map.OnActivateDesktop Add terrain, sky and ocean button to the toolbar. __syntax__ <verbatim>function Map3DSystem.App.Map.OnActivateDesktop()</verbatim> ---++++ !Map3DSystem.App.Map.OnDeactivateDesktop __syntax__ <verbatim>function Map3DSystem.App.Map.OnDeactivateDesktop()</verbatim> ---++++ !Map3DSystem.App.Map.MSGProc ------------------------------------------- client world database function helpers. ------------------------------------------- ------------------------------------------ all related messages ------------------------------------------ ----------------------------------------------------- APPS can be invoked in many ways: Through app Manager mainbar or menu command or buttons Command Line 3D World installed apps ----------------------------------------------------- __syntax__ <verbatim>function Map3DSystem.App.Map.MSGProc(window, msg)</verbatim> __parameters__ | *window* | | | *msg* | | ---++++ !Map3DSystem.App.Map.GetTileByID this is wrapper function of paraworld.map.GetTileByID * _param_ __tileID__ : tile id, or its string. * _param_ __callback__ : function of (tileInfo, param1) * _param_ __param1__ : an optional parameter passed to callback. this can be nil. * _return_ ____ : it will return true it is fetching or already fetched. __syntax__ <verbatim>function Map3DSystem.App.Map.GetTileByID(tileID, callback, param1)</verbatim> __parameters__ | *tileID* | tile id, or its string. | | *callback* | | | *param1* | an optional parameter passed to callback. this can be nil. | ---++++ !Map3DSystem.App.Map.GetTileByIDCallBack callback __syntax__ <verbatim>function Map3DSystem.App.Map.GetTileByIDCallBack(msg,args)</verbatim> __parameters__ | *msg* | | | *args* | | ---+++ Member Functions ---++++ !BuyRandomTileCmd.OnGetResult private __syntax__ <verbatim>function BuyRandomTileCmd.OnGetResult(self,tileID,isSuccess,errorCode)</verbatim> __parameters__ | *self* | | | *tileID* | | | *isSuccess* | | | *errorCode* | | ---++++ !BuyRandomTileCmd:OnCmdDone private __syntax__ <verbatim>function BuyRandomTileCmd:OnCmdDone(tileID,isSuccess)</verbatim> __parameters__ | *tileID* | | | *isSuccess* | | ---++ some helper function convert DB data type to run time data type | *Title* | some helper function convert DB data type to run time data type | | *Author(s)* | Clayman | | *Date* | Desc: | | *File* | script/kids/3DMapSystemUI/Map/DataPvdHelper.lua | ---+++ Description %T% __Sample Code__ <verbatim> --NPL.load("(gl)script/kids/3DMapSystemUI/Map/DataPvdHelper.lua"); </verbatim> ---+++ Member Functions ---++++ !helper.ParseTexture texture string format is something like: "*/*/../*.*; */*/../*.*" __syntax__ <verbatim>function helper.ParseTexture(textureString)</verbatim> __parameters__ | *textureString* | | ---++++ !helper.ParseTileInfo convert data base tileInfo type to runtime type __syntax__ <verbatim>function helper.ParseTileInfo(msg)</verbatim> __parameters__ | *msg* | | ---++++ !helper.ConvertModel2RunType convert data base modelInfo to runtime type __syntax__ <verbatim>function helper.ConvertModel2RunType(dbModelData)</verbatim> __parameters__ | *dbModelData* | | ---+++ Member Functions ---++++ !landCell:SetTileInfo private __syntax__ <verbatim>function landCell:SetTileInfo(tileInfo)</verbatim> __parameters__ | *tileInfo* | | ---++++ !landCell:UpdateTerrainPos private,update terrain position __syntax__ <verbatim>function landCell:UpdateTerrainPos()</verbatim> ---++++ !landCell:UpdateModelPos private,update model position __syntax__ <verbatim>function landCell:UpdateModelPos()</verbatim> ---++++ !landCell:UpdateMarkPos private,update mark position __syntax__ <verbatim>function landCell:UpdateMarkPos()</verbatim> ---++++ !landCell:RefreshModels private,create new models __syntax__ <verbatim>function landCell:RefreshModels()</verbatim> ---++++ !landCell:Clear clear all models,marks,reset terrain to default state __syntax__ <verbatim>function landCell:Clear()</verbatim> ---++++ !landCell:ResetTerrain private,reset terrain to default state __syntax__ <verbatim>function landCell:ResetTerrain()</verbatim> ---++++ !landCell:RemoveModels private,clear all building models __syntax__ <verbatim>function landCell:RemoveModels()</verbatim> ---++++ !landCell:RemoveMarks private,clear all marks on this tile __syntax__ <verbatim>function landCell:RemoveMarks(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !landCell.OnReceiveTileInfo data privder GetTileInfo() callback function __syntax__ <verbatim>function landCell.OnReceiveTileInfo(receiver,tileInfo)</verbatim> __parameters__ | *receiver* | | | *tileInfo* | | ---++ land generator | *Title* | land generator | | *Author(s)* | SunLingFeng | | *Date* | 2008/1/25 | | *File* | script/kids/3DMapSystemUI/Map/landGenerator.lua | ---+++ Description ---+++ Member Functions ---++++ !landGen.QueryTileType private __syntax__ <verbatim>function landGen.QueryTileType(norPosX,norPosY)</verbatim> __parameters__ | *norPosX* | | | *norPosY* | | ---++ the map app entry point | *Title* | the map app entry point | | *Author(s)* | SunLingFeng | | *Date* | 2008/1/10 | | *File* | script/kids/3DMapSystemUI/Map/Map3DApp.lua | ---+++ Description ---+++ Member Functions ---++++ !MainWnd:new ========display model enum========= Map3DApp.MainWnd.DisplayMode = {}; Map3DApp.MainWnd.DisplayMode.normal = 0; Map3DApp.MainWnd.DisplayMode.edit = 1; ========public===================== __syntax__ <verbatim>function MainWnd:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MainWnd:CreateUI ============private================ __syntax__ <verbatim>function MainWnd:CreateUI()</verbatim> ---++ SpriteAnimationPlayer | *Title* | SpriteAnimationPlayer | | *Author(s)* | SunLingfeng @ paraengine.com | | *Date* | 2008/1/29 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppAnimationPlayer.lua | ---+++ Description SpriteAnimationPlayer is a sprite sheet player,it receive a paraUIObject as target window, draw animation on it.SpriteAnimationPlayer assume the sprite sheet texture size is power of 2,eg,256*256,512*512. frameSize is the size of each frame in the texture. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppAnimationPlayer.lua"); local cloudPlayer = Map3DApp.SpriteAnimationPlayer:new{ name = self.cloudLayer, targetWndName = self.name, totalFrame = 16, defaultFrame = 1, frameSize = 256, spriteSheet = "model/map3D/texture/clouds.dds", }; cloudLayer:Play(false,false) </verbatim> ---+++ Member Functions ---++++ !SpriteAnimationPlayer:new ===========public================= __syntax__ <verbatim>function SpriteAnimationPlayer:new(o)</verbatim> __parameters__ | *o* | | ---++++ !SpriteAnimationPlayer:Init ================private============== __syntax__ <verbatim>function SpriteAnimationPlayer:Init()</verbatim> ---++ Managing model and texture in map system. | *Title* | Managing model and texture in map system. | | *Author(s)* | SunLingfeng @ paraengine.com | | *Date* | 2007/10/18 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppAssetManager.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppAssetManager.lua"); </verbatim> ---+++ Member Functions ---++++ !Map3DApp.Global.AssetManager.Destroy delete all resources. __syntax__ <verbatim>function Map3DApp.Global.AssetManager.Destroy()</verbatim> ---++++ !Map3DApp.Global.AssetManager.GetModel return managed ParaAssetObject by file name __syntax__ <verbatim>function Map3DApp.Global.AssetManager.GetModel(modelName)</verbatim> __parameters__ | *modelName* | | ---++++ !Map3DApp.Global.AssetManager.GetTexture return managed ParaAssetObject by file name __syntax__ <verbatim>function Map3DApp.Global.AssetManager.GetTexture(textureName)</verbatim> __parameters__ | *textureName* | | ---++++ !Map3DApp.Global.AssetManager.UnloadModel unload a given asset by file name __syntax__ <verbatim>function Map3DApp.Global.AssetManager.UnloadModel(modelName)</verbatim> __parameters__ | *modelName* | | ---++++ !Map3DApp.Global.AssetManager.UnloadTexture unload a given asset by file name __syntax__ <verbatim>function Map3DApp.Global.AssetManager.UnloadTexture(textureName)</verbatim> __parameters__ | *textureName* | | ---++++ !Map3DApp.Global.AssetManager.GetMapTex --- __syntax__ <verbatim>function Map3DApp.Global.AssetManager.GetMapTex(textureName)</verbatim> __parameters__ | *textureName* | | ---++++ !Map3DApp.Global.AssetManager.GetCharacter __syntax__ <verbatim>function Map3DApp.Global.AssetManager.GetCharacter(modelName)</verbatim> __parameters__ | *modelName* | | ---+++ Member Functions ---++++ !MapBBSBar:new <verbatim>-----MapBBSBar local MapBBSBar = { name = "rollingBar"; parent = nil; --layout alignment = "_lt"; left = 5; top = 0; width = 600; height = 24; --msg list,a circle queue maxMsgCount = 30; rollSpeed = 2; --private data billboards = {}; billboardCount = 4; billboardSpace = 15; freeBillboards = nil; activeBillboards = nil; font = nil; fontColorCount = 1; fontHighLight = "130 30 130"; timerID; rollingState = Map3DApp.RollState.stop; lastRollingState = Map3DApp.RollState.stop; selectItem = nil; --event onItemSelect = nil; onMsgPop = nil; onMsgEmpty = nil; }</verbatim> CommonCtrl.MapBBSBar = MapBBSBar; public __syntax__ <verbatim>function MapBBSBar:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MapBBSBar:Destroy public __syntax__ <verbatim>function MapBBSBar:Destroy()</verbatim> ---++++ !MapBBSBar:Show public __syntax__ <verbatim>function MapBBSBar:Show(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !MapBBSBar:Init private function, once called once on oject creation __syntax__ <verbatim>function MapBBSBar:Init()</verbatim> ---++++ !MapBBSBar:ResetUI private function,reset all ui related object call this method after sence reset __syntax__ <verbatim>function MapBBSBar:ResetUI()</verbatim> ---++++ !MapBBSBar.OnMouseEnter private method,stop rolling when mouse enter a billboard __syntax__ <verbatim>function MapBBSBar.OnMouseEnter(ctrName,index)</verbatim> __parameters__ | *ctrName* | | | *index* | | ---++++ !MapBBSBar.OnMouseLeave private,resume rolling state when mouse leave billboard __syntax__ <verbatim>function MapBBSBar.OnMouseLeave(ctrName,index)</verbatim> __parameters__ | *ctrName* | | | *index* | | ---++++ !MapBBSBar.OnMouseUp private,fired when click on a billboard __syntax__ <verbatim>function MapBBSBar.OnMouseUp(ctrName)</verbatim> __parameters__ | *ctrName* | | ---++++ !MapBBSBar:ActiveRolling private,AddMessage will automatic call this method to roll when new message come __syntax__ <verbatim>function MapBBSBar:ActiveRolling()</verbatim> ---++++ !MapBBSBar:Update private,update display __syntax__ <verbatim>function MapBBSBar:Update()</verbatim> ---++++ !MapBBSBar:RefreshBillboard private __syntax__ <verbatim>function MapBBSBar:RefreshBillboard()</verbatim> ---++++ !MapBBSBar:Rolling private move the position of each billboard __syntax__ <verbatim>function MapBBSBar:Rolling()</verbatim> ---++++ !MapBBSBar:SetParent public __syntax__ <verbatim>function MapBBSBar:SetParent(_parent)</verbatim> __parameters__ | *parent* | | ---++++ !MapBBSBar:SetPosition public __syntax__ <verbatim>function MapBBSBar:SetPosition(x,y,width,height)</verbatim> __parameters__ | *x* | | | *y* | | | *width* | | | *height* | | ---++++ !MapBBSBar:AddMessage public __syntax__ <verbatim>function MapBBSBar:AddMessage(newMsg)</verbatim> __parameters__ | *newMsg* | | ---++++ !MapBBSBar:PopMessage public __syntax__ <verbatim>function MapBBSBar:PopMessage()</verbatim> ---++++ !MapBBSBar:Pause public __syntax__ <verbatim>function MapBBSBar:Pause()</verbatim> ---++++ !MapBBSBar:Resume public __syntax__ <verbatim>function MapBBSBar:Resume()</verbatim> ---++++ !MapBBSBar:IsMsgFull public __syntax__ <verbatim>function MapBBSBar:IsMsgFull()</verbatim> ---++++ !MapBBSBar:SetFontColor public __syntax__ <verbatim>function MapBBSBar:SetFontColor(color,colorIndex)</verbatim> __parameters__ | *color* | | | *colorIndex* | | ---+++ Member Functions ---++++ !MapBBSMsgEdit:new <verbatim>------------------------------------ -----------MapBBSMsgEdit-------- ------------------------------------ local MapBBSMsgEdit = { name = "bbsMsgBox", parent = nil, alignment = "_lt", x = 100, y = 100, width = 450, height = 60, textBox = nil; onMsgSend = nil; }</verbatim> CommonCtrl.MapBBSMsgEdit = MapBBSMsgEdit; __syntax__ <verbatim>function MapBBSMsgEdit:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MapBBSMsgViewer:new <verbatim>------------------------------------------------- ------------MapBBSMsgViewer------------ ------------------------------------------------- local MapBBSMsgViewer = { name = nil; parent = nil; alignment = "_lt", x = 0, y = 0, width = 500, height = 300, --event onItemSelect = nil; onShow = nil; }</verbatim> CommonCtrl.MapBBSMsgViewer = MapBBSMsgViewer; __syntax__ <verbatim>function MapBBSMsgViewer:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MapBBSMsgViewer.OnItemSelect private,fire onMsgSelect event __syntax__ <verbatim>function MapBBSMsgViewer.OnItemSelect(ctrName)</verbatim> __parameters__ | *ctrName* | | ---+++ Member Functions ---++++ !Map3DApp.Timer.GetNewTimerID Default Font Map3DApp.DefaultFont = "System"; ---------timer id creator------------------------------ all timer id used in 3d map was created by this class -------------------------------------------------------- Map3DApp.Timer = {}; Map3DApp.Timer.minTimerID = 200; Map3DApp.Timer.maxTimerID = Map3DApp.Timer.minTimerID - 1; __syntax__ <verbatim>function Map3DApp.Timer.GetNewTimerID()</verbatim> ---++++ !Queue:new <verbatim>----------------------------- ----------Queue-------------- local Queue = { list = {}; firstElement =1; lastElement = 0; elementCount = 0; maxElementCount = 0; }</verbatim> Map3DApp.Queue = Queue; __syntax__ <verbatim>function Queue:new(o)</verbatim> __parameters__ | *o* | | ---++++ !Queue:Peek Returns the object at the beginning of the Queue without removing it __syntax__ <verbatim>function Queue:Peek()</verbatim> ---++++ !CycleQueue:new <verbatim>----------------- local CycleQueue = { --only set this value at init time maxElementCount = 0; --thers are all private data list = {}; firstElement=1; lastElement=0; elementCount = 0; }</verbatim> Map3DApp.CycleQueue = CycleQueue; __syntax__ <verbatim>function CycleQueue:new(o)</verbatim> __parameters__ | *o* | | ---++ Map data provider | *Title* | Map data provider | | *Author(s)* | SunLingFeng | | *Date* | 2008/1/25 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppDataPvd.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.DataPvd.SetServerURL set remote server url __syntax__ <verbatim>function Map3DApp.DataPvd.SetServerURL(url)</verbatim> __parameters__ | *url* | | ---++++ !Map3DApp.DataPvd.GetTotalCellCount total map cell count Map3DApp.DataPvd.totalCellCount = 32768; Map3DApp.DataPvd.logicCellSize = 1/32768; __syntax__ <verbatim>function Map3DApp.DataPvd.GetTotalCellCount()</verbatim> ---++++ !Map3DApp.DataPvd.GetTileByPos ------------------------------------------- ----tile ------------------------------------------- client call this method to get tile data sender is this client object callback data privde will call this function when data is prepared __syntax__ <verbatim>function Map3DApp.DataPvd.GetTileByPos(posX,posY,objSender,callbackFun)</verbatim> __parameters__ | *posX* | | | *posY* | | | *objSender* | | | *callbackFun* | | ---++++ !Map3DApp.DataPvd.BuytTile buy tile with given id or position * _params_ __tileID__ :tile id you want to buy,can be nil * _params_ __x__ :,y:tile position you want to buy,can be nil * _params_ __terrainType__ :, can be nil * _params_ ____ :terrain texture,can be nil * _params_ ____ :callback function when remote call return __syntax__ <verbatim>function Map3DApp.DataPvd.BuytTile(userSession,tileID,_x,_y,_terrainType,_texture,sender,callback)</verbatim> __parameters__ | *userSession* | | | *tileID* | tile id you want to buy,can be nil | | *x* | | | *y* | | | *terrainType* | , can be nil | | *texture* | | | *sender* | | | *callback* | | ---++++ !Map3DApp.DataPvd.MockGetTilesInRegion mock RPC for testing __syntax__ <verbatim>function Map3DApp.DataPvd.MockGetTilesInRegion(msg,args)</verbatim> __parameters__ | *msg* | | | *args* | | ---++++ !Map3DApp.DataPvd.GetRandomTilePosInRegion get a random tile in reagion * _params_ __x__ :center point x in normalized world coordinate * _params_ __y__ :center point y in normalized world coordinate * _params_ __radius__ :region width,in normalized world coordinate __syntax__ <verbatim>function Map3DApp.DataPvd.GetRandomTilePosInRegion(x,y,radius)</verbatim> __parameters__ | *x* | center point x in normalized world coordinate | | *y* | | | *radius* | region width,in normalized world coordinate | ---++++ !Map3DApp.DataPvd.GetWorldByID -------------------------------------------- world -------------------------------------------- __syntax__ <verbatim>function Map3DApp.DataPvd.GetWorldByID(id,sender,callback)</verbatim> __parameters__ | *id* | | | *sender* | | | *callback* | | ---++++ !Map3DApp.DataPvd.GetLandTexByID -------------------------------------------- land texture __syntax__ <verbatim>function Map3DApp.DataPvd.GetLandTexByID(id)</verbatim> __parameters__ | *id* | | ---++++ !Map3DApp.DataPvd.GetModelByID --------------------------------------------- ----for model --------------------------------------------- Map3DApp.DataPvd.pageCount = 0; Map3DApp.DataPvd.modelCount = 0; Map3DApp.DataPvd.modelList = {}; Map3DApp.DataPvd.modelIDMappingList = {}; public __syntax__ <verbatim>function Map3DApp.DataPvd.GetModelByID(modelID)</verbatim> __parameters__ | *modelID* | | ---++++ !Map3DApp.DataPvd.GetModelOfPage result is type of modelInfo[] __syntax__ <verbatim>function Map3DApp.DataPvd.GetModelOfPage(pageNum,pageIndex)</verbatim> __parameters__ | *pageNum* | | | *pageIndex* | | ---++++ !Map3DApp.DataPvd.Get3DMark ------------------------------------------------ -----3d mark manipulation ------------------------------------------------ __syntax__ <verbatim>function Map3DApp.DataPvd.Get3DMark(markID)</verbatim> __parameters__ | *markID* | | ---++++ !Map3DApp.DataPvd.UpdataMCMLMap ------------------------------------------------- -------2d mark manipulation ------------------------------------------------- create or updata a mcml map __syntax__ <verbatim>function Map3DApp.DataPvd.UpdataMCMLMap(map)</verbatim> __parameters__ | *map* | | ---++++ !Map3DApp.DataPvd.DeleteMCMLMap deleta a MCML map __syntax__ <verbatim>function Map3DApp.DataPvd.DeleteMCMLMap(mapName)</verbatim> __parameters__ | *mapName* | | ---++++ !Map3DApp.DataPvd.GetMap ==================2d map texture==================== Map3DApp.DataPvd.MapTexture = {}; Map3DApp.DataPvd.MapTexture.root = "Texture/worldMap"; Map3DApp.DataPvd.MapTexture.files = {}; Map3DApp.DataPvd.MapTexture.fileFmt = "jpg"; Map3DApp.DataPvd.MapTexture.textures = {}; Map3DApp.DataPvd.MapTexture.defaultTexture = "Texture/whitedot.png"; return 2D map texture __syntax__ <verbatim>function Map3DApp.DataPvd.GetMap(x,y,level)</verbatim> __parameters__ | *x* | | | *y* | | | *level* | | ---++++ !Map3DApp.DataPvd.GetMapTileModelID ---------------------------------------------------- Helper ----------------------------------------------------- Map3DApp.DataPvd.mapTileModel = 0; __syntax__ <verbatim>function Map3DApp.DataPvd.GetMapTileModelID()</verbatim> ---+++ Member Functions ---++++ !Map:new ============public================ __syntax__ <verbatim>function Map:new(o)</verbatim> __parameters__ | *o* | | ---++++ !Map:SetEnable if allow use to drag and zoom the map * _params_ __isEnable__ :bool __syntax__ <verbatim>function Map:SetEnable(isEnable)</verbatim> __parameters__ | *isEnable* | bool | ---++++ !Map:JumpTo3D jump to a point on 3D map __syntax__ <verbatim>function Map:JumpTo3D(x,y)</verbatim> __parameters__ | *x* | | | *y* | | ---++++ !Map:SetViewPosition center map to (x,y) * _params_ __x__ :in normalized world coordinate * _params_ __y__ :in normalized world coordinate __syntax__ <verbatim>function Map:SetViewPosition(x,y)</verbatim> __parameters__ | *x* | in normalized world coordinate | | *y* | | ---++++ !Map:SetZoomValue zoom map, * _params_ __value__ :rang in [0,1] __syntax__ <verbatim>function Map:SetZoomValue(value)</verbatim> __parameters__ | *value* | rang in [0,1] | ---++++ !Map:SetDisplayState set map display mode 2D or 3D * _params_ __displayState__ :Map3DApp.WorldMap.DisplayState enum __syntax__ <verbatim>function Map:SetDisplayState(displayState)</verbatim> __parameters__ | *displayState* | Map3DApp.WorldMap.DisplayState enum | ---++++ !Map:SetWndPosition set window position __syntax__ <verbatim>function Map:SetWndPosition(x,y)</verbatim> __parameters__ | *x* | | | *y* | | ---++++ !Map:SetWndSize set window size __syntax__ <verbatim>function Map:SetWndSize(width,height)</verbatim> __parameters__ | *width* | | | *height* | | ---++++ !Map:GetWndPosition get window top left point positio and window width,height __syntax__ <verbatim>function Map:GetWndPosition()</verbatim> ---++++ !Map:GetDisplayMode get current displayer mode __syntax__ <verbatim>function Map:GetDisplayMode()</verbatim> ---++++ !Map:GetViewParams get view parameters __syntax__ <verbatim>function Map:GetViewParams()</verbatim> ---++++ !Map:GetWnd return the map window container allow other object draw extra element on this map __syntax__ <verbatim>function Map:GetWnd()</verbatim> ---++++ !Map:SetParentWnd set parent control __syntax__ <verbatim>function Map:SetParentWnd(parentWnd)</verbatim> __parameters__ | *parentWnd* | | ---++++ !Map:MousePick do mouse pick __syntax__ <verbatim>function Map:MousePick()</verbatim> ---++++ !Map:FireViewRegionChange fire view region changed event __syntax__ <verbatim>function Map:FireViewRegionChange()</verbatim> ---++++ !Map:SendMessage ============private================= __syntax__ <verbatim>function Map:SendMessage(msg)</verbatim> __parameters__ | *msg* | | ---++++ !Map:CreateUI Create ui controls __syntax__ <verbatim>function Map:CreateUI()</verbatim> ---++ a simple control to show model information,include model name,description,price,manufacturer and so on. | *Title* | a simple control to show model information,include model name,description,price,manufacturer and so on. | | *Author(s)* | Sun Lingfeng | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppModelInfoWnd.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppModelInfoWnd.lua"); _this = Map3DApp.ModelInfoWnd:new{ name ="modelInfoWnd", alignment = "_lt", left = 0, top = 0, parent = _parent; } _this:Show(true); </verbatim> ---+++ Member Functions ---++++ !Map3DApp.TileEditScene.Release layout Map3DApp.TileEditScene.alignment = "_fi"; Map3DApp.TileEditScene.left = 2; Map3DApp.TileEditScene.top = 2; Map3DApp.TileEditScene.width = 2; Map3DApp.TileEditScene.height =2; Map3DApp.TileEditScene.parent = nil; render targe size Map3DApp.TileEditScene.resolutionX = 512; Map3DApp.TileEditScene.resolutionY = 512; Map3DApp.TileEditScene.scene = nil; Map3DApp.TileEditScene.tileSize = 4; Map3DApp.TileEditScene.timerID = Map3DApp.Timer.GetNewTimerID(); Map3DApp.TileEditScene.activeModel = nil; Map3DApp.TileEditScene.activeCmd = nil; Map3DApp.TileEditScene.modelData = nil; Map3DApp.TileEditScene.editState=0; mouse state Map3DApp.TileEditScene.isLMBDown = false; Map3DApp.TileEditScene.isRMBDown = false; Map3DApp.TileEditScene.lastMousePosX = 0; Map3DApp.TileEditScene.lastMousePosY = 0; Map3DApp.TileEditScene.mouseDownPosX = 0; Map3DApp.TileEditScene.mouseDownPosY = 0; camera parameters Map3DApp.TileEditScene.maxZoomValue = 15; Map3DApp.TileEditScene.minZoomValue = 5; Map3DApp.TileEditScene.zoomValue = 1; Map3DApp.TileEditScene.minPitch = 0.4; Map3DApp.TileEditScene.maxPitch = 1.57; Map3DApp.TileEditScene.pitchValue = 0.5; Map3DApp.TileEditScene.rotateValue = 0; Map3DApp.TileEditScene.defaultRotate = 0; Map3DApp.TileEditScene.Camera = {}; Map3DApp.TileEditScene.Camera.fov = math.pi/6; Map3DApp.TileEditScene.Camera.nearPlane = 0.5; Map3DApp.TileEditScene.Camera.farPlane = 150; Map3DApp.TileEditScene.Camera.aspectRatio = 1; release all resource __syntax__ <verbatim>function Map3DApp.TileEditScene.Release()</verbatim> ---++++ !Map3DApp.TileEditScene.Show show the tile edit scene __syntax__ <verbatim>function Map3DApp.TileEditScene.Show(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DApp.TileEditScene.SetParent set parent control __syntax__ <verbatim>function Map3DApp.TileEditScene.SetParent(pWnd)</verbatim> __parameters__ | *pWnd* | | ---++++ !Map3DApp.TileEditScene.Zoom zoom camera,zoomValue is in range[0,1],0 is max zoom; __syntax__ <verbatim>function Map3DApp.TileEditScene.Zoom(zoomValue)</verbatim> __parameters__ | *zoomValue* | | ---++++ !Map3DApp.TileEditScene.Pitch pitch camera __syntax__ <verbatim>function Map3DApp.TileEditScene.Pitch(pitchValue)</verbatim> __parameters__ | *pitchValue* | | ---++++ !Map3DApp.TileEditScene.AddModel add new model to scene __syntax__ <verbatim>function Map3DApp.TileEditScene.AddModel(modelName,modelData)</verbatim> __parameters__ | *modelName* | | | *modelData* | | ---++++ !Map3DApp.TileEditScene.SetModelPosition set model position by model ID __syntax__ <verbatim>function Map3DApp.TileEditScene.SetModelPosition(modelID,x,y,z)</verbatim> __parameters__ | *modelID* | | | *x* | | | *y* | | | *z* | | ---++++ !Map3DApp.TileEditScene.SetModelFacing set model facing by ID __syntax__ <verbatim>function Map3DApp.TileEditScene.SetModelFacing(modelID,facing)</verbatim> __parameters__ | *modelID* | | | *facing* | | ---++++ !Map3DApp.TileEditScene.ShowModel show the model by ID __syntax__ <verbatim>function Map3DApp.TileEditScene.ShowModel(modelID,bShow)</verbatim> __parameters__ | *modelID* | | | *bShow* | | ---++++ !Map3DApp.TileEditScene.RemoveModel remove model __syntax__ <verbatim>function Map3DApp.TileEditScene.RemoveModel(modelName)</verbatim> __parameters__ | *modelName* | | ---++++ !Map3DApp.TileEditScene.ClearAllModel clear all model in scene __syntax__ <verbatim>function Map3DApp.TileEditScene.ClearAllModel()</verbatim> ---++++ !Map3DApp.TileEditScene.GetModelPosition get model position,the reture model position is in range[-1,1] __syntax__ <verbatim>function Map3DApp.TileEditScene.GetModelPosition(modelName)</verbatim> __parameters__ | *modelName* | | ---++++ !Map3DApp.TileEditScene.SetActiveModel set current active model __syntax__ <verbatim>function Map3DApp.TileEditScene.SetActiveModel(modelName)</verbatim> __parameters__ | *modelName* | | ---++++ !Map3DApp.TileEditScene.SetMsgCallback set tile edit scene message handle __syntax__ <verbatim>function Map3DApp.TileEditScene.SetMsgCallback(callback)</verbatim> __parameters__ | *callback* | | ---++++ !Map3DApp.TileEditScene.SetCommand set a command object __syntax__ <verbatim>function Map3DApp.TileEditScene.SetCommand(cmd)</verbatim> __parameters__ | *cmd* | | ---++++ !Map3DApp.TileEditScene.CreateUI =============private method=================== __syntax__ <verbatim>function Map3DApp.TileEditScene.CreateUI()</verbatim> ---++++ !Map3DApp.TileEditScene.OnMouseDown ==========mouse event handler================ __syntax__ <verbatim>function Map3DApp.TileEditScene.OnMouseDown()</verbatim> ---++ camera of the map system for both the 2D and 3D | *Title* | camera of the map system for both the 2D and 3D | | *Author(s)* | SunLingFeng | | *Date* | 2007/10/10 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppVirtualCamera.lua | ---+++ Description ---++ Exposes the main map window to app_main.lua of the map application. | *Title* | Exposes the main map window to app_main.lua of the map application. | | *Author(s)* | Date: 2008/1/24 | | *Date* | 2008/1/24 | | *File* | script/kids/3DMapSystemUI/Map/Map3DAppWrapper.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppWrapper.lua"); Map3DSystem.App.Map.ShowMapWnd(app); Map3DSystem.App.Map.MapWnd.Show(bShow,_parent,parentWindow) </verbatim> ---+++ Member Functions ---++++ !Map3DSystem.App.Map.ShowMapWnd create class commonlib.setfield("Map3DSystem.App.Map.MapWnd", {}); the map application's container name. Map3DSystem.App.Map.MapWnd.name = "map3D"; display the main map window * _param_ ____ :_app: the map app window object. __syntax__ <verbatim>function Map3DSystem.App.Map.ShowMapWnd(_app)</verbatim> __parameters__ | *app* | | ---++++ !Map3DSystem.App.Map.MapWnd.Show * _param_ __bShow__ : boolean to show or hide. if nil, it will toggle current setting. * _param_ ____ :_parent: parent window inside which the content is displayed. it can be nil. __syntax__ <verbatim>function Map3DSystem.App.Map.MapWnd.Show(bShow,_parent,parentWindow)</verbatim> __parameters__ | *bShow* | boolean to show or hide. if nil, it will toggle current setting. | | *parent* | | | *parentWindow* | | ---++++ !Map3DSystem.App.Map.MapWnd.OnClose Send WM_CLOSE message to the map window. __syntax__ <verbatim>function Map3DSystem.App.Map.MapWnd.OnClose()</verbatim> ---++++ !Map3DSystem.App.Map.MapWnd.Test TODO: remove this at release time. __syntax__ <verbatim>function Map3DSystem.App.Map.MapWnd.Test()</verbatim> ---++ display 2D map | *Title* | display 2D map | | *Author(s)* | SunLingFeng | | *Date* | 2007/1/20 | | *File* | script/kids/3DMapSystemUI/Map/Map3D_2DMap.lua | ---+++ Description ---+++ Member Functions ---++++ !Map2DLayer:Init create 2D map object __syntax__ <verbatim>function Map2DLayer:Init()</verbatim> ---++++ !Map2DLayer:OnSceneReset create scene and model __syntax__ <verbatim>function Map2DLayer:OnSceneReset()</verbatim> ---++++ !Map2DLayer:ResetViewRegion set view region to default value __syntax__ <verbatim>function Map2DLayer:ResetViewRegion()</verbatim> ---++++ !Map2DLayer:SetViewElevation set zoom value __syntax__ <verbatim>function Map2DLayer:SetViewElevation(elevation)</verbatim> __parameters__ | *elevation* | | ---++++ !Map2DLayer:UpdateView update tile position and texture __syntax__ <verbatim>function Map2DLayer:UpdateView()</verbatim> ---++++ !Map2DLayer:GetCurrentMapResolution get the current 2D map Resolution __syntax__ <verbatim>function Map2DLayer:GetCurrentMapResolution()</verbatim> ---++++ !Map2DLayer:GetViewParams get current view params,including center point of view region zoom value and view region width __syntax__ <verbatim>function Map2DLayer:GetViewParams()</verbatim> ---++ display 3D map | *Title* | display 3D map | | *Author(s)* | Sun Lingfeng | | *Date* | 2007/1/20 | | *File* | script/kids/3DMapSystemUI/Map/Map3D_3DMap.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DLayer:Destory Destory object __syntax__ <verbatim>function Map3DLayer:Destory()</verbatim> ---++++ !Map3DLayer:ResetScene private,recreate scene after scene reset __syntax__ <verbatim>function Map3DLayer:ResetScene()</verbatim> ---++++ !Map3DLayer:SetResolution set render target size __syntax__ <verbatim>function Map3DLayer:SetResolution(width,height)</verbatim> __parameters__ | *width* | | | *height* | | ---++++ !Map3DLayer:Init delete this only call Init once __syntax__ <verbatim>function Map3DLayer:Init()</verbatim> ---++ Map Browser Frame | *Title* | Map Browser Frame | | *Author(s)* | Sun Lingfeng | | *Date* | Use the lib: | | *File* | script/kids/3DMapSystemUI/Map/MapBrowserFrame.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.MapBrowserFrame.Show child control Map3DApp.MapBrowserFrame.uiSideBar = "mb_sideBarCtn"; Map3DApp.MapBrowserFrame.uiMap = "mb_mapCtn"; Map3DApp.MapBrowserFrame.uiSplit = "mb_split"; Map3DApp.MapBrowserFrame.ctrMap = "mb_map"; Map3DApp.MapBrowserFrame.ctrSideBar = "mb_sideBar"; Map3DApp.MapBrowserFrame.uiController = nil; Map3DApp.MapBrowserFrame.bShowSideBar = true; __syntax__ <verbatim>function Map3DApp.MapBrowserFrame.Show(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DApp.MapBrowserFrame.SetParentForm set the root control name __syntax__ <verbatim>function Map3DApp.MapBrowserFrame.SetParentForm(parentForm)</verbatim> __parameters__ | *parentForm* | | ---++++ !Map3DApp.MapBrowserFrame:Init ---================================= __syntax__ <verbatim>function Map3DApp.MapBrowserFrame:Init()</verbatim> ---+++ Member Functions ---++++ !SideBar:Init ---==========private================= __syntax__ <verbatim>function SideBar:Init()</verbatim> ---+++ Member Functions ---++++ !tileInfo:new <verbatim>tileInfo local tileInfo = { --object id id = 0, name = nil, x = 0, y = 0, z = 0, shape = 0, terrainInfo = nil, --terrainInfo models = nil, --modelInstance array --logicTileInfo ownerUserID = nil, ownerUserName = nil, tileState = 5, price = 0, price2 = 0, price2StartTime = nil, price2EndTime = nil, rentPrice = 0, rank = 0, cityName = nil, allowEdit = false, userUserID = nil, userName = nil, rentEndDate = nil, image = nil, community = nil, ageGroup = nil, worldID = 0, worldName = nil, }</verbatim> Map3DApp.TileInfo = tileInfo; __syntax__ <verbatim>function tileInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !tileInfo:Reset reset tileInfo to default value __syntax__ <verbatim>function tileInfo:Reset()</verbatim> ---++++ !tileInfo.CreateTileInfo tileInfo pool tileInfo.pool = {}; tileInfo.count = 0; tileInfo.first = 0; tileInfo.last = 0; __syntax__ <verbatim>function tileInfo.CreateTileInfo()</verbatim> ---++++ !terrainInfo:new <verbatim>----create a tileInfo container there Map3DApp.TileInfo.tileInfos = {}; --function Map3DApp.TileInfo.GetTileInfo(id) --return Map3DApp.TileInfo.tileInfos[id]; end --function Map3DApp.TileInfo.AddTileInfo(id,tileInfo) --Map3DApp.TileInfo.tileInfos[id] = tileInfo; end --function Map3DApp.TileInfo.RemoveTileInfo(id) --if(Map3DApp.TileInfo.tileInfos[id])then --Map3DApp.TileInfo.tileInfos[id] = nil; --end end terrainInfo local terrainInfo = { type = 1, textureID0 = 0, texture0 = nil, textureID1 = nil, texture1 = nil, rotation = 0, }</verbatim>; Map3DApp.TerrainInfo = terrainInfo; __syntax__ <verbatim>function terrainInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !modelInfo:new <verbatim>modelInfo local modelInfo = { --object id id = 0, name = "mm_0_0", --mm means map model --geometry data model = nil, image = nil, tex0 = nil, tex1 = nil, type = 1, --x = 0, --y = 0, --facing = 0, --logic data manufacturerType = 0, manufacturerID = "1", manufacturerName = "ParaEngine", price = 0, price2 = 0, price2StartTime = "00-00-00", price2EndTime = "00-00-00", AddDate = "00-00-00", --OwnerUserID = nil, --OwnerUserName = nil, version = nil, }</verbatim> Map3DApp.ModelInfo = modelInfo; __syntax__ <verbatim>function modelInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !world:new <verbatim>------------------------------ world ------------------------------ local world = { id = 0, name = "", desc = "", version = nil, ownerID = 0, ownerName = "", spaceServer = nil, jabberGSL = nil, GSL = nil, gameServer = nil, visits = 0, rank = 1, ageGroup = 4, gameData = nil, }</verbatim> Map3DApp.World = world; __syntax__ <verbatim>function world:new(o)</verbatim> __parameters__ | *o* | | ---++++ !modelInstance:new ----------------------------- ---model instance-------- ----------------------------- local modelInstance = { id = 0, modelID = 0, model = nil, texture = nil, facing = 0, offsetX = 0, offsetY = 0, } Map3DApp.ModelInstance = modelInstance; __syntax__ <verbatim>function modelInstance:new(o)</verbatim> __parameters__ | *o* | | ---++++ !modelInstance.CreateModelInst model instance pool modelInstance.pool = {}; modelInstance.count = 0; modelInstance.first = 0; modelInstance.last = 0; __syntax__ <verbatim>function modelInstance.CreateModelInst()</verbatim> ---++++ !mark3DInfo:new <verbatim>------------------------------- ----mark3DInfo ------------------------------- local mark3DInfo = { id = 0, markStyle = 1, type = 0, x, y, markTitle = "pe", cityName = "city of rock", rank = 0, startTime = "00-00-00", endTime = "00-00-00", image = nil, signature = nil, desc = nil, ageGroup = 0, isApproved = false, version = nil, ownerUserID = nil, clickCnt = 0, worldID = 0, allowEdit = nil, }</verbatim> Map3DApp.Mark3DInfo = mark3DInfo; __syntax__ <verbatim>function mark3DInfo:new(o)</verbatim> __parameters__ | *o* | | ---++ render group models of a tile | *Title* | render group models of a tile | | *Author(s)* | Sun Lingfeng | | *Date* | 2008/4/9 | | *File* | script/kids/3DMapSystemUI/Map/MapModelGroup.lua | ---+++ Description %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemApp/API/MapModelGroup.lua"); local modelGroup = Map3DApp.ModelGroup:new{ id = "modelgp", }; </verbatim> ---+++ Member Functions ---++++ !ModelGroup:RemoveModels remove all models __syntax__ <verbatim>function ModelGroup:RemoveModels()</verbatim> ---++++ !ModelGroup:SetModelData call RefreshDisplay after SetModelData to show new models __syntax__ <verbatim>function ModelGroup:SetModelData(modelInstances) </verbatim> __parameters__ | *modelInstances* | | ---++++ !ModelGroup:SetScale set model scale value __syntax__ <verbatim>function ModelGroup:SetScale(scale)</verbatim> __parameters__ | *scale* | | ---++++ !ModelGroup:CreateModels ==========private============== __syntax__ <verbatim>function ModelGroup:CreateModels()</verbatim> ---++ Map registration page | *Title* | Map registration page | | *Author(s)* | LiXizhi | | *Date* | 2008/3/21 | | *File* | script/kids/3DMapSystemUI/Map/MapRegPage.lua | ---+++ Description Ask the user to pick a home land. %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/MapRegPage.lua"); Map3DSystem.App.Map.MapRegPage:Create("Map.MapRegPage", parent, "_fi", 0,0,0,0); </verbatim> ---+++ Member Functions ---++++ !MapRegPage.OnSelect create class local MapRegPage = Map3DSystem.mcml.PageCtrl:new({url="script/kids/3DMapSystemUI/Map/MapRegPage.html"}); Map3DSystem.App.Map.MapRegPage = MapRegPage; function to be called when user completed or skipped all app registration steps. callback function to call after the registration page finish or skip MapRegPage.OnFinishedFunc = nil; MapRegPage.selectCity = nil; called when user select to live in a city __syntax__ <verbatim>function MapRegPage.OnSelect(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !MapRegPage.OnSkip Skip the registration page __syntax__ <verbatim>function MapRegPage.OnSkip(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !MapRegPage.OnAccept Accept the current __syntax__ <verbatim>function MapRegPage.OnAccept(btnName, values, bindingContext)</verbatim> __parameters__ | *btnName* | | | *values* | | | *bindingContext* | | ---++++ !MapRegPage.Leave close this step. __syntax__ <verbatim>function MapRegPage.Leave()</verbatim> ---+++ Member Functions ---++++ !MBController:OnItemSelectInMap =============private=================== __syntax__ <verbatim>function MBController:OnItemSelectInMap(mapName)</verbatim> __parameters__ | *mapName* | | ---++ code behind page for pe_land.html | *Title* | code behind page for pe_land.html | | *Author(s)* | Clayman | | *Date* | 2008/6/12 | | *File* | script/kids/3DMapSystemUI/Map/pe_land.lua | ---+++ Description show land information %T% __Sample Code__ <verbatim> NPL.load("(gl)script/kids/3DMapSystemUI/Map/pe_land.lua"); -- you can specify which land to show with tileID script/kids/3DMapSystemUI/Map/pe_land.html?tileID=405 pe_land </verbatim> ---+++ Member Functions ---++++ !landPage.SetData private this function will be invoked when tileInfo returnd fromweb service __syntax__ <verbatim>function landPage.SetData(pageInst,tileInfo)</verbatim> __parameters__ | *pageInst* | | | *tileInfo* | | ---++++ !landPage.SetWorldData this fucntion will be invoked when world data returnd from web service __syntax__ <verbatim>function landPage.SetWorldData(pageInst,worldInfo)</verbatim> __parameters__ | *pageInst* | | | *worldInfo* | | ---+++ Member Functions ---++++ !SideBarLandWnd:Init ==================private============================ __syntax__ <verbatim>function SideBarLandWnd:Init()</verbatim> ---++++ !Map3DApp.SideBarLandWnd.MockGetTileInfos ======================================================= __syntax__ <verbatim>function Map3DApp.SideBarLandWnd.MockGetTileInfos()</verbatim> ---+++ Member Functions ---++++ !SideBarSearchWnd:Init ==============private===================== __syntax__ <verbatim>function SideBarSearchWnd:Init()</verbatim> ---++++ !SideBarSearchWnd.OnResize TODO:implement this function __syntax__ <verbatim>function SideBarSearchWnd.OnResize()</verbatim> ---++++ !Map3DApp.SideBarSearchWnd.GetCommendWorld ============mock data source for testing================ delete these function __syntax__ <verbatim>function Map3DApp.SideBarSearchWnd.GetCommendWorld()</verbatim> ---++ Author(s): SunLingFeng | *Title* | Author(s): SunLingFeng | | *Author(s)* | SunLingFeng | | *Date* | 2008/4/7 | | *File* | script/kids/3DMapSystemUI/Map/TerrainTile.lua | ---+++ Description ---+++ Member Functions ---++++ !TerrainTile:Destory destory object __syntax__ <verbatim>function TerrainTile:Destory()</verbatim> ---++++ !TerrainTile:RefreshDisplay update terrain display __syntax__ <verbatim>function TerrainTile:RefreshDisplay()</verbatim> ---++++ !TerrainTile:Reset reset terrain to initial state __syntax__ <verbatim>function TerrainTile:Reset()</verbatim> ---++++ !TerrainTile:CreateTerrain =========private method============== __syntax__ <verbatim>function TerrainTile:CreateTerrain()</verbatim> ---+++ Member Functions ---++++ !Map3DApp.Commands.IDGenerator.GetNewID ========================================== Map3DApp.Commands.IDGenerator = {}; Map3DApp.Commands.IDGenerator.id = 1; Map3DApp.Commands.tileEditor = nil; __syntax__ <verbatim>function Map3DApp.Commands.IDGenerator.GetNewID()</verbatim> ---++++ !AddModel:new <verbatim>------------------------------------------------- ===========add model command=================== ------------------------------------------------- local AddModel = { cmdID = 0, modelID = 0, modelData = nil, sceneEditor = nil, editManager = nil, }</verbatim> Map3DApp.Commands.AddModelCmd = AddModel; __syntax__ <verbatim>function AddModel:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MoveModelCmd:new <verbatim>--------------------------------------------------------- ============change model position command=============== change model position local MoveModelCmd = { cmdID = 0, modelID = 0, newPosX = 0, newPosY = 0, oldPosX = 0, oldPosY = 0, sceneEditor = nil, editManager = nil, }</verbatim> Map3DApp.Commands.MoveModelCmd = MoveModelCmd __syntax__ <verbatim>function MoveModelCmd:new(o)</verbatim> __parameters__ | *o* | | ---++++ !ChangeModelFacing:new <verbatim>=============change model facing command================= local ChangeModelFacing = { cmdID = 0, modelID = 0, newFacing = 0, oldFacing = 0, sceneEditor = nil, editManager = nil, }</verbatim> Map3DApp.Commands.ChangeModelFacingCmd = ChangeModelFacing; __syntax__ <verbatim>function ChangeModelFacing:new(o)</verbatim> __parameters__ | *o* | | ---++++ !DeleteModel:new <verbatim>=================delete model command==================== local DeleteModel = { cmdID = 0, modelID = 0, modelData = nil, sceneEditor = nil, eidtManager = nil, }</verbatim> Map3DApp.Commands.DeleteModelCmd = DeleteModel __syntax__ <verbatim>function DeleteModel:new(o)</verbatim> __parameters__ | *o* | | ---++ Map tile edit command holder | *Title* | Map tile edit command holder | | *Author(s)* | SunLingFeng | | *Date* | 2008/3/18 | | *File* | script/kids/3DMapSystemUI/Map/tileEditCmdHolder.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.TileEditManager.GetNewModelID =============public========================= __syntax__ <verbatim>function Map3DApp.TileEditManager.GetNewModelID()</verbatim> ---++++ !Map3DApp.TileEditManager.Reset release all resource __syntax__ <verbatim>function Map3DApp.TileEditManager.Reset()</verbatim> ---++++ !Map3DApp.TileEditManager.SendMessage ================private===================== __syntax__ <verbatim>function Map3DApp.TileEditManager.SendMessage(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---+++ Member Functions ---++++ !tileEditor:ChooseModel public,prepare to add a model __syntax__ <verbatim>function tileEditor:ChooseModel()</verbatim> ---+++ Member Functions ---++++ !TileEditWnd.OnMyLandsBtn UI event __syntax__ <verbatim>function TileEditWnd.OnMyLandsBtn()</verbatim> ---++++ !TileEditWnd.OnControlLoad logic __syntax__ <verbatim>function TileEditWnd.OnControlLoad()</verbatim> ---++ Edit/view folder dialog box | *Title* | Edit/view folder dialog box | | *Author(s)* | LiXizhi, Leio zhang, refactored by LiXizhi 2008.2.11 | | *Date* | 2008/1/22 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/DlgFolder.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.DlgFolder.OnDlgResult called when dialog returns. __syntax__ <verbatim>function Map3DApp.DlgFolder.OnDlgResult(dialogResult)</verbatim> __parameters__ | *dialogResult* | | ---++++ !Map3DApp.DlgFolder.CreateDlg create the dialog box content __syntax__ <verbatim>function Map3DApp.DlgFolder.CreateDlg(_parent)</verbatim> __parameters__ | *parent* | | ---++ Edit/view mark dialog box | *Title* | Edit/view mark dialog box | | *Author(s)* | LiXizhi, Leio zhang, refactored by LiXizhi 2008.2.11 | | *Date* | 2008/1/22 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/DlgMark.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.DlgMark.AttWrapper writing/reading value from/to datasource for each indirect attribute of markNode. __syntax__ <verbatim>function Map3DApp.DlgMark.AttWrapper(dataMember, bIsWriting, value)</verbatim> __parameters__ | *dataMember* | | | *bIsWriting* | | | *value* | | ---++++ !Map3DApp.DlgMark.CreateDlg create the dialog box content __syntax__ <verbatim>function Map3DApp.DlgMark.CreateDlg(_parent)</verbatim> __parameters__ | *parent* | | ---++ Edit/view Tile dialog box | *Title* | Edit/view Tile dialog box | | *Author(s)* | Leio zhang | | *Date* | 2008/2/22 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/DlgTile.lua | ---+++ Description ---++ Author(s):Sun Lingfeng | *Title* | Author(s):Sun Lingfeng | | *Author(s)* | Sun Lingfeng | | *Date* | 2008/2/22 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/GridView.lua | ---+++ Description ---+++ Member Functions ---++++ !ImageGridView:new <verbatim>-------image grid view---------- local ImageGridView = { name = "igv", alignment = "_lt", left = 0, top = 0, width = 300, height = 300, parent = nil, cells = {}, cellCount = 0, maxCellCount = 10, cellWidth = 0, cellHeight = 0, columnCount = 0, rowCount = 0, cellSpaceX = 4, cellSpaceY = 4, onCellClick = nil; }</verbatim> Map3DApp.ImageGridView = ImageGridView; __syntax__ <verbatim>function ImageGridView:new(o)</verbatim> __parameters__ | *o* | | ---++++ !ImageGridView:Reset delete all cell data __syntax__ <verbatim>function ImageGridView:Reset()</verbatim> ---++++ !ImageGridView:SetData dataSet is type of modelInfo __syntax__ <verbatim>function ImageGridView:SetData(dataSet)</verbatim> __parameters__ | *dataSet* | | ---++++ !ImageGridView:AddCell add new data to a cell __syntax__ <verbatim>function ImageGridView:AddCell(image,data)</verbatim> __parameters__ | *image* | | | *data* | | ---++++ !ImageGridView:IsFull return true when all cell is occupied __syntax__ <verbatim>function ImageGridView:IsFull()</verbatim> ---++++ !ImageGridView:RecreateUI =============private=========================== create ui resource __syntax__ <verbatim>function ImageGridView:RecreateUI()</verbatim> ---++++ !ImageGridView.OnCellClick __syntax__ <verbatim>function ImageGridView.OnCellClick(ctrName,cellID)</verbatim> __parameters__ | *ctrName* | | | *cellID* | | ---+++ Member Functions ---++++ !markInfo:new <verbatim>------------------------------------ mark info ------------------------------------ mark type Map3DApp.MarkType = { player = 1, event = 2, city = 3, ad = 4, } enumeration: button styles. Map3DApp.mark_styles={ -- cursor_x, cursor_y is the cursor offset. {icon = "Texture/3DMapSystem/common/Flag_red.png", cursor_x = 2, cursor_y = 17}, {icon = "Texture/3DMapSystem/common/city.png", cursor_x = 8, cursor_y = 17}, {icon = "Texture/3DMapSystem/common/Flag_green.png", cursor_x = 8, cursor_y = 17}, }; enumeration: text styles. Map3DApp.mark_text_styles={ {color = "0 0 0", scale=nil, background = "Texture/alphadot.png"}, {color = "0 0 0", scale=1.2, background = "Texture/alphadot.png"}, {color = "0 0 0", scale=0.9, background = "Texture/alphadot.png"}, {color = "0 0 0", scale=1.3, background = "Texture/alphadot.png"}, }; local markInfo = { markID = nil, markType = 0, -- int, mark model or icon type: see MarkButton.button_style markStyle = 1, -- text style: see MarkButton.text_style bShowText = true, textColor = "0 0 0", textScale = 1, textRot = 0, markTitle = "鏈懡鍚?, markDesc = "", startTime = "", endTime = "", x = 0, y = 0, cityName = "", rank = 0, logo = "", signature = "", desc = "", ageGroup = 0, URL = "", isApproved = false, version = "", ownerUserID = "", clickCnt = 0, worldID = -1, allowEdit = false, z = 0, }</verbatim> Map3DApp.markInfo = markInfo; __syntax__ <verbatim>function markInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !markInfo:GetIcon get the icon __syntax__ <verbatim>function markInfo:GetIcon()</verbatim> ---++++ !markInfo:GetCursorPt get cursor point pixel position in the icon image. * _return_ ____ : defaults to 0,0 __syntax__ <verbatim>function markInfo:GetCursorPt()</verbatim> __parameters__ | *return* | defaults to 0,0 | ---++++ !folderInfo:new <verbatim>------------------------------ folder info ------------------------------ local folderInfo = { ID=nil, title="甯哥敤鏍囪", desc="", }</verbatim> Map3DApp.folderInfo = folderInfo; __syntax__ <verbatim>function folderInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !folderInfo:AddMark add a new mark * _param_ __mark__ : if nil a new mark will be created. * _return_ ____ : return the mark added __syntax__ <verbatim>function folderInfo:AddMark(mark)</verbatim> __parameters__ | *mark* | if nil a new mark will be created. | ---++++ !folderInfo:RemoveMark remove mark by ID __syntax__ <verbatim>function folderInfo:RemoveMark(markID)</verbatim> __parameters__ | *markID* | | ---++++ !mapInfo:new <verbatim>------------------------------ map info ------------------------------ local mapInfo = { -- owner id or nil if local. userID = nil, }</verbatim> Map3DApp.mapInfo = mapInfo; __syntax__ <verbatim>function mapInfo:new(o)</verbatim> __parameters__ | *o* | | ---++++ !mapInfo:AddFolder add folder from the map * _param_ __folder__ : if nil a new folder will be created. * _return_ ____ : return the folder added __syntax__ <verbatim>function mapInfo:AddFolder(folder)</verbatim> __parameters__ | *folder* | if nil a new folder will be created. | ---++++ !mapInfo:RemoveFolder remove folder from the map __syntax__ <verbatim>function mapInfo:RemoveFolder(ID)</verbatim> __parameters__ | *ID* | | ---++ mcml 2d map mark data provider | *Title* | mcml 2d map mark data provider | | *Author(s)* | LiXizhi, Leio zhang, refactored by LiXizhi 2008.2.11 | | *Date* | 2008/1/25 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/MarkProvider.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.MarkProvider.Init the map object for the local user. Map3DApp.MarkProvider.MyMapTree=nil; default name of the local my map file. it is always in the map app folder. Map3DApp.MarkProvider.MyMapFile="mymap.map"; -------------------------------------------- my map related -------------------------------------------- call this to load my map from local disk. __syntax__ <verbatim>function Map3DApp.MarkProvider.Init()</verbatim> ---++++ !Map3DApp.MarkProvider.GetMyMap get the current user's map, it will retrieve it if not loaded before. If loading failed it will create a new map as the current user map. __syntax__ <verbatim>function Map3DApp.MarkProvider.GetMyMap()</verbatim> ---++++ !Map3DApp.MarkProvider.SaveLocalMyMap save map map to the default local file folder. __syntax__ <verbatim>function Map3DApp.MarkProvider.SaveLocalMyMap()</verbatim> ---++++ !Map3DApp.MarkProvider.NewMap -------------------------------------------- map to/from disk functions -------------------------------------------- create an empty map without any folder __syntax__ <verbatim>function Map3DApp.MarkProvider.NewMap()</verbatim> ---++++ !Map3DApp.MarkProvider.LoadMap Load map from a file. return the map object. it may return nil if failed. __syntax__ <verbatim>function Map3DApp.MarkProvider.LoadMap(filename)</verbatim> __parameters__ | *filename* | | ---++++ !Map3DApp.MarkProvider.SaveMap save a map object to a given file. * _param_ __map__ : the map object * _param_ __filename__ : where to save the file. __syntax__ <verbatim>function Map3DApp.MarkProvider.SaveMap(map, filename)</verbatim> __parameters__ | *map* | the map object | | *filename* | | ---++ the UI layer for drawing the marks according to the current view region. | *Title* | the UI layer for drawing the marks according to the current view region. | | *Author(s)* | LiXizhi, Leio zhang, refactored by LiXizhi 2008.2.11 | | *Date* | 2008/1/24 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/MarkUILayer.lua | ---+++ Description ---+++ Member Functions ---++++ !MarkButton:new <verbatim> the max number of cached mark buttons allowed Map3DApp.MarkUILayer.MaxMarkDisplayed = 50; an array of cached MarkButton local MarkList={}; Map3DApp.MarkUILayer.MapBrowserName=nil; ----------------------------------------------- Each mark button is associated with a UI object and a markInfo object. Mark buttons are reused as many as possible when view region changed. ----------------------------------------------- local MarkButton = { -- the treeView mark Node associated with this button markNode=nil, -- name of UI objects associated with this button name=nil, -- this is increased by 1 on each frame move. so that we know when a button is last used. counter = 0, -- private: automatically set for text display during rotation. textOffset_X = 0, textOffset_Y = 0, }</verbatim> Map3DApp.MarkButton = MarkButton; __syntax__ <verbatim>function MarkButton:new(o)</verbatim> __parameters__ | *o* | | ---++++ !MarkButton:UpdateUI update the UI object according to the markInfo. it does not update position. * _param_ __parentWnd__ : it can be nil. but passing it will speed up this function. __syntax__ <verbatim>function MarkButton:UpdateUI(parentWnd)</verbatim> __parameters__ | *parentWnd* | it can be nil. but passing it will speed up this function. | ---++++ !MarkButton:UpdatePosition update the position and visibility * _param_ __pixelX__ :, pixelY: if nil, the button will be hidden * _param_ __parentWnd__ : it can be nil. but passing it will speed up this function. __syntax__ <verbatim>function MarkButton:UpdatePosition(pixelX, pixelY, parentWnd)</verbatim> __parameters__ | *pixelX* | , pixelY: if nil, the button will be hidden | | *pixelY* | | | *parentWnd* | | ---++++ !MarkButton.OnClickMark [[ TODO: user clicks the mark, show a pop up UI mouse over: display balloon left click: zoom in and display dialog right click: display dialog ]] __syntax__ <verbatim>function MarkButton.OnClickMark(btnName)</verbatim> __parameters__ | *btnName* | | ---++++ !Map3DApp.MarkUILayer.Init ----------------------------------------------- mark UI layer. ----------------------------------------------- call this function to bind the UI layer to the map window. It listens for ViewRegionChange event of the map window. __syntax__ <verbatim>function Map3DApp.MarkUILayer.Init(MapBrowserName)</verbatim> __parameters__ | *MapBrowserName* | | ---++++ !Map3DApp.MarkUILayer:SetMessage frame counter, increased by 1 for each OnViewRegionChange() call local counter = 0; event called when the view region is changed such as by panning and scaling the camera. __syntax__ <verbatim>function Map3DApp.MarkUILayer:SetMessage(sender,msg,data)</verbatim> __parameters__ | *sender* | | | *msg* | | | *data* | | ---++++ !Map3DApp.MarkUILayer.UpdateMarkPosition ----------------------------------------------- methods ----------------------------------------------- update mark position * _param_ __counter__ : it is a counter increased by 1 during ViewRegionChange. We can use it to estimate when a node is added recently. __syntax__ <verbatim>function Map3DApp.MarkUILayer.UpdateMarkPosition(counter)</verbatim> __parameters__ | *counter* | it is a counter increased by 1 during ViewRegionChange. We can use it to estimate when a node is added recently. | ---++++ !Map3DApp.MarkUILayer.AddMark add a new mark to the pool, it will reuse mark buton already in the pool if markInfo is the same. * _param_ __counter__ : it is a counter increased by 1 during ViewRegionChange. We can use it to estimate when a node is added recently. * _return_ ____ : it returns the mark button added or it will nil if pool is full. we should stop calling AddMark after the pool is full. __syntax__ <verbatim>function Map3DApp.MarkUILayer.AddMark(markNode,counter)</verbatim> __parameters__ | *markNode* | | | *counter* | it is a counter increased by 1 during ViewRegionChange. We can use it to estimate when a node is added recently. | ---++++ !Map3DApp.MarkUILayer.RemoveMark remove marks whose markNode is the same as input * _param_ __markNode__ : the treeView mark Node __syntax__ <verbatim>function Map3DApp.MarkUILayer.RemoveMark(markNode)</verbatim> __parameters__ | *markNode* | the treeView mark Node | ---++++ !Map3DApp.MarkUILayer.ClearAll clear all cached UI marks. __syntax__ <verbatim>function Map3DApp.MarkUILayer.ClearAll()</verbatim> ---++++ !Map3DApp.MarkUILayer.ToPixel convert normalized world pt from [0-1] to pixel control position __syntax__ <verbatim>function Map3DApp.MarkUILayer.ToPixel(px,py)</verbatim> __parameters__ | *px* | | | *py* | | ---++ display and edit MCML maps by the user or its friends, etc. | *Title* | display and edit MCML maps by the user or its friends, etc. | | *Author(s)* | LiXizhi, Leio zhang, refactored by LiXizhi 2008.2.11 | | *Date* | 2008/1/21 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/MyMapWnd.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.MyMapWnd.DrawMyMapNodeHandler maps tree view owner draw callback __syntax__ <verbatim>function Map3DApp.MyMapWnd.DrawMyMapNodeHandler(_parent, treeNode)</verbatim> __parameters__ | *parent* | | | *treeNode* | | ---++++ !Map3DApp.MyMapWnd.RenderCategoryNode render a category node that can expand child nodes. __syntax__ <verbatim>function Map3DApp.MyMapWnd.RenderCategoryNode(_parent,treeNode, left, top, width, height, textColor)</verbatim> __parameters__ | *parent* | | | *treeNode* | | | *left* | | | *top* | | | *width* | | | *height* | | | *textColor* | | ---++++ !Map3DApp.MyMapWnd.UpdateData ------------------------------------------------ UI methods: add folder and mark node. ------------------------------------------------ Update data from current settings. __syntax__ <verbatim>function Map3DApp.MyMapWnd.UpdateData()</verbatim> ---++++ !Map3DApp.MyMapWnd.AddFolderNode add new folder node to a given map node * _param_ __mapNode__ : the map node to which the folder node is added. * _param_ __bUpdateUI__ : true to update UI. __syntax__ <verbatim>function Map3DApp.MyMapWnd.AddFolderNode(mapNode, folderInfo, bUpdateUI)</verbatim> __parameters__ | *mapNode* | the map node to which the folder node is added. | | *folderInfo* | | | *bUpdateUI* | | ---++++ !Map3DApp.MyMapWnd.AddMarkNode add a new mark node to the given folder Node __syntax__ <verbatim>function Map3DApp.MyMapWnd.AddMarkNode(folderNode, markInfo, bUpdateUI)</verbatim> __parameters__ | *folderNode* | | | *markInfo* | | | *bUpdateUI* | | ---++++ !Map3DApp.MyMapWnd.AppendMarkTemplatesToFolder it will append a special mark templates as first child node at the given folder node if it has not been created before * _param_ __nodeFolder__ : the folder node * _param_ __bUpdateUI__ : true to update UI. __syntax__ <verbatim>function Map3DApp.MyMapWnd.AppendMarkTemplatesToFolder(nodeFolder, bUpdateUI)</verbatim> __parameters__ | *nodeFolder* | the folder node | | *bUpdateUI* | | ---++++ !Map3DApp.MyMapWnd.IteratorNextVisibleMarkNode return an iterator of visible markNode in the tree view. this will includes all marks in my maps, featured maps, and friends maps. __syntax__ <verbatim>function Map3DApp.MyMapWnd.IteratorNextVisibleMarkNode()</verbatim> ---++++ !Map3DApp.MyMapWnd.OnClickMapNode ------------------------------------------------ event handlers ------------------------------------------------ general map node onclick event __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickMapNode(treeNode)</verbatim> __parameters__ | *treeNode* | | ---++++ !Map3DApp.MyMapWnd.OnClickSyncMapNode ------------------------ map event ------------------------ syn the map with the remote server __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickSyncMapNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DApp.MyMapWnd.OnClickDeleteMarkNode ------------------------ mark event ------------------------ user clicks to delete a mark inside a folder node. __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickDeleteMarkNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DApp.MyMapWnd.OnCheckFolderNode ------------------------ folder event ------------------------ user checks to show/hide a map folder __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnCheckFolderNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DApp.MyMapWnd.OnClickFolderEditMode use clicks to edit the folder node. __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickFolderEditMode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DApp.MyMapWnd.OnClickEditFolder show the folder editor dialog __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickEditFolder(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---++++ !Map3DApp.MyMapWnd.OnClickAddFolder add a folder to my map __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickAddFolder()</verbatim> ---++++ !Map3DApp.MyMapWnd.OnClickDeleteFolderNode user clicks to delete a folder inside a map node. __syntax__ <verbatim>function Map3DApp.MyMapWnd.OnClickDeleteFolderNode(sCtrlName, nodePath)</verbatim> __parameters__ | *sCtrlName* | | | *nodePath* | | ---+++ Member Functions ---++++ !Map3DApp.TileEditMediator.Init ==========public method============== __syntax__ <verbatim>function Map3DApp.TileEditMediator.Init()</verbatim> ---++++ !Map3DApp.TileEditMediator.OnFrameMsg ==========private method============= __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnFrameMsg(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---++++ !Map3DApp.TileEditMediator.OnPanelMsg handle edit panel message __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnPanelMsg(msg)</verbatim> __parameters__ | *msg* | | ---++++ !Map3DApp.TileEditMediator.OnEditSceneMsg handle edit scene message __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnEditSceneMsg(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---++++ !Map3DApp.TileEditMediator.OnEditWndMsg handle eidt window message __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnEditWndMsg(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---++++ !Map3DApp.TileEditMediator.OnLandWndMsg handle land window message __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnLandWndMsg(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---++++ !Map3DApp.TileEditMediator.OnTileEditManagerMsg handle tile edit manager message __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnTileEditManagerMsg(msg,data)</verbatim> __parameters__ | *msg* | | | *data* | | ---++++ !Map3DApp.TileEditMediator.OnModelOfPageUpdate on model of page call return __syntax__ <verbatim>function Map3DApp.TileEditMediator.OnModelOfPageUpdate(modelInfos)</verbatim> __parameters__ | *modelInfos* | | ---++++ !Map3DApp.ModelPageManager.FirstPage ==============ModelPageManager==================== Map3DApp.ModelPageManager = {}; Map3DApp.ModelPageManager.totalPageCount = 0; Map3DApp.ModelPageManager.activePageIndex = 0; Map3DApp.ModelPageManager.dataPvd = Map3DApp.DataPvd; Map3DApp.ModelPageManager.frame = Map3DApp.TileEditWnd; =========public method================ __syntax__ <verbatim>function Map3DApp.ModelPageManager.FirstPage()</verbatim> ---++++ !Map3DApp.ModelPageManager.OnPageChange ==========private method=============== __syntax__ <verbatim>function Map3DApp.ModelPageManager.OnPageChange()</verbatim> ---++ edit panel | *Title* | edit panel | | *Author(s)* | Lingfeng Sun | | *Date* | 2008/3/11 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/TileEditPanel.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.TileEditPanel.Show ======private member======= Map3DApp.TileEditPanel.name = "tileEditPanel"; Map3DApp.TileEditPanel.parent = nil; Map3DApp.TileEditPanel.onButtonClick = nil; button name Map3DApp.TileEditPanel.deleteBtn = Map3DApp.TileEditPanel.name.."delete"; Map3DApp.TileEditPanel.undoBtn = Map3DApp.TileEditPanel.name.."undo"; Map3DApp.TileEditPanel.redoBtn = Map3DApp.TileEditPanel.name.."redo"; Map3DApp.TileEditPanel.rightRotateBtn = Map3DApp.TileEditPanel.name.."rRotate"; Map3DApp.TileEditPanel.leftRotateBtn = Map3DApp.TileEditPanel.name.."lRotate"; Map3DApp.TileEditPanel.saveBtn = Map3DApp.TileEditPanel.name.."save"; Map3DApp.TileEditPanel.cancelBtn = Map3DApp.TileEditPanel.name.."cancel"; =======public method======== __syntax__ <verbatim>function Map3DApp.TileEditPanel.Show(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DApp.TileEditPanel.Release release all resource __syntax__ <verbatim>function Map3DApp.TileEditPanel.Release()</verbatim> ---++++ !Map3DApp.TileEditPanel.CreateUI =========private============ __syntax__ <verbatim>function Map3DApp.TileEditPanel.CreateUI()</verbatim> ---++ Edit/view Tile dialog box | *Title* | Edit/view Tile dialog box | | *Author(s)* | Leio zhang & Lingfeng Sun(refactor by Lingfeng Sun on 2.28) | | *Date* | 2008/2/22 | | *File* | script/kids/3DMapSystemUI/Map/SideBar/TileEditWnd.lua | ---+++ Description ---+++ Member Functions ---++++ !Map3DApp.TileEditWnd.Show public Map3DApp.TileEditWnd.name = "tileEditWnd"; private Map3DApp.TileEditWnd.x = 0; Map3DApp.TileEditWnd.y = 0; Map3DApp.TileEditWnd.width = 0; Map3DApp.TileEditWnd.height = 0; Map3DApp.TileEditWnd.parent = nil; Map3DApp.TileEditWnd.bindingContext=nil; Map3DApp.TileEditWnd.lastFilterType = nil; Map3DApp.TileEditWnd.sideBarWidth = 282; Map3DApp.TileEditWnd.modelInfoWnd = nil; Map3DApp.TileEditWnd.modelGridView = nil; Map3DApp.TileEditWnd.modelInfoWnd = nil; Map3DApp.TileEditWnd.listeners = {}; ==========public method================= show tileEditWnd __syntax__ <verbatim>function Map3DApp.TileEditWnd.Show(bShow)</verbatim> __parameters__ | *bShow* | | ---++++ !Map3DApp.TileEditWnd.Release release all resource __syntax__ <verbatim>function Map3DApp.TileEditWnd.Release()</verbatim> ---++++ !Map3DApp.TileEditWnd.SetParent set control parent __syntax__ <verbatim>function Map3DApp.TileEditWnd.SetParent(_parent)</verbatim> __parameters__ | *parent* | | ---++++ !Map3DApp.TileEditWnd.SetPosition set windows position __syntax__ <verbatim>function Map3DApp.TileEditWnd.SetPosition(x,y)</verbatim> __parameters__ | *x* | | | *y* | | ---++++ !Map3DApp.TileEditWnd.SwitchTabPage =========private method================== create ui resource function Map3DApp.TileEditWnd.CreateUI() local self = Map3DApp.TileEditWnd; local _this,_parent,_rootParent; _this = ParaUI.CreateUIObject("container",self.name,"_lt",self.x,self.y,self.width,self.height); if(self.parent ~= nil)then self.parent:AddChild(_this); else _this:AttachToRoot(); end _rootParent = _this; --create edit scene container _this = ParaUI.CreateUIObject("container",self.name.."scene","_lt",5,5,541,546); _rootParent:AddChild(_this); _parent = _this; NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppTileEditScene.lua"); Map3DApp.TileEditScene.SetParent(_parent); Map3DApp.TileEditScene.Show(bShow); --side bar container _this = ParaUI.CreateUIObject("container",self.name.."sideBar","_rt",-self.sideBarWidth,4,self.sideBarWidth,self.height-8); _rootParent:AddChild(_this); _parent = _this; --side bar tab page menu NPL.load("(gl)script/ide/MainMenu.lua"); _this = CommonCtrl.GetControl(self.name.."menu"); if(_this == nil)then _this = CommonCtrl.MainMenu:new{ name = self.name.."menu", alignment = "_lt", left = 10, top = 5, width = 200, height = 20, }; local node = _this.RootNode; node:AddChild(CommonCtrl.TreeNode:new({Text = "妯″瀷", Name = "model", onclick = Map3DApp.TileEditWnd.SwitchTabPage})); node:AddChild(CommonCtrl.TreeNode:new({Text = "灞炴€?, Name = "property", onclick = Map3DApp.TileEditWnd.SwitchTabPage})); end _this.parent = _parent; _this:Show(true); CommonCtrl.MainMenu.OnClickTopLevelMenuItem(self.name.."menu",1); --===================model edit page======================= _this = ParaUI.CreateUIObject("container",self.name.."modelEditPage","_lt",0,25,self.sideBarWidth-4,self.height-33); _this.fastrender = false; _parent:AddChild(_this); _parent = _this; --model type filter NPL.load("(gl)script/ide/dropdownlistbos.lua"); _this = CommonCtrl.GetControl(self.name.."filter"); if(_this == nil)then _this = CommonCtrl.dropdownlistbox:new{ name = self.name.."filter", alignment = "_rt", left = -140, top = 6, width = 130, height = 20, dropdownheight = 106, text = "", items = {"寤虹瓚", "浜虹墿鏍囪", "浜嬩欢鏍囪" }, onselect = "Map3DApp.TileEditWnd.OnUIMsg(Map3DApp.TileEditWnd.Msg.filterChange)"; }; end; _this.parent = _parent; _this:Show(); NPL.load("(gl)script/kids/3DMapSystemUI/Map/SideBar/GridView.lua"); self.modelGridView = Map3DApp.ImageGridView:new{ name = self.name.."modelGV", left = 0, top = 27, width = self.sideBarWidth-4, height = 260, cellWidth = 80, cellHeight = 80, cellSpaceX = 4, parent = _parent; maxCellCount= 9, onCellClick = Map3DApp.TileEditWnd.OnModelSelect; }; self.modelGridView:Show(true); self.modelGridView:RefreshCells(); --display page index _this = ParaUI.CreateUIObject("text",self.name.."pageIndex","_rt",-180,290,50,23); _this.text = "1/1"; _parent:AddChild(_this); _this = ParaUI.CreateUIObject("button", self.name.."prePageBtn", "_rt", -135, 290, 60, 16) _this.text = "涓婁竴椤?; _this.onclick=";Map3DApp.TileEditWnd.OnPageDown();"; _parent:AddChild(_this); _this = ParaUI.CreateUIObject("button", self.name.."nextPageBtn", "_rt", -70, 290, 60, 16) _this.text = "涓嬩竴椤?; _this.onclick=";Map3DApp.TileEditWnd.OnPageUp();"; _parent:AddChild(_this); --model infomation window if(not self.modelInfoWnd)then NPL.load("(gl)script/kids/3DMapSystemUI/Map/Map3DAppModelInfoWnd.lua"); self.modelInfoWnd = Map3DApp.ModelInfoWnd:new{ name = self.name.."modelInfoWnd", alignment = "_lt", left = 0, top = 320, width = self.sideBarWidth - 4, height = 200, parent = _parent; } end self.modelInfoWnd:SetParent(_parent); self.modelInfoWnd:Show(true); --=================tile property edit page================= _parent = ParaUI.GetUIObject(self.name.."sideBar") _this = ParaUI.CreateUIObject("container",self.name.."tilePropertyPage","_lt",0,25,self.sideBarWidth-4,self.height-33); _this.visible = false; _parent:AddChild(_this); _parent = _this; --_this = ParaUI.CreateUIObject("text","s","_lt",6,15,80,12); --_this.text = "鍦熷湴鍚嶇О:"; --_parent:AddChild(_this); -- --_this = ParaUI.CreateUIObject("imeeditbox",self.name.."ownerName","_lt",75,15,120,20); --_this.text = "none..."; --_parent:AddChild(_this); --==================tabpage switch menu==================== end __syntax__ <verbatim>function Map3DApp.TileEditWnd.SwitchTabPage(treeNode)</verbatim> __parameters__ | *treeNode* | | ---++++ !Map3DApp.TileEditWnd.OnUIMsg ui event handler function---------------- __syntax__ <verbatim>function Map3DApp.TileEditWnd.OnUIMsg(msg,data1)</verbatim> __parameters__ | *msg* | | | *data1* | | %STOPINCLUDE%
E
dit
|
A
ttach
|
P
rint version
|
H
istory
: r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r1 - 2008-02-29
-
LiXizhi
Home
Site map
CCWeb web
HaqiTeen web
Main web
ParaEngine web
TWiki web
Main Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
导航页WebTopMenu
Preferences
开发指南
Getting Started
ParacraftSDK
NPL
MCML
NPL Reference Manual
美术Mod
Account
Log In
English
简体中文
簡體中文
E
dit
A
ttach
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback