Esempio n. 1
0
        // set images
        private void SetFontTableImage()
        {
            int[] pixels = null;
            int[] palette = this.palette;
            int   width = 0, height = 0;

            switch (FontType)
            {
            case FontType.Menu:
            case FontType.Description:
            case FontType.Dialogue:
                width  = 128; height = 192;
                pixels = Do.DrawFontTable(font, palette, 128, 192, 16, 12, 8, 16);
                break;

            case FontType.Triangles:
                width   = 112; height = 32;
                pixels  = new int[112 * height];
                palette = fontPalettesDialogue.Palettes[1];
                for (int x = 0; x < 7; x++)     // left-right triangles
                {
                    Do.PixelsToPixels(fontTriangle[x].GetPixels(palette), pixels, 112, x * 32, 0, 8, 16, true);
                }
                for (int x = 0; x < 7; x++)     // up-down triangles
                {
                    Do.PixelsToPixels(fontTriangle[x + 7].GetPixels(palette), pixels, 112, x * 16, 16, 16, 8, true);
                }
                break;
            }
            pictureBoxFontTable.Width  = width;
            pictureBoxFontTable.Height = height;
            fontTableImage             = Do.PixelsToImage(pixels, width, height);
            if (FontType == FontType.Triangles)
            {
                pictureBoxFontTable.BackColor = Color.FromArgb(palette[0]);
            }
            else if (FontType == FontType.BattleMenu)
            {
                pictureBoxFontTable.BackColor = Color.FromArgb(palette[1]);
            }
            else
            {
                pictureBoxFontTable.BackColor = Color.FromArgb(palette[3]);
            }
            pictureBoxFontTable.Invalidate();
        }
Esempio n. 2
0
        // Set images
        private void SetFontTableImage()
        {
            int[] pixels = null;
            int[] palette = this.Palette;
            int   width = 0, height = 0;

            switch (FontType)
            {
            case FontType.Menu:
            case FontType.Description:
            case FontType.Dialogue:
                width  = 128; height = 192;
                pixels = Do.DrawFontTable(Glyphs, palette, 128, 192, 16, 12, 8, 16);
                break;

            case FontType.Triangles:
                width   = 112; height = 32;
                pixels  = new int[112 * height];
                palette = palette_dialogue.Palettes[1];
                for (int x = 0; x < 7; x++)     // left-right triangles
                {
                    Do.PixelsToPixels(font_triangle[x].GetPixels(palette), pixels, 112, x * 32, 0, 8, 16, true);
                }
                for (int x = 0; x < 7; x++)     // up-down triangles
                {
                    Do.PixelsToPixels(font_triangle[x + 7].GetPixels(palette), pixels, 112, x * 16, 16, 16, 8, true);
                }
                break;
            }
            if (toggleFontBorder.Checked)
            {
                if (FontType == FontType.BattleMenu)
                {
                    Do.DrawBorder(pixels, width, palette[1]);
                }
                else if (FontType != FontType.Triangles)
                {
                    Do.DrawBorder(pixels, width, palette[3]);
                }
            }
            picture.Width  = width * zoom;
            picture.Height = height * zoom;
            fontTableImage = Do.PixelsToImage(pixels, width, height);
            picture.Invalidate();
        }