コード例 #1
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        public UInt16 getWidth(string formatted_text)
        {
            if (formatted_text == null)
            {
                return(0);
            }

            return(SDL_FontCache.FC_GetWidth(font, formatted_text, __arglist()));
        }
コード例 #10
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public SDL.SDL_Color getDefaultColor()
 {
     return(SDL_FontCache.FC_GetDefaultColor(font));
 }
コード例 #15
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public bool load(IntPtr ttf)
 {
     return(load(ttf, SDL_FontCache.FC_GetDefaultColor(font)));
 }
コード例 #16
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public UInt16 getMaxWidth()
 {
     return(SDL_FontCache.FC_GetMaxWidth(font));
 }
コード例 #17
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public int getDescent()
 {
     return(SDL_FontCache.FC_GetDescent(font, null, __arglist()));
 }
コード例 #18
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public int getDescent(char character)
 {
     return(SDL_FontCache.FC_GetDescent(font, "%c", __arglist(character)));
 }
コード例 #19
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public int getLineSpacing()
 {
     return(SDL_FontCache.FC_GetLineSpacing(font));
 }
コード例 #20
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public int getBaseline()
 {
     return(SDL_FontCache.FC_GetBaseline(font));
 }
コード例 #21
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 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
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public void free()
 {
     SDL_FontCache.FC_ClearFont(font);
 }
コード例 #23
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 // Setters
 public void setSpacing(int LetterSpacing)
 {
     SDL_FontCache.FC_SetSpacing(font, LetterSpacing);
 }
コード例 #24
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 // Loading
 public void setLoadingString(string str)
 {
     SDL_FontCache.FC_SetLoadingString(font, str);
 }
コード例 #25
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public void setDefaultColor(ref SDL.SDL_Color color)
 {
     SDL_FontCache.FC_SetDefaultColor(font, color);
 }
コード例 #26
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public void setLineSpacing(int LineSpacing)
 {
     SDL_FontCache.FC_SetLineSpacing(font, LineSpacing);
 }
コード例 #27
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
        // Getters
//		public GPU_Image_PTR getImage();
//		public IntPtr getSurface();

        public UInt16 getHeight()
        {
            return(SDL_FontCache.FC_GetLineHeight(font));
        }
コード例 #28
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 private void init()          // Common constructor
 {
     font = SDL_FontCache.FC_CreateFont();
 }
コード例 #29
0
ファイル: NFont.cs プロジェクト: masonwheeler/SDL2-CS
 public NFont(IntPtr ttf)
 {
     init();
     load(ttf, SDL_FontCache.FC_GetDefaultColor(font));
 }