未名人的flash rpg地图编辑器代码分析(1)
来源:互联网 发布:软件测试知识点汇总 编辑:程序博客网 时间:2024/06/11 20:47
(1)地图编辑器的创建对话框
按下创建按钮后,首先要
newSceneWindow = TitleWindow(PopUpManager.createPopUp(this, NewScene, true));
// PopUpManager.bringToFront(newSceneWindow);
newSceneWindow.addEventListener( MapEditEvent.NEW_SCENE, newScene); //把按钮ok按下后的事件创好
(2)弹出编辑对话框,把设置的值赋给父application的成员变量
this.parentApplication.sceneId = this.sceneId.text;
this.parentApplication.mapWidth = this.mapWidthText.text;
this.parentApplication.mapHeight = this.mapHeightText.text;
this.parentApplication.tilePixelWidth = this.tileWidthText.text;
this.parentApplication.tilePixelHeight = this.tileHeightText.text;
(3)最后确定后 ,激发这个MapEditEvent.NEW_SCENE事件
this.dispatchEvent(new MapEditEvent(MapEditEvent.NEW_SCENE));
(4)地图移动
鼠标右键按下,记录鼠标按下位置
private function hRightMouseDownCanvas(event:MouseEvent):void
{
if (this.mapLayer == null) return;
this.rightMouseDowned = true; //鼠标右键按下
//鼠标按下时所在像素点
this.mousePointOldX = event.stageX;
this.mousePointOldY = event.stageY;
}
当移动鼠标的时候,就要开始动作,同时改变各个层的地图坐标
if (this.rightMouseDowned == true) //鼠标右键按下
{
//移动地图
this.mapLayer.x = this.mapLayer.x + event.stageX - this.mousePointOldX;
this.mapLayer.y = this.mapLayer.y + event.stageY - this.mousePointOldY;
this.mousePointOldX = event.stageX;
this.mousePointOldY = event.stageY;
this.gridLayer.x = this.mapLayer.x;
this.gridLayer.y = this.mapLayer.y;
this.walkableLayer.x = this.mapLayer.x;
this.walkableLayer.y = this.mapLayer.y;
this.buildingLayer.x = this.mapLayer.x;
this.buildingLayer.y = this.mapLayer.y;
}
- 未名人的flash rpg地图编辑器代码分析(1)
- 未名人的flash rpg地图编辑器代码分析(2)
- Flash游戏开发-RPG地图实现
- flash游戏地图编辑器
- 分析flash mmorpg地图的实现
- 分析MP4的名人博客
- Flash开发的斜视角下的地图编辑器
- 地图编辑器的选择1
- flash rpg网页游戏的成本
- unity RPG小地图的制作
- Lgame之RPG之地图1
- flash的google地图
- 1k行代码的编辑器-kilo源码分析
- uboot中nand flash代码分析(1)
- 这个双休日要分析cattom那个RPG游戏的代码,昨天分析了他另个程序的代码
- RPG游戏引擎开发日志1:理解分析RPG游戏
- doom3关卡编辑器代码的一些分析
- 用FLASH制作RPG
- 面向对象之自动生成助记码
- ASP.net实现验证码技术(2)
- string的简单用法
- 使用 Windows Mobile 5.0 中的图片、视频和照相机
- oracle定时分析用户下的所有表
- 未名人的flash rpg地图编辑器代码分析(1)
- socket相关的函数I/O模型
- 在Rational ClearCase中将RequisitePro项目存档
- 项目管理中使用的工具
- Linux环境进程间通信(五): 共享内存(上)
- 5分钟搞定内存字节对齐
- 新站如何在一天内被Google和百度收录(经典)
- [CF.Skills]在.NET CF中嵌入Media Player(C#)
- OSCache 使用指南