Reference › Function reference › UI

UI.condition_layout.verticalAlignment

dependency

Call as

UI.condition_layout.verticalAlignment(value)

Record the dependency UI.condition_layout.verticalAlignment, then call it by that name. A namespaced call does not pass self: use a colon call or pass the object yourself.

What it does

Converts a table cell's alignV setting to a vertical offset fraction for the condition group's Table layout: 0 for nil, start or top, 0.5 for middle or center, and 1 for end or bottom (case-insensitive prefixes).

Arguments

NameTypeWhat it does
valuestring | nilAlignment name, such as "TOP", "middle" or "bottom".

Returns

1number | nil0, 0.5 or 1, or nil for a non-string or unrecognized value.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

How the addon calls it

Source

UI/condition_layout.lua, line 30. Read only in game; Duplicate makes an editable copy.

UI.condition_layout.verticalAlignment(value)
    if value==nil then return 0 end
    if type(value)~='string' then return nil end
    value=value:lower()
    if value=='start' or value:sub(1,3)=='top' then return 0 end
    if value=='end' or value:sub(1,6)=='bottom' then return 1 end
    if value=='middle' or value:sub(1,6)=='center' then return .5 end

Back to Function reference