communityapi:ebf:comp_number_display
Table of Contents
COMP_NUMBER_DISPLAY
Category: Component
Mod Dependency: Foundation EBF
Parent class: COMPONENT
Properties
NumberDisplayPrefab
- Type:
PREFAB
- Default value:
nil
NumberDisplayNodeName
- Type:
string
- Default value:
Node.NumberDisplay
- The name of the locator node for the display to be attached on
DigitNodeNames
- Type:
list<string>
- Default value:
{ “Node.Thousand”, “Node.Hundred”, “Node.Ten”, “Node.One”, “Node.Decimal” }
- The names of the nodes where the numbers will be shown
DecimalNodeName
- Type:
string
- Default value:
Node.DecimalPoint
- The name of the node where the decimal point will be shown
SignNodeName
- Type:
string
- Default value:
Node.Sign
- The name of the node where the +/- sign will be shown
UnitNodeName
- Type:
string
- Default value:
Node.Unit
- The name of the node where the unit will be shown
ZeroPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 0 number. PREFAB_ZERO_DEFAULT is supplied with the Foundation EBF
OnePrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 1 number. PREFAB_ONE_DEFAULT is supplied with the Foundation EBF
TwoPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 2 number. PREFAB_TWO_DEFAULT is supplied with the Foundation EBF
ThreePrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 3 number. PREFAB_THREE_DEFAULT is supplied with the Foundation EBF
FourPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 4 number. PREFAB_FOUR_DEFAULT is supplied with the Foundation EBF
FivePrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 5 number. PREFAB_FIVE_DEFAULT is supplied with the Foundation EBF
SixPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 6 number. PREFAB_SIX_DEFAULT is supplied with the Foundation EBF
SevenPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 7 number. PREFAB_SEVEN_DEFAULT is supplied with the Foundation EBF
EightPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 8 number. PREFAB_EIGHT_DEFAULT is supplied with the Foundation EBF
NinePrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the 9 number. PREFAB_NINE_DEFAULT is supplied with the Foundation EBF
PlusPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the + sign. PREFAB_PLUS_DEFAULT is supplied with the Foundation EBF
MinusPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the - sign. PREFAB_MINUS_DEFAULT is supplied with the Foundation EBF
DecimalPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the decimal dot. PREFAB_DECIMAL_DEFAULT is supplied with the Foundation EBF
UnitPrefab
- Type:
PREFAB
- Expected:
asset ID
- Default value:
nil
- The Prefab to be used as the unit. PREFAB_UNIT_DEFAULT is supplied with the Foundation EBF
Functions
initDisplay
void initDisplay()
Initialises the number display.
In case you did not use the BUILDING_FUNCTION_NUMBER_DISPLAY this method must be called before a value can be set, you have to call this method in the init()
method of your custom component that will be setting the display values.
An Example of how this is done can be found in the Ruler mod, in case of problems contact me on discord!
setValue
void setValue(value)
Name | Type | Description |
---|---|---|
value | integer | The value to display |
Sets the value on the display. The value:
- Must have as many or fewer digits as the number of nodes set in
DigitNodeNames
- Must be input as an integer value, i.e. to display 123.45 you need to use
:setValue(12345)
and have positioned the decimal point node accordingly in theNumberDisplayPrefab
- Can be positive or negative but the sign will only be displayed if you have included a node for it.
communityapi/ebf/comp_number_display.txt · Last modified: 2021/11/08 15:57 by minotorious