// Use this for initialization
        public MapNavigatorPanel(MapModel mapModel)
        {
            this.mapModel = mapModel;
            this.mapSize = new Vector2(512, 512);

            // BG
            this.floor = new Roga2dNode();
            Roga2dSprite sprite = new Roga2dSprite("bg/map", new Vector2(512, 512), new Vector2(0, 0), new Rect(0, 0, 512, 512));
            sprite.LocalPixelPosition = new Vector2(256, 256);
            this.floor.AddChild(sprite);
            this.AddChild(this.floor);

            // Camera
            this.camera = new Roga2dNode();
            this.AddChild(this.camera);

            MapModel model = MapCache.GetInstance().GetModel();
            StepData[] steps = model.GetSteps();
            foreach (StepData step in steps) {
                this.addStep(step.StepId, step.PosX, step.PosY);
            }

            this.playerPiece = new Roga2dSprite("Dungeon/piece", new Vector2(32, 32), new Vector2(16, 32), new Rect(0, 0, 64, 64));
            this.playerPiece.LocalPriority = 0.2f;
            this.floor.AddChild(this.playerPiece);
        }
示例#2
0
        // Use this for initialization
        public TopWindow(MapModel mapModel)
        {
            Shader.WarmupAllShaders() ;

            this.mapModel = mapModel;
            this.animationPlayer = new Roga2dAnimationPlayer();
            this.root = new Roga2dNode("Root");
            this.AddChild(this.root);

            // animationPlayer
            this.player = spawnBattler("hose", 40, 30);
            this.root.AddChild(this.player);

            // Stage
            this.stage = new Stage();
            this.stage.LocalPriority = 0.0f;
            this.root.AddChild(stage);

            this.mapModel.StepMoved += this.onStepMoved;
            this.stage.ScrollFinished += this.onScrollFinished;
        }
示例#3
0
 public BottomWindow(MapModel mapModel)
 {
     this.mapModel = mapModel;
     this.setPanel(PanelType.MapNavigation);
 }