View Source FLHook.XMLText (FLHook Client v2.1.1)

The XML text module allows composing formatted text to be sent via a chat command.

A full reference can be found here: https://docs.flhook.org/md_docs__usage__x_m_l__text__reference.html

Summary

Functions

Adds an alignment node to the specified XML text struct.

Adds a format node the specified XML text struct. You can specify a color and optional format flags.

Creates a new XML text struct with the specified content.

Adds a paragraph node to the specified XML text struct.

Adds a text node to the specified XML text struct.

Converts the XML text struct to a string.

Types

@type align() :: :left | :center | :right
@type color() ::
  {red :: non_neg_integer(), green :: non_neg_integer(),
   blue :: non_neg_integer()}
  | String.t()
@type flag() ::
  :bold
  | :italic
  | :underline
  | :big
  | :big_wide
  | :very_big
  | :smoothest
  | :smoother
  | :small
@type t() :: %FLHook.XMLText{chardata: IO.chardata()}

Functions

Link to this function

align(xml_text, align)

View Source (since 2.1.0)
@spec align(t(), align()) :: t()

Adds an alignment node to the specified XML text struct.

Link to this function

format(xml_text, color, flags \\ [])

View Source
@spec format(t(), color(), flag() | [flag()]) :: t()

Adds a format node the specified XML text struct. You can specify a color and optional format flags.

@spec new([
  {:align, align()}
  | {:format, color()}
  | {:format, color(), flag() | [flag()]}
  | :paragraph
  | {:text, String.Chars.t()}
  | String.Chars.t()
]) :: t()

Creates a new XML text struct with the specified content.

Link to this function

paragraph(xml_text)

View Source (since 2.1.0)
@spec paragraph(t()) :: t()

Adds a paragraph node to the specified XML text struct.

@spec text(t(), String.Chars.t()) :: t()

Adds a text node to the specified XML text struct.

@spec to_string(t()) :: String.t()

Converts the XML text struct to a string.