Skip to content

UI.Label

Name Mandatory Description Default Type
⬅️ Input The input of the shard, if any String
Output ➡️ The resulting output of the shard String
Wrap No The text wrapping mode. TextWrap::Extend TextWrapBool
Style No The text style. none {Any}Var({Any})None
Selectable No Whether the text can be selected. true BoolVar(Bool)

Static text.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
GFX.MainWindow(Contents: {
  // Setup
  GFX.DrawQueue = ui-draw-queue
  GFX.UIPass(ui-draw-queue) >> render-steps

  // UI
  UI({
    UI.CentralPanel({
      "Hello Shards!" | UI.Label
    })
  })

  UI.Render(ui-draw-queue)
  GFX.Render(Steps: render-steps)
})

[warning] Context has 2 buffers at release (2 released, 2 kept)
[warning] Context has 5 textures at release (1 released, 5 kept)
 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." = lorem_ipsum

GFX.MainWindow(Width: 480 Height: 360 Contents: {
  // Setup
  GFX.DrawQueue = ui-draw-queue
  GFX.UIPass(ui-draw-queue) >> render-steps

  // UI
  UI({
    UI.CentralPanel({
      UI.Columns([
        {lorem_ipsum | UI.Label(Wrap: true)}
        none
        {lorem_ipsum | UI.Label(Wrap: false)}
      ])
    })
  })

  UI.Render(ui-draw-queue)
  GFX.Render(Steps: render-steps)
})

[warning] Context has 2 buffers at release (2 released, 2 kept)
[warning] Context has 5 textures at release (1 released, 5 kept)
 

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
GFX.MainWindow(Contents: {
  // Setup
  GFX.DrawQueue = ui-draw-queue
  GFX.UIPass(ui-draw-queue) >> render-steps

  // UI
  UI({
    UI.CentralPanel({
      "Hello Shards!" | UI.Label
      "Hello Shards!" | UI.Label(Style: {strikethrough: true})
      "Hello Shards!" | UI.Label(Style: {underline: true})
      "Hello Shards!" | UI.Label(Style: {italics: true})
      "Hello Shards!" | UI.Label(Style: {color: @color(96 96 12)})
      "Hello Shards!" | UI.Label(Style: {color: @color(12 96 96) italics: true})
    })
  })

  UI.Render(ui-draw-queue)
  GFX.Render(Steps: render-steps)
})

[warning] Context has 2 buffers at release (2 released, 2 kept)
[warning] Context has 5 textures at release (1 released, 5 kept)