SegmentDisplay


Introduction

SegmentDisplay is classic display where each digit is made of segments that turn on and off, forming numbers or letters.

This package contains multiple different type (7, 14 and 16 segment) and style displays that can be embedded to your game objects or UI. Content of the display can be then changed from code during runtime.


How to use


Add

In package folder SegmentDisplay/Prefabs/ there is 2 different prefabs:

Simply drag wanted prefab to your Scene view or Hierarchy window. Display will appear in scene or UI immediately.


Customize

Select just added SegmentDisplay object from hierarchy. Inspector window will show you controls to personalize the display for your needs.

You can choose display type, style, number of digits, digit spacing, colors etc.


Use

Create new script and make sure it is

using Leguar.SegmentDisplay;


You can then change text of display simply by saying:

mySegmentDisplay.SetText("42");

This will cause text "42" to appear on display immediately.


If you need more complex and automated control, you can use SDController class. For example adding scrolling text:

SDController sdController = mySegmentDisplay.GetSDController();
ScrollTextCommand scrollCommand = new ScrollTextCommand("Hello World", ScrollTextCommand.Methods.StartOutsideMoveLeftUntilOut, 3f);
sdController.AddCommand(scrollCommand);

This will scroll text "Hello World" from right to left, 3 characters per second.


If you need more exact control of display you can access single digits of display:

SingleDigit displayDigit = mySegmentDisplay[0];
displayDigit.SetChar('8');

This will set number 8 to leftmost digit of display without changing any other digits.


Full API docs

Inline c# documents are included to all public classes. They are also available online in html format:

Full API documentation


Where to get

Download from Unity Asset Store