2016-02-08 23:45:57 +01:00
|
|
|
.. _doc_richtextlabel_bbcode:
|
2016-02-08 22:07:55 +01:00
|
|
|
|
2016-02-06 01:54:33 +01:00
|
|
|
BBCode RichTextLabel
|
|
|
|
====================
|
|
|
|
|
|
|
|
Introduction
|
|
|
|
------------
|
|
|
|
|
2016-02-08 23:45:57 +01:00
|
|
|
:ref:`class_RichTextLabel` allows to display complex text markup in a control. It
|
2016-02-06 01:54:33 +01:00
|
|
|
has a built-in API for generating the markup, but can also parse a
|
|
|
|
BBCode.
|
|
|
|
|
|
|
|
Setting Up
|
|
|
|
----------
|
|
|
|
|
|
|
|
For RichTextLabel to work properly, it must be set-up. This means
|
|
|
|
loading the intended fonts in the releavant properties:
|
|
|
|
|
|
|
|
.. image:: /img/rtl_setup.png
|
|
|
|
|
|
|
|
Reference
|
|
|
|
---------
|
|
|
|
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| Command | Tag | Description |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **bold** | ``[b]{text}[/b]`` | Makes {text} bold. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **italics** | ``[i]{text}[/i]`` | Makes {text} italics. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **underline** | ``[u]{text}[/u]`` | Makes {text} underline. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **code** | ``[code]{text}[/code]`` | Makes {text} monospace. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **center** | ``[center]{text}[/center]`` | Makes {text} centered. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **right** | ``[right]{text}[/right]`` | Makes {text} right-aligned. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **fill** | ``[fill]{text}[/fill]`` | Makes {text} fill width. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **indent** | ``[indent]{text}[/indent]`` | Incrase indent level of {text}. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **url** | ``[url]{url}[/url]`` | Show as such. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **url (ref)** | ``[url=<url>]{text}[/url]`` | Makes {text} reference . |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **image** | ``[img=<path>][/img]`` | Insert image at resource . |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **font** | ``[font=<path>]{text}[/font]`` | Use custom font at for {text}. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
| **color** | ``[color=<code/name>]{text}[/color]`` | Change {text} color, use # format such as #ff00ff or name. |
|
|
|
|
+-----------------+--------------------------------------------+--------------------------------------------------------------+
|
|
|
|
|
|
|
|
Built-In Color Names
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
|
|
|
List of valid color names for the [color=] tag:
|
|
|
|
|
|
|
|
- aqua
|
|
|
|
- black
|
|
|
|
- blue
|
|
|
|
- fuchsia
|
|
|
|
- gray
|
|
|
|
- green
|
|
|
|
- lime
|
|
|
|
- maroon
|
|
|
|
- navy
|
|
|
|
- purple
|
|
|
|
- red
|
|
|
|
- silver
|
|
|
|
- teal
|
|
|
|
- white
|
|
|
|
- yellow
|
|
|
|
|
|
|
|
|