Exemplo n.º 1
0
        public TilesetEditor()
        {
            InitializeComponent();
            PreviewMap = new TrinityEngine.Map.Map(1);
            PreviewMap.Layers.Add(new TrinityEngine.Map.Layer.MapLayer(8, 32, PreviewMap));
            PreviewMap.TileWidth  = 64;
            PreviewMap.TileHeight = 64;
            //   Tools = new ToolStrip();


            //var addImage = Tools.Items.Add("Add Image");
            // var addFolder = Tools.Items.Add("Add Folder");

            // addImage.Click += AddImage_Click;

            //  Controls.Add(Tools);

            View = new TrinityEditor.Controls.Graphics.GLView();
            splitContainer1.Panel1.Controls.Add(View);
            // Controls.Add(View);
            View.Dock = DockStyle.Fill;

            View.MouseDown += View_MouseDown;
            View.MouseUp   += View_MouseUp;
            View.MouseMove += View_MouseMove;

            View.RenderCall = () =>
            {
                if (!crResources)
                {
                    PreviewMap.CreateResources();
                    crResources = false;
                }
                //TrinityEngine.Draw.IntelliDraw.BeginDraw();
                var mat = OpenTK.Matrix4.Identity;
                PreviewMap.ViewMatrix = mat;
                PreviewMap.Render();


                //Console.WriteLine("Rendering tileset view.");
            };
        }
Exemplo n.º 2
0
        public TileSelector()
        {
            Text = "Tile Selector";

            TileMap = new TrinityEngine.Map.Map(1);
            TileMap.Layers.Add(new TrinityEngine.Map.Layer.MapLayer(8, 32, TileMap));
            TileMap.TileWidth  = 64;
            TileMap.TileHeight = 64;


            View = new TrinityEditor.Controls.Graphics.GLView();
            Controls.Add(View);
            View.Dock = System.Windows.Forms.DockStyle.Fill;

            View.MouseDown += View_MouseDown;
            View.MouseUp   += View_MouseUp;
            View.MouseMove += View_MouseMove;

            View.RenderCall = () =>
            {
                if (!crResources)
                {
                    TileMap.CreateResources();
                    crResources = false;
                }
                //TrinityEngine.Draw.IntelliDraw.BeginDraw();
                var mat = OpenTK.Matrix4.Identity;
                TileMap.ViewMatrix = mat;
                TileMap.Render();


                //Console.WriteLine("Rendering tileset view.");
            };

            RebuildMap();
        }