Search in sources :

Example 11 with SmartText

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);
    }
}
Also used : SmartText(main.system.text.SmartText)

Example 12 with SmartText

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);
}
Also used : SmartText(main.system.text.SmartText)

Example 13 with SmartText

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);
}
Also used : CellComp(eidolons.swing.components.obj.CellComp) SmartText(main.system.text.SmartText)

Aggregations

SmartText (main.system.text.SmartText)13 BufferedImage (java.awt.image.BufferedImage)3 VALUE_CASES (main.swing.renderers.SmartTextManager.VALUE_CASES)3 PARAMETER (main.content.values.parameters.PARAMETER)2 SkillPointCondition (eidolons.ability.conditions.req.SkillPointCondition)1 CellComp (eidolons.swing.components.obj.CellComp)1 Requirements (main.elements.conditions.Requirements)1 Ref (main.entity.Ref)1 ObjType (main.entity.type.ObjType)1 Formula (main.system.math.Formula)1