If you wanna add text you can use addPara. As you can also see there are 5 different methods having addPara;
LabelAPI addPara(String str, float pad);
LabelAPI addPara(String str, Color color, float pad);
LabelAPI addPara(String format, float pad, Color hl, String... highlights);
LabelAPI addPara(String format, float pad, Color[] hl, String ... highlights);
LabelAPI addPara(String format, float pad, Color color, Color hl, String ... highlights);
1: We use that to simply add text
2: We use that to add coloured text
3 We use that one to add text, where specific bits of text are highlighted (where %s is) on specific color
4 We use that one to add text, where specific bits of text are highlighted (where %s is) on specific colors
5. We use that one to add text which have different color and on top of where specific bits of text are highlighted (where %s is) on specific color
Here is example usage of :
LabelAPI addPara(String format, float pad, Color hl, String... highlights);
tooltip.addPara("Construction speed bonus: %s",5f,Color.ORANGE,"50%");
tooltip.addPara("Orbital Skunk-work bonus %s",5f, Misc.getPositiveHighlightColor(),"Each built ship have 1 built-in s-mod");
tooltip.addPara("Hypershunt bonus %s",5f, Misc.getPositiveHighlightColor(),"Decrease cost of special project stages by 50%");
Result
Useful things to know about LabelAPI:I think the best way for you to learn all about LabelAPI, would be extensively using it, but as small highlight with LabelAPI you can do things like
Calculating both text height and width ( useful when positioning)
Autosizing text width (For example if we want text to be more compact)
Custom FontsSpoiler
Current version of starsector (0.97 as this is written) has support for adding custom fonts!
All you need is .fnt file of your font you wanna use
String filename = "graphics/fonts/";
ArrayList<Integer>fontSizes = new ArrayList<>();
fontSizes.add(12);
fontSizes.add(15);
fontSizes.add(18);
fontSizes.add(20);
fontSizes.add(24);
fontSizes.add(35);
for (Integer fontSize : fontSizes) {
try {
Global.getSettings().loadFont(filename+"ACES07_Regular_"+fontSize+".fnt");
} catch (IOException e) {
throw new RuntimeException(e);
Before you will use addPara method, for this font to be used you also need to do this tooltip.setParaFont("graphics/fonts/ACES07_Regular_15.fnt");
And result of such changes?