use of main.system.text.SmartText in project Eidolons by IDemiurge.
the class PriorityListItem method paint.
@Override
public void paint(Graphics g) {
refresh();
super.paint(g);
for (Point c : specialOverlayingImages.keySet()) {
Image img = specialOverlayingImages.get(c);
g.drawImage(img, c.x, c.y, null);
}
for (Point c : specialOverlayingStrings.keySet()) {
SmartText text = specialOverlayingStrings.get(c);
g.setColor(text.getColor());
g.setFont(text.getFont());
((Graphics2D) g).setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
g.drawString(text.getText(), c.x, c.y);
}
}
use of main.system.text.SmartText in project Eidolons by IDemiurge.
the class PriorityListItem method initClock.
private void initClock() {
String value = "" + unit.getGame().getRules().getTimeRule().getTimeRemaining();
int perc = MathMaster.getFractionValueCentimal(unit.getGame().getRules().getTimeRule().getBaseTime(), unit.getGame().getRules().getTimeRule().getTimeRemaining());
Color color = ColorManager.GOLDEN_WHITE;
// SmartTextManager.getValueCase(perc).getColor();
SmartText text = new SmartText(value, color);
text.setFont(getTimeFont());
int x = MigMaster.getCenteredTextPosition(value, getTimeFont(), GuiManager.getSmallObjSize());
int y = MigMaster.getCenteredTextPositionY(getTimeFont(), GuiManager.getSmallObjSize()) + 5;
p1 = new Point(x, y);
addSpecialOverlayingString(p1, text);
}
use of main.system.text.SmartText in project Eidolons by IDemiurge.
the class AnimationManager method addTextOverlay.
private void addTextOverlay(String amount, Ref ref, int delay, Color c, Point p) {
CellComp comp = getComp(ref.getTargetObj());
SmartText text = new SmartText(amount, c);
text.setFont(FontMaster.getFont(FONT.AVQ, DEFAULT_OVERLAY_FONT_SIZE, Font.PLAIN));
comp.addAnimOverlayingString(p, text);
animate(delay, comp);
}
Aggregations