====== COMP_NUMBER_DISPLAY ====== **Category**: Component\\ **Mod Dependency**: [[https://foundation.mod.io/foundation-ebf|Foundation EBF]] Parent class: [[api:component|COMPONENT]] ===== Properties ===== ---- ==== NumberDisplayPrefab ==== * **Type**: ''[[api:prefab|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'' * **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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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**: ''[[api:prefab|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 [[communityapi/ebf/building_function_number_display|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 the ''NumberDisplayPrefab'' - Can be positive or negative but the sign will only be displayed if you have included a node for it.