Module ncine.textnode

The table containing textnode related functions.

Inherits from ncine.drawable_node.

Functions

ncine.textnode.new (parent, font, max_string_length) Constructs a textnode object with a parent scene node, a font, and a maximum text string length.
ncine.textnode.clone (textnode) Constructs a new textnode object as a clone of the specified one.
ncine.textnode.delete (textnode) Destroys a textnode object and releases its memory
ncine.textnode.get_width (textnode) Returns the width of rendered text
ncine.textnode.get_height (textnode) Returns the height of rendered text
ncine.textnode.get_abswidth (textnode) Returns the absolute width of rendered text
ncine.textnode.get_absheight (textnode) Returns the absolute height of rendered text
ncine.textnode.get_font (textnode) Returns the font object used by the textnode
ncine.textnode.set_font (textnode, font) Sets the font object to be used by the textnode
ncine.textnode.get_render_mode (textnode) Returns the render mode used to render this text node
ncine.textnode.set_render_mode (textnode, font_render_mode) Sets the render mode used to render this text node, overriding the font one
ncine.textnode.get_kerning (textnode) Returns true if kerning is enabled for this node rendering
ncine.textnode.set_kerning (textnode, with_kerning) Sets the kerning flag for this node rendering
ncine.textnode.get_alignment (textnode) Returns the horizontal text alignment of multiple lines
ncine.textnode.set_alignment (textnode, text_alignment) Sets the horizontal text alignment of multiple lines
ncine.textnode.get_lineheight (textnode) Returns the text node line height
ncine.textnode.get_abslineheight (textnode) Returns the text node line height multiplied by the absolute vertical scale factor
ncine.textnode.set_lineheight (textnode, line_height) Sets the text node line height
ncine.textnode.get_string (textnode) Returns the string to render
ncine.textnode.set_string (textnode, string) Sets the string to render
ncine.textnode.calculate_boundaries (font, with_kerning, string) Calculates the rectangle boundaries needed to render the provided string with the specified font

Tables

textnodeObj The light user data of a textnode object.
ncine.text_alignment Text alignments (enumeration)


Functions

ncine.textnode.new (parent, font, max_string_length)
Constructs a textnode object with a parent scene node, a font, and a maximum text string length.

Don’t forget to call ncine.textnode.delete when you are done with it!

Parameters:

Returns:

    textnodeObj A new textnode object
ncine.textnode.clone (textnode)
Constructs a new textnode object as a clone of the specified one.

Don’t forget to call ncine.textnode.delete when you are done with it!

Parameters:

  • textnode textnodeObj The textnode object to be cloned

Returns:

    textnodeObj The cloned textnode object
ncine.textnode.delete (textnode)
Destroys a textnode object and releases its memory

Parameters:

  • textnode textnodeObj The textnode object to be destroyed
ncine.textnode.get_width (textnode)
Returns the width of rendered text

Parameters:

Returns:

    number
ncine.textnode.get_height (textnode)
Returns the height of rendered text

Parameters:

Returns:

    number
ncine.textnode.get_abswidth (textnode)
Returns the absolute width of rendered text

Parameters:

Returns:

    number
ncine.textnode.get_absheight (textnode)
Returns the absolute height of rendered text

Parameters:

Returns:

    number
ncine.textnode.get_font (textnode)
Returns the font object used by the textnode

Parameters:

Returns:

    fontObj
ncine.textnode.set_font (textnode, font)
Sets the font object to be used by the textnode

Parameters:

ncine.textnode.get_render_mode (textnode)
Returns the render mode used to render this text node

Parameters:

Returns:

    ncine.font_render_mode
ncine.textnode.set_render_mode (textnode, font_render_mode)
Sets the render mode used to render this text node, overriding the font one

Parameters:

  • textnode textnodeObj
  • font_render_mode ncine.font_render_mode
ncine.textnode.get_kerning (textnode)
Returns true if kerning is enabled for this node rendering

Parameters:

Returns:

    boolean
ncine.textnode.set_kerning (textnode, with_kerning)
Sets the kerning flag for this node rendering

Parameters:

ncine.textnode.get_alignment (textnode)
Returns the horizontal text alignment of multiple lines

Parameters:

Returns:

    ncine.text_alignment
ncine.textnode.set_alignment (textnode, text_alignment)
Sets the horizontal text alignment of multiple lines

Parameters:

  • textnode textnodeObj
  • text_alignment ncine.text_alignment
ncine.textnode.get_lineheight (textnode)
Returns the text node line height

Parameters:

Returns:

    number
ncine.textnode.get_abslineheight (textnode)
Returns the text node line height multiplied by the absolute vertical scale factor

Parameters:

Returns:

    number
ncine.textnode.set_lineheight (textnode, line_height)
Sets the text node line height

Parameters:

ncine.textnode.get_string (textnode)
Returns the string to render

Parameters:

Returns:

    string
ncine.textnode.set_string (textnode, string)
Sets the string to render

Parameters:

ncine.textnode.calculate_boundaries (font, with_kerning, string)
Calculates the rectangle boundaries needed to render the provided string with the specified font

Parameters:

Returns:

    ncine.vec2

Tables

textnodeObj
The light user data of a textnode object.

Inherits from ncine.drawable_node.drawablenodeObj.

ncine.text_alignment
Text alignments (enumeration)

Fields:

  • LEFT
  • CENTER
  • RIGHT
generated by LDoc 1.5.0 Last updated 2024-12-18 15:08:56