Esempio n. 1
0
        public static void DrawString(int x, int y, string str, DDFont font, bool tategakiFlag, I3Color color, I3Color edgeColor)
        {
            if (edgeColor.R != -1)
            {
                const int EDGE_WIDTH = 2;
                const int EDGE_STEP  = EDGE_WIDTH;

                for (int xc = -EDGE_WIDTH; xc <= EDGE_WIDTH; xc += EDGE_STEP)
                {
                    for (int yc = -EDGE_WIDTH; yc <= EDGE_WIDTH; yc += EDGE_STEP)
                    {
                        DX.DrawStringToHandle(x + xc, y + yc, str, DDUtils.GetColor(edgeColor), font.GetHandle(), DDUtils.GetColor(new I3Color(0, 0, 0)), tategakiFlag ? 1 : 0);
                    }
                }
            }
            DX.DrawStringToHandle(x, y, str, DDUtils.GetColor(color), font.GetHandle(), DDUtils.GetColor(new I3Color(0, 0, 0)), tategakiFlag ? 1 : 0);
        }
Esempio n. 2
0
        public static DDFont GetFont(string fontName, int fontSize, int fontThick = 6, bool antiAliasing = true, int edgeSize = 0, bool italicFlag = false)
        {
            DDFont font = Fonts.FirstOrDefault(v =>
                                               v.FontName == fontName &&
                                               v.FontSize == fontSize &&
                                               v.FontThick == fontThick &&
                                               v.AntiAliasing == antiAliasing &&
                                               v.EdgeSize == edgeSize &&
                                               v.ItalicFlag == italicFlag
                                               );

            if (font == null)
            {
                font = new DDFont(fontName, fontSize, fontThick, antiAliasing, edgeSize, italicFlag);
            }

            return(font);
        }
Esempio n. 3
0
 public static int GetDrawStringWidth(string str, DDFont font, bool tategakiFlag = false)
 {
     return(DX.GetDrawStringWidthToHandle(str, SCommon.ENCODING_SJIS.GetByteCount(str), font.GetHandle(), tategakiFlag ? 1 : 0));
 }
Esempio n. 4
0
        public static void DrawString_XCenter(int x, int y, string str, DDFont font, bool tategakiFlag, I3Color color, I3Color edgeColor)
        {
            x -= GetDrawStringWidth(str, font, tategakiFlag) / 2;

            DrawString(x, y, str, font, tategakiFlag, color, edgeColor);
        }
Esempio n. 5
0
        public static void DrawString_XCenter(int x, int y, string str, DDFont font, bool tategakiFlag = false)
        {
            x -= GetDrawStringWidth(str, font, tategakiFlag) / 2;

            DrawString(x, y, str, font, tategakiFlag);
        }
Esempio n. 6
0
 public static void DrawString(int x, int y, string str, DDFont font, bool tategakiFlag, I3Color color)
 {
     DrawString(x, y, str, font, tategakiFlag, color, new I3Color(-1, 0, 0));
 }
Esempio n. 7
0
 public static void DrawString(int x, int y, string str, DDFont font, bool tategakiFlag = false)
 {
     DrawString(x, y, str, font, tategakiFlag, new I3Color(255, 255, 255));
 }
Esempio n. 8
0
 public static void Add(DDFont font)
 {
     Fonts.Add(font);
 }
Esempio n. 9
0
 public static void DrawString(int x, int y, string str, DDFont font, bool tategakiFlag, I3Color color, I3Color edgeColor)
 {
     DX.DrawStringToHandle(x, y, str, DDUtils.GetColor(color), font.GetHandle(), DDUtils.GetColor(edgeColor), tategakiFlag ? 1 : 0);
 }