Class TextLayer
Object
|
+--Layer
|
+--TextLayer
- class
TextLayer
- extends Layer
The Text Layer renders letters, words or .txt files using true-type
fonts, it can cycle (blinking) words in a long text.
Defined in FreejScripting.js
Author: Sam Lantinga (SDL_ttf), Jaromil
Constructor Summary |
TextLayer()
The Text Layer constructor is used to create new instances of this layer
|
Method Summary |
Array
|
calculate_size(<string> string)
Calculates the width and height of the layer if a specific string would be rendered,
so you can acknowledge the occupation of the text on screen with current font and size
selected.
|
void
|
color(<int> red, <int> green, <int> blue)
Chooses the color to be used to render the text.
|
Object
|
font(<string> font_file)
Chooses the font to be used when rendering the text.
|
void
|
print(<string> string)
Renders a text string in the layer using the currently configured font and size
|
void
|
size(<int> char_size)
Set the font size of the rendered text, relative to the width of a single char, in pixels.
|
Methods inherited from class Layer |
activate, deactivate, up, down, move, get_name, get_filename, set_blit, get_blit, set_blit_value, get_blit_value, set_position, slide_position, get_x_position, get_y_position, get_width, get_height, add_filter, rem_filter, rotate, zoom, spin, list_filters
|
TextLayer
TextLayer()
The Text Layer constructor is used to create new instances of this layer
Returns:
a new allocated Text Layer
Author: Sam Lantinga (SDL_ttf), Jaromil
calculate_size
Array calculate_size(<string> string)
Calculates the width and height of the layer if a specific string would be rendered,
so you can acknowledge the occupation of the text on screen with current font and size
selected.
Parameters:
string
- text that we would like to measure
Returns:
array containing width[0] and height[1] values in pixel
color
void color(<int> red, <int> green, <int> blue)
Chooses the color to be used to render the text.
The value can be a RGB triplet or a single string in typical HTML format,
i.e: #FFEEDD
Parameters:
red
- red value for the RGB color triplet
green
- green value for the RGB color triplet
blue
- blue value for the RGB color triplet
font
Object font(<string> font_file)
Chooses the font to be used when rendering the text.
Parameters:
font_file
- full path to the True Type (.TTF) font to be used
Returns:
false if font is not found, true otherwise
print
void print(<string> string)
Renders a text string in the layer using the currently configured font and size
Parameters:
string
- text string to be rendered
size
void size(<int> char_size)
Set the font size of the rendered text, relative to the width of a single char, in pixels.
Parameters:
char_size
- size of a char in pixels
FreeJ scripting documentation is Copyleft (C) 2000 - 2007 dyne.org foundation. Verbatim copying and distribution of this entire page is permitted in any medium, provided this notice is preserved.
Send inquiries & questions to dyne.org's hackers.
Documentation generated by
JSDoc on Thu May 29 20:56:52 2008