示例#1
0
        private void tilesetPicturebox_Paint(object sender, PaintEventArgs e)
        {
            Map16 map = overworldDisplay.selectedMap;



            if (map != null)
            {
                //musicUpDown.Value = jsonData.mapdata[map.index].m
                Bitmap tilesgfx = new Bitmap(128, 8192, 128, PixelFormat.Format8bppIndexed, allgfx16Ptr);
                tilesgfx.Palette = map.GetPalette();
                map.UpdateGfx(jsonData.allgfx8array, allgfx16Ptr, jsonData.tilesetBitmaps);
                e.Graphics.DrawImage(tilesgfx, new Rectangle(0, 0, 128, 8192), 0, 0, 128, 8192, GraphicsUnit.Pixel);
                //e.Graphics.DrawImage(tilesgfx, new Rectangle(128, 0, 128, 3760), 0, 3760, 128, 3760, GraphicsUnit.Pixel);
            }

            int y = (overworldDisplay.selectedTile / 8);
            int x = overworldDisplay.selectedTile - (y * 8);

            e.Graphics.DrawRectangle(Pens.LightGreen, new Rectangle(x * 16, y * 16, 16, 16));



            //overworldDisplay.
        }
示例#2
0
 public void UpdateGfx(IntPtr allgfx8array, Map16 map)
 {
     map.UpdateGfx(allgfx8array, allgfx16Ptr, allbitmaps);
 }