The '''QuantityTextEditorParser''' component takes in a <code>ParsedValue</code> and if there is a [[Component:TextEditor|TextEditor]] on the same [[Slot|slot]], it will send the value through the text editor and into either a [[Component:Text|Text]] or a [[Component:TextRenderer|TextRenderer]] component.
{{Table ComponentFields
{{Table ComponentFields
|ParseContinuously|Bool|
|ParseContinuously|Bool| If true, makes the value always update and parse. If false, it only updates when submitted.
|UpdateStringFromValue|Bool|
|UpdateStringFromValue|Bool| If true, will update the string value from this parsed value.
|ParsedValue|Double|
|ParsedValue|Double| The value that was read from the text field.
|MinValue|Double|
|MinValue|Double| The minimum value that can be read.
|MaxValue|Double|
|MaxValue|Double| The maximum value that can be read.
|IgnoreOutOfRange|Bool|
|IgnoreOutOfRange|Bool| Ignores any value that is out of range from the min and max.
|DefaultUnit|String|
|DefaultUnit|String| Changes the default unit to show in the text (especially if the <code>FormatUnit</code> is incorrect).
|CompoundFormatUnits|{{RootFieldType|SyncFieldList`1|[[Type:String|String]]}}|TypeAdv9=true| Compounds units together (example: feet and inches for height).
|CompoundUseLongNames|Bool|
|CompoundUseLongNames|Bool| Use the long version of names.
|CompoundOverrideNames|Bool|
|CompoundOverrideNames|Bool| Overrides the names.
|CompoundDiscardLastFraction|Bool|
|CompoundDiscardLastFraction|Bool| Discards the last fraction.
|CompoundSeparator|String|
|CompoundSeparator|String| Separates the compound units.
|CompoundZeroHandling|CompoundZeroHandling|
|CompoundZeroHandling|CompoundZeroHandling| Handles zeros for units.
}}
}}
== Behavior ==
== Usage ==
Place on the same [[Slot]] as a [[Component:TextEditor|TextEditor]] and anything entered into the text editor will be attempted to be parsed as a [[Quantity Types|quantity]] and output via the <code>ParsedValue</code> field.
== Examples ==
== Examples ==
Line 33:
Line 34:
[[Category:Components{{#translation:}}|Quantity Text Editor Parser`1]]
[[Category:Components{{#translation:}}|Quantity Text Editor Parser`1]]
[[Category:Generic Components{{#translation:}}|Quantity Text Editor Parser`1]]
[[Category:Generic Components{{#translation:}}|Quantity Text Editor Parser`1]]
[[Category:ComponentStubs]]
Revision as of 23:50, 12 September 2024
Component image
Quantity Text Editor Parser`1 component as seen in the Scene Inspector
The QuantityTextEditorParser component takes in a ParsedValue and if there is a TextEditor on the same slot, it will send the value through the text editor and into either a Text or a TextRenderer component.
Place on the same Slot as a TextEditor and anything entered into the text editor will be attempted to be parsed as a quantity and output via the ParsedValue field.