Component:ButtonStringErase: Difference between revisions

From Resonite Wiki
m ProbablePrime moved page ButtonStringErase (Component) to Component:ButtonStringErase: Creating component Namespace
This is no longer a stub. Style. Updated descriptions. Added links.
 
(One intermediate revision by one other user not shown)
Line 2: Line 2:
<translate>
<translate>
<!--T:1-->
<!--T:1-->
{{stub}}
{{Infobox Component
{{Infobox Component
|Image=ButtonStringEraseComponent.png
|Image=ButtonStringEraseComponent.png
Line 8: Line 7:
}}
}}


The ButtonStringErase component can be used to remove characters from the beginning or end of a string whenever a button is pressed.
The '''ButtonStringErase''' component can be used to remove characters from the beginning or end of a [[Type:string|string]] whenever an [[Type:IButton|IButton]] is pressed.


<!--T:2-->
<!--T:2-->
== Fields ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|TargetString|IField`1|TypeString0=IField<string>| The string from which characters will be removed.
|TargetString|'''[[Type:IField`1|IField`1]]&lt;[[Type:String|String]]&gt;'''|TypeAdv0=true| The string from which characters will be removed.
|Count|Int| How many characters to remove.
|Count|Int| How many characters to remove.
|EraseFromBeginning|Bool| Whether or not to remove characters from the beginning of the string.
|EraseFromBeginning|Bool| Whether or not to remove characters from the beginning of the string.
Line 20: Line 19:
<!--T:3-->
<!--T:3-->
== Usage ==
== Usage ==
To function, the component simply needs to be attached to a slot that also has a button component attached to it. From then on, pressing that button will activate the ButtonStringErade, making it erase the first or last <code>Count</code> characters from its <code>TargetString</code>.
To function, the component simply needs to be attached to a [[Slot|slot]] that also has a button component attached to it. From then on, pressing that button will activate the '''ButtonStringErase''', making it erase the first or last <code>Count</code> characters from its <code>TargetString</code>.


<!--T:4-->
<!--T:4-->
Line 28: Line 27:
== Related Components ==
== Related Components ==
</translate>
</translate>
[[Category:ComponentStubs]]
[[Category:Components{{#translation:}}|Button String Erase]]
[[Category:Components{{#translation:}}|Button String Erase]]
[[Category:Components:Common UI:Button Interactions{{#translation:}}|Button String Erase]]
[[Category:Components:Common UI:Button Interactions{{#translation:}}|Button String Erase]]

Latest revision as of 00:04, 12 September 2024

Component image 
Button String Erase component as seen in the Scene Inspector


The ButtonStringErase component can be used to remove characters from the beginning or end of a string whenever an IButton is pressed.

Fields

Fields
Name Type Description
persistent Bool Determines whether or not this item will be saved to the server.
UpdateOrder Int Controls the order in which this component is updated.
Enabled Bool Controls whether or not this component is enabled.
TargetString IField`1<String> The string from which characters will be removed.
Count Int How many characters to remove.
EraseFromBeginning Bool Whether or not to remove characters from the beginning of the string.

Usage

To function, the component simply needs to be attached to a slot that also has a button component attached to it. From then on, pressing that button will activate the ButtonStringErase, making it erase the first or last Count characters from its TargetString.

Examples

Related Components