PLUG'N SCRIPT
rapid plugin development
Tutorial
DSP
KUIML
How-to
Scripts
  • Overview
  • Tutorial
    • Hello world
    • Main skin and subskins
    • Displaying text
    • Changing text on the fly
    • Printing from the DSP
    • Displaying and controlling parameters
    • Params 101
  • Reference
  • Built-in variables
  • Runtime model
  • Parameters mapping
  • Script converter
  • LetiMix
KUIMLTutorialDisplaying text
March 30, 2021

Displaying Text

Let's display some text in our GUI. Here's how you do it:

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <SKIN>
  3. <TEXT value="Hello world!" />
  4. <TEXT value="I'm happy to be here!" />
  5. <TEXT value="This is a nice place!" />
  6. </SKIN>

In these examples, we're saving the code as a .kuiml file with the same base name as our DSP script file. We're using LM Skin, but these examples should also work with the default skin.

You can also place several TEXT elements on a single line, like this:

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <SKIN>
  3. <ROW>
  4. <TEXT value="This" />
  5. <TEXT value=" is " font_escapement="90" v_offset="3" font_size="+4" text_color="#11AA00"/>
  6. <TEXT value="great!" font_weight="bold" text_color="#CC5500" font_face="Lato" font_size="25" v_offset="-2" />
  7. </ROW>
  8. </SKIN>

The TEXT element inherits text and font properties from the CELL (which is a main element for layout), so you can check the CELL documentation to see which text attributes are available.

The ROW element is a shortcut for <CELL layout_type="row">. There are three layout types: column (default), row, and layer_stack (which stacks elements on top of each other like layers). Every CELL element uses one of these modes.

SKIN acts like a CELL element too, so instead of adding ROW in our example, you could simply add layout_type="row" to the SKIN. But let's try an example with layer_stack instead:

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <SKIN layout_type="layer_stack">
  3. <TEXT value="GREAT" font_weight="bold" text_color="#CC5500" font_face="Arial Black" font_size="80" />
  4. <TEXT value="it is" font_size="20" text_color="#FFFFFF" />
  5. </SKIN>

Note About Multiline Text

In older KUIML examples, you might see attributes like "multiline" or "word_break" that were intended to make your text multiline. However, these have been deprecated and no longer work in modern KUIML.

For multiline text, you'll need to use some workarounds, one of the best options is TextWidget.

Changing text on the fly


Comments

Please, authorize to view and post comments.

2020 - 2026 © Site by LetiMix · Donate  |  Plug'n Script and KUIML by Blue Cat Audio