Ignition / ScrollBox Scripting
is a UI component.
The ScrollBox supports text, url links and images and it has its own scripting language. It also has a mini ‘filesystem’ so the assets can be easily loaded. A scrollbox can be used to display information about your game / app or display instructions etc.
To add ScrollBox to your scene simple select: GameObject > UI > Playniax > Ignition > ScrollBox
in the Unity Menu.
This will create a ScrollBox and 3 files in the same folder as your scene. These 3 files are: 'script.txt', 'prologue.txt' and 'how to play.txt'.
'script.txt' is the actual script used by the ScrollBox and the other scripts are called by the script as data.
Keep in mind that this is an example for your convenience.
The ScrollBox has its own scripting language and a script may look something like this:
text=HOW TO PLAY
textAsset=how to play
textAligning determines if the text is positioned in the middle, left of right side of the scrollbox:
imageAligning determines if the image is positioned in the middle, left of right side of the scrollbox:
When verticalSpacing is set to true the scrollbox will add space automatically between each object based on the objects height:
With lineSpacing you can set the extra space between each line:
With imageRowSpacing the scrollbox will add space automatically between each image:
With scale you can set the render scale:
With font you can set the font style:
With fontSize you can set the size of the font:
With color you can set the color:
With text you can set a line of text ( can be used to force a line break):
text=Keep mining is a fun gamebla bla blablabla bla
With textAsset you can load a text file that will be added to the scrollbox (don’t forget to add the text file to the AssetBank):
textAsset=Keep Mining How To Play
To create extra space you can increase the y variable (for example 32 pixels):
It’s also possible to set ‘hard’ coordinates:
You can also set and save settings (index can be 0 to 15 so you can store 16 settings):
And load settings:
The inspector view:
ScrollBox uses AssetBank
to load assets like fonts, images, etc.
In order for assets to load they need to be added to the AssetBank.