Class | Rubygame::TTF |
In: |
lib/rubygame/ttf.rb
lib/rubygame/ttf.rb |
Parent: | Object |
IMPORTANT: this class only exists if SDL_ttf is available! Your code should check "defined?(Rubygame::TTF) != nil" to see if you can use this class, or be prepared to rescue from NameError.
TTF provides an interface to SDL_ttf, allowing TrueType Font files to be loaded and used to render text to Surfaces.
The TTF class must be initialized with the setup method before any TTF objects can be created or used.
Does the heavy lifting for the render methods.
Does the heavy lifting for the render methods.
Return the recommended distance (in pixels) from a point on a line of text to the same point on the line of text below it.
Return the recommended distance (in pixels) from a point on a line of text to the same point on the line of text below it.
Renders a string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
Renders a string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
Renders a Unicode string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
Renders a Unicode string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
Renders a UTF-8 string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
Renders a UTF-8 string to a Surface with the font‘s style and the given color(s).
text: | the text string to render |
smooth: | Use anti-aliasing if true. Enabling this makes the text look much nicer (smooth curves), but is much slower. |
color: | the color to render the text, in the form [r,g,b] |
back: | the color to use as a background for the text. This option can be omitted to have a transparent background. |
The width and height the text would be if it were rendered, without the overhead of actually rendering it.
The width and height the text would be if it were rendered, without the overhead of actually rendering it.
The width and height the Unicode text would be if it were rendered, without the overhead of actually rendering it.
The width and height the Unicode text would be if it were rendered, without the overhead of actually rendering it.
The width and height the UTF-8 encoded text would be if it were rendered, without the overhead of actually rendering it.
The width and height the UTF-8 encoded text would be if it were rendered, without the overhead of actually rendering it.