Table of Contents

COMP_NUMBER_DISPLAY

Category: Component
Mod Dependency: Foundation EBF

Parent class: COMPONENT

Properties


NumberDisplayPrefab


NumberDisplayNodeName


DigitNodeNames


DecimalNodeName


SignNodeName


UnitNodeName


ZeroPrefab


OnePrefab


TwoPrefab


ThreePrefab


FourPrefab


FivePrefab


SixPrefab


SevenPrefab


EightPrefab


NinePrefab


PlusPrefab


MinusPrefab


DecimalPrefab


UnitPrefab

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:

  1. Must have as many or fewer digits as the number of nodes set in DigitNodeNames
  2. 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
  3. Can be positive or negative but the sign will only be displayed if you have included a node for it.