예제 #1
0
        public void newSet()
        {
            var setPage = new TileSetTabPage("New set");

            setPage.Set(0, 0, body.W, body.H);
            Tab.AddPage(setPage);
        }
예제 #2
0
        public void newSet()
        {
            var setPage = new TileSetTabPage(new Vivid.Map.Map(), "New set");

            setPage.Set(0, 0, Body.W, Body.H);
            Tab.AddPage(setPage);
        }
예제 #3
0
        public void LoadState()
        {
            // return;
            if (!File.Exists(GameGlobal.ProjectPath + "tileBrowse.state"))
            {
                return;
            }
            FileStream   fs = new FileStream(GameGlobal.ProjectPath + "tileBrowse.state", FileMode.Open, FileAccess.Read);
            BinaryReader r  = new BinaryReader(fs);

            int tc = r.ReadInt32();

            Tab.Pages.Clear();

            if (tc == 0)
            {
                return;
            }

            for (int i = 0; i < tc; i++)
            {
                string name = r.ReadString();


                var tm = new Map();

                tm.Read(r);

                var ts = new TileSetTabPage(tm, name);


                // ts.TileMap = tm;
                //ts.TileLayer = tm.Layers[0];

                //  ts.TView.Map = tm;
                //ts.TView.
                ts.W = Body.W;
                ts.H = Body.H;

                ts.TView.UpdateGraph();

                ts.Set(0, 0, Body.W, Body.H);
                Tab.AddPage(ts);
            }

            Tab.Shown = Tab.Pages[0];



            r.Close();
            fs.Close();
        }