Function TCOD_console_vprintf

Function Documentation

TCOD_Error TCOD_console_vprintf(TCOD_Console *console, int x, int y, const TCOD_color_t *fg, const TCOD_color_t *bg, TCOD_bkgnd_flag_t flag, TCOD_alignment_t alignment, const char *fmt, va_list args)

Print a formatted string using a va_list.

New in version 1.19.

Parameters
  • console – A pointer to a TCOD_Console.

  • x – The starting X position, starting from the left-most tile as zero.

  • y – The starting Y position, starting from the upper-most tile as zero.

  • fg – The foreground color. The printed text is set to this color. If NULL then the foreground will be left unchanged, inheriting the previous value of the tile.

  • bg – The background color. The background tile under the printed text is set to this color. If NULL then the background will be left unchanged.

  • flag – The background blending flag. If unsure then use TCOD_BKGND_SET.

  • alignment – The text justification. This is one of TCOD_alignment_t and is normally TCOD_LEFT.

  • fmt – The format string for a vprintf-like function.

  • args – The arguments for the formatted string.

Returns

TCOD_Error Any problems such as malformed UTF-8 will return a negative error code.