示例#1
0
        public SDL2_GPU.GPU_Rect drawColumn(SDL2_GPU.GPU_Target_PTR dest, float x, float y, UInt16 width, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(x, y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawColumn(font, dest, x, y, width, formatted_text, __arglist()));
        }
示例#2
0
        public SDL2_GPU.GPU_Rect drawBox(SDL2_GPU.GPU_Target_PTR dest, ref SDL2_GPU.GPU_Rect box, AlignEnum align, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(box.x, box.y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawBoxAlign(font, dest, box, translate_enum_NFont_to_FC(align), formatted_text, __arglist()));
        }
示例#3
0
        public SDL2_GPU.GPU_Rect draw(SDL2_GPU.GPU_Target_PTR dest, float x, float y, ref SDL.SDL_Color color, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(x, y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawColor(font, dest, x, y, color, formatted_text, __arglist()));
        }
示例#4
0
        public SDL2_GPU.GPU_Rect drawBox(SDL2_GPU.GPU_Target_PTR dest, ref SDL2_GPU.GPU_Rect box, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(box.x, box.y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawBox(font, dest, box, formatted_text, __arglist()));
        }
示例#5
0
        public SDL2_GPU.GPU_Rect getCharacterOffset(UInt16 position_index, int column_width, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(0, 0, 0, 0));
            }

            return(SDL_FontCache.FC_GetCharacterOffset(font, position_index, column_width, formatted_text, __arglist()));
        }
示例#6
0
        public SDL2_GPU.GPU_Rect draw(SDL2_GPU.GPU_Target_PTR dest, float x, float y, ref Scale scale, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(x, y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawScale(font, dest, x, y, SDL_FontCache.FC_MakeScale(scale.x, scale.y), formatted_text, __arglist()));
        }
示例#7
0
        public UInt16 getColumnHeight(UInt16 width, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(0);
            }

            return(SDL_FontCache.FC_GetColumnHeight(font, width, formatted_text, __arglist()));
        }
示例#8
0
        public int getDescent(string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL_FontCache.FC_GetDescent(font, null, __arglist()));
            }

            return(SDL_FontCache.FC_GetDescent(font, formatted_text, __arglist()));
        }
示例#9
0
        public UInt16 getWidth(string formatted_text)
        {
            if (formatted_text == null)
            {
                return(0);
            }

            return(SDL_FontCache.FC_GetWidth(font, formatted_text, __arglist()));
        }
示例#10
0
        public SDL2_GPU.GPU_Rect drawColumn(SDL2_GPU.GPU_Target_PTR dest, float x, float y, UInt16 width, AlignEnum align, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(x, y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawColumnAlign(font, dest, x, y, width, translate_enum_NFont_to_FC(align), formatted_text, __arglist()));
        }
示例#11
0
        public bool load(IntPtr ttf, SDL.SDL_Color color)
        {
            if (ttf == null)
            {
                return(false);
            }

            SDL_FontCache.FC_ClearFont(font);
            return(SDL_FontCache.FC_LoadFontFromTTF(font, ttf, color) != 0);
        }
示例#12
0
        public SDL2_GPU.GPU_Rect drawBox(SDL2_GPU.GPU_Target_PTR dest, ref SDL2_GPU.GPU_Rect box, ref Effect effect, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(box.x, box.y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawBoxEffect(font, dest, box,
                                                  SDL_FontCache.FC_MakeEffect(
                                                      translate_enum_NFont_to_FC(effect.alignment),
                                                      SDL_FontCache.FC_MakeScale(effect.scale.x, effect.scale.y),
                                                      effect.color),
                                                  formatted_text, __arglist()));
        }
示例#13
0
        public SDL2_GPU.GPU_Rect drawColumn(SDL2_GPU.GPU_Target_PTR dest, float x, float y, UInt16 width, ref Effect effect, string formatted_text)
        {
            if (formatted_text == null)
            {
                return(SDL2_GPU.GPU_MakeRect(x, y, 0, 0));
            }

            return(SDL_FontCache.FC_DrawColumnEffect(font, dest, x, y, width,
                                                     SDL_FontCache.FC_MakeEffect(
                                                         translate_enum_NFont_to_FC(effect.alignment),
                                                         SDL_FontCache.FC_MakeScale(effect.scale.x, effect.scale.y),
                                                         effect.color),
                                                     formatted_text, __arglist()));
        }
示例#14
0
 public SDL.SDL_Color getDefaultColor()
 {
     return(SDL_FontCache.FC_GetDefaultColor(font));
 }
示例#15
0
 public bool load(IntPtr ttf)
 {
     return(load(ttf, SDL_FontCache.FC_GetDefaultColor(font)));
 }
示例#16
0
 public UInt16 getMaxWidth()
 {
     return(SDL_FontCache.FC_GetMaxWidth(font));
 }
示例#17
0
 public int getDescent()
 {
     return(SDL_FontCache.FC_GetDescent(font, null, __arglist()));
 }
示例#18
0
 public int getDescent(char character)
 {
     return(SDL_FontCache.FC_GetDescent(font, "%c", __arglist(character)));
 }
示例#19
0
 public int getLineSpacing()
 {
     return(SDL_FontCache.FC_GetLineSpacing(font));
 }
示例#20
0
 public int getBaseline()
 {
     return(SDL_FontCache.FC_GetBaseline(font));
 }
示例#21
0
 public bool load(string filename_ttf, UInt32 pointSize, SDL.SDL_Color color, int style = SDL_ttf.TTF_STYLE_NORMAL)
 {
     SDL_FontCache.FC_ClearFont(font);
     return(SDL_FontCache.FC_LoadFont(font, filename_ttf, (int)pointSize, color, style) != 0);
 }
示例#22
0
 public void free()
 {
     SDL_FontCache.FC_ClearFont(font);
 }
示例#23
0
 // Setters
 public void setSpacing(int LetterSpacing)
 {
     SDL_FontCache.FC_SetSpacing(font, LetterSpacing);
 }
示例#24
0
 // Loading
 public void setLoadingString(string str)
 {
     SDL_FontCache.FC_SetLoadingString(font, str);
 }
示例#25
0
 public void setDefaultColor(ref SDL.SDL_Color color)
 {
     SDL_FontCache.FC_SetDefaultColor(font, color);
 }
示例#26
0
 public void setLineSpacing(int LineSpacing)
 {
     SDL_FontCache.FC_SetLineSpacing(font, LineSpacing);
 }
示例#27
0
        // Getters
//		public GPU_Image_PTR getImage();
//		public IntPtr getSurface();

        public UInt16 getHeight()
        {
            return(SDL_FontCache.FC_GetLineHeight(font));
        }
示例#28
0
 private void init()          // Common constructor
 {
     font = SDL_FontCache.FC_CreateFont();
 }
示例#29
0
 public NFont(IntPtr ttf)
 {
     init();
     load(ttf, SDL_FontCache.FC_GetDefaultColor(font));
 }