NuiLabel( json, json, json )

From NWN Lexicon
Jump to navigationJump to search
Note: This article documents Neverwinter Nights: Enhanced Edition new content or changes/updates/fixes to 1.69 functions. These are all listed under the category and patches pages.

Create a label field. Labels are single-line stylable non-editable text fields.


// Create a label field. Labels are single-line stylable non-editable text fields.
json                     // Element
NuiLabel(
  json jValue,           // Bind:String
  json jHAlign,          // Bind:Int:NUI_HALIGN_*
  json jVAlign           // Bind:Int:NUI_VALIGN_*
);

Return

json Element

Parameters

jValue
Text label of field (Can be JsonString or NuiBind)
jHAlign
NUI_HALIGN_*
jVAlign
NUI_VALIGN_*


Description

Create a label field. Labels are single-line stylable non-editable text fields.


Remarks

You can change the font color using NuiStyleForegroundColor

All NUI_Values_Modifiers_Attributes work as would be expect for NuiLabels.

Version

This function was added in 1.85.8193.31 of NWN:EE.


Example

Creates a basic label, with static value:

json jLabelAreaSize = NuiLabel(JsonString("Area Size: "), JsonInt(NUI_HALIGN_CENTER), JsonInt(NUI_VALIGN_TOP));

Or if you want to use a NuiBind

json jLabelAreaSize = NuiLabel(NuiBind("label_areasize"), JsonInt(NUI_HALIGN_CENTER), JsonInt(NUI_VALIGN_TOP));

Bind will be blank "", until you set it [no screen shot, since it's just a blank background]:

After Bind is set with this :

NuiSetBind(oPlayer, nToken, "label_areasize", JsonString("Area Size: HUGE"));


jHAlign and jVAlign control the position/layout of the text inside the NuiLabel. First two examples use Center/Top. Here is Left/Bottom:

json jLabelAreaSize = NuiLabel(NuiBind("label_areasize"), JsonInt(NUI_HALIGN_LEFT), JsonInt(NUI_VALIGN_BOTTOM));

See Also

functions:

NUI Functions