TextServiceUtils
Functions
getSizeForLabel
Gets the size for the label using legacy API surface.
warning
This will not handle new font faces well.
promiseTextBounds
Promises the text bounds for the given parameters
observeSizeForLabelProps
TextServiceUtils.
observeSizeForLabelProps
(
props:
table
) →
Observable
<
Vector2
>
--
The text bounds reported
Observes the current size for the current props. The properties can be anything Blend would accept as an input. If FontFace is defined, it will be used before Font. The following properties are available:
Text
- stringTextSize
- numberFont
- Enum.FontFontFace
FontMaxSize
- Vector2LineHeight
- number
local stringValue = Instance.new("StringValue")
stringValue.Text = "Hello"
local observe = TextServiceUtils.observeSizeForLabelProps({
Text = stringValue;
Font = Enum.Font.;
MaxSize = Vector2.new(250, 100);
TextSize = 24;
})
-- Be sure to clean up the subscription
observe:Subscribe(function(size)
print(size)
end)