Component:TextCountdownClock: Difference between revisions

From Resonite Wiki
Logix -> ProtoFlux
add info
 
Line 3: Line 3:
|Name=Text Countdown Clock
|Name=Text Countdown Clock
}}
}}
{{stub}}
The '''TextCountdownClock''' component is able to make a countdown till a certain value of T (world time) since a session started. This drives a text field to do so.


== Usage ==
== Fields ==
{{Table ComponentFields
{{Table ComponentFields
|CountdownTime|Double|
|CountdownTime|Double| The world time we are counting down to (The world time is zero when a session starts)
|AllowNegative|Bool|
|AllowNegative|Bool| Whether negative time can be displayed after the time for the world has been reached. Or to display 0 if false.
|TextTarget|{{RootFieldType|FieldDrive`1|[[Type:String|String]]}}|TypeAdv2=true|
|TextTarget|{{RootFieldType|FieldDrive`1|[[Type:String|String]]}}|TypeAdv2=true| Text String field to drive with the form of HH:MM:SS based on the value in <code>CountdownTime</code>.
}}
}}


== Behavior ==
== Usage ==
 
This component creates a Text String in the form of HH:MM:SS as a countdown timer based on the difference in the value of T (world time) and the value of CountdownTime.
This component creates a Text String in the form of HH:MM:SS as a countdown timer based on the difference in the value of T and the value of CountdownTime.


== Examples ==
== Examples ==
Line 26: Line 25:
[[Category:Components:Utility{{#translation:}}|Text Countdown Clock]]
[[Category:Components:Utility{{#translation:}}|Text Countdown Clock]]
[[Category:Components{{#translation:}}|Text Countdown Clock]]
[[Category:Components{{#translation:}}|Text Countdown Clock]]
[[Category:ComponentStubs]]

Latest revision as of 17:33, 4 February 2025

Component image 
Text Countdown Clock component as seen in the Scene Inspector

The TextCountdownClock component is able to make a countdown till a certain value of T (world time) since a session started. This drives a text field to do so.

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. Some components stop their functionality when this field is disabled, but some don't.
CountdownTime Double The world time we are counting down to (The world time is zero when a session starts)
AllowNegative Bool Whether negative time can be displayed after the time for the world has been reached. Or to display 0 if false.
TextTarget field drive of String Text String field to drive with the form of HH:MM:SS based on the value in CountdownTime.

Usage

This component creates a Text String in the form of HH:MM:SS as a countdown timer based on the difference in the value of T (world time) and the value of CountdownTime.

Examples

I have a button in my world, that when pressed, uses ProtoFlux to grab T and add 900 to it, then sets that value as countdownTime. Thus I get a timer for 15 minutes.

For example, if T is 1200 and I wanted a 3-minute timer, I would need to set CountdownTime to, 1200 + (3 (min) * 60 (seconds)), 1380. and it would output a string of 3:00. Throw that in a Text Field of a Text Render and then you get a Visible Countdown.

See Also