最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
robotlegs使用例子的笔记
时间:2022-06-28 22:12:19 编辑:袖梨 来源:一聚教程网
先放上我写的demo吧,明天回老家,等下周来了继续写哈~
as文件
| 代码如下 | 复制代码 |
| package { import com.pztai.example.AppConfig; import flash.display.Sprite; import flash.display.StageAlign; import flash.display.StageScaleMode; import robotlegs.bender.bundles.mvcs.MVCSBundle; import robotlegs.bender.extensions.contextView.ContextView; import robotlegs.bender.framework.api.IContext; import robotlegs.bender.framework.impl.Context; import flash.events.IEventDispatcher; import com.pztai.example.view.events.indexViewEvent; public class vcandroid extends Sprite { private var _context:IContext; public function vcandroid() { super(); // 支持 autoOrient stage.align = StageAlign.TOP_LEFT; stage.scaleMode = StageScaleMode.NO_SCALE; _context = new Context() .install(MVCSBundle) .configure(AppConfig) .configure(new ContextView(this)); } } } |
|
xml文件
| 代码如下 | 复制代码 |
|
|
|
这个demo仅仅实现了核心的交互
其中需要注意的地方
1.AppConfi.as 里面的注入要写在config()函数里面
2.command触发事件 要写在mediator里面,逻辑部分最好都写在command 里面
3.model 不存储数据
相关文章
- 耐玩的双人游戏无广告推荐 2026免费的双人游戏无广告盘点 07-15
- 适合小学生玩的游戏推荐 2026小学生喜欢玩的游戏合集 07-15
- 日式rpg游戏合集 2026最受欢迎的日式rpg游戏大盘点 07-15
- 濡沫江湖洛阳郊外隐藏宝箱具体位置一览 07-15
- 暗黑破坏神4怎么堆叠减伤 暗黑破坏神4堆减伤攻略 07-15
- tavo角色卡怎么导入 07-15