Search in sources :

Example 6 with SmartText

use of main.system.text.SmartText in project Eidolons by IDemiurge.

the class DrawMaster method drawParamInfo.

private void drawParamInfo(Graphics g, Obj obj, PARAMETER p) {
    if (obj.isFull(p)) {
        return;
    }
    PARAMETER c_p = ContentManager.getCurrentParam(p);
    VALUE_CASES CASE = SmartTextManager.getParamCase(c_p, obj);
    String string = obj.getIntParam(c_p) + "/" + obj.getIntParam(p);
    SmartText text = new SmartText(string, CASE.getColor());
    Point c = DrawHelper.getPointForDisplayedParameter(p, text, compSize);
    drawText(g, text, c);
}
Also used : VALUE_CASES(main.swing.renderers.SmartTextManager.VALUE_CASES) SmartText(main.system.text.SmartText) PARAMETER(main.content.values.parameters.PARAMETER)

Example 7 with SmartText

use of main.system.text.SmartText in project Eidolons by IDemiurge.

the class DrawMaster method drawAnimations.

private void drawAnimations(CellComp cellComp, Graphics g) {
    for (Image img : cellComp.getAnimOverlayingImages().keySet()) {
        Point p = cellComp.getAnimOverlayingImages().get(img);
        g.drawImage(img, p.x, p.y, null);
    // main.system.auxiliary.LogMaster.log(1, cellComp +
    // "'s custom animation drawn at " + portrait);
    }
    Image centerOverlayingImage = cellComp.getCenterOverlayingImage();
    if (centerOverlayingImage != null) {
        int x = (getCompWidth() - centerOverlayingImage.getWidth(null)) / 2;
        int y = (getCompHeight() - centerOverlayingImage.getHeight(null)) / 2;
        drawImage(g, centerOverlayingImage, x, y);
    // main.system.auxiliary.LogMaster.log(1, cellComp +
    // "'s center animation drawn at "
    // + new Point(x, y));
    }
    for (SmartText text : cellComp.getAnimOverlayingStrings().keySet()) {
        Point p = cellComp.getAnimOverlayingStrings().get(text);
        g.setColor(text.getColor());
        g.setFont(text.getFont());
        g.drawString(text.getText(), p.x, p.y);
    }
}
Also used : SmartText(main.system.text.SmartText) BufferedImage(java.awt.image.BufferedImage)

Example 8 with SmartText

use of main.system.text.SmartText in project Eidolons by IDemiurge.

the class DrawMaster method drawHeight.

private void drawHeight(Unit obj, Graphics g) {
    if (isEditorMode()) {
        return;
    }
    if (!obj.getGame().isDebugMode()) {
        return;
    }
    // if (obj.isDetected())
    Float f = new Float(obj.getIntParam(PARAMS.HEIGHT)) / 30;
    float quotient = f % 0.1f;
    if (quotient < 0.1) {
        if (!StringMaster.isInteger("" + f)) {
            f = f - quotient;
        }
    }
    String str = f + " ft.";
    int fontSize = 8 + 10 * zoom / 100;
    g.setFont(FontMaster.getFont(FONT.NYALA, fontSize, Font.ITALIC));
    drawText(g, new SmartText(str, ColorManager.GOLDEN_WHITE), new Point(fontSize, fontSize));
}
Also used : SmartText(main.system.text.SmartText)

Example 9 with SmartText

use of main.system.text.SmartText in project Eidolons by IDemiurge.

the class DrawMaster method drawCI.

private void drawCI(DC_Obj obj, Graphics g) {
    // TODO LIGHT SPELLS SHOULD ADD "LIGHT_EMIT" PARAM AND SHADOW REDUCE IT
    if (obj == null) // "null obj"
    {
        return;
    }
    SmartText text = new SmartText(obj.getIntParam(PARAMS.LIGHT_EMISSION) + "", ColorManager.GOLDEN_WHITE);
    int w = text.getWidth();
    int h = text.getHeight();
    // text.setFont(font)
    Point p = new Point(getObjCompWidth() - w, h);
    drawText(g, text, p);
    text = new SmartText(obj.getIntParam(PARAMS.CONCEALMENT) + "", ColorManager.LILAC);
    w = text.getWidth();
    p = new Point(getObjCompWidth() - w, p.y + h);
    drawText(g, text, p);
    // silver
    text = new SmartText(obj.getIntParam(PARAMS.ILLUMINATION) + "", ColorManager.WHITE);
    w = text.getWidth();
    p = new Point(getObjCompWidth() - w, p.y + h);
    drawText(g, text, p);
    // silver
    text = new SmartText(obj.getGamma() + "", ColorManager.ORANGE);
    w = text.getWidth();
    p = new Point(w, getCompHeight() - h * 2);
    drawText(g, text, p);
    // if (obj instanceof DC_Cell)
    if (!FULL_GRAPHICS_TEST_MODE) {
        return;
    }
    if (GRAPHICS_TEST_MODE) {
        g.setFont(FontMaster.getDefaultFont(15));
        g.drawString(obj.getVisibilityLevel().toString(), 25, 15);
        g.drawString(obj.getActivePlayerVisionStatus().toString(), 26, 27);
    }
}
Also used : SmartText(main.system.text.SmartText)

Example 10 with SmartText

use of main.system.text.SmartText in project Eidolons by IDemiurge.

the class DrawMaster method drawActiveIcons.

private void drawActiveIcons(Graphics g, Obj obj) {
    // DrawHelper.AP_ICON_SIZE * objSize
    int size = 28;
    Image image = ImageManager.getSizedVersion(STD_IMAGES.ACTIONS.getPath(), size).getImage();
    // if (isMultiObj())
    // size = size * getMultiObjSizeMod() / 100; // image itself will be
    // sized along with the
    // rest
    // DrawHelper.AP_ICON_X *
    int x = getCompWidth() - size;
    // DrawHelper.AP_ICON_Y *
    int y = getCompHeight() - size;
    Point p = new Point(x, y);
    g.drawImage(image, p.x, p.y, null);
    PARAMETER c_p = ContentManager.getCurrentParam(PARAMS.N_OF_ACTIONS);
    VALUE_CASES CASE = SmartTextManager.getParamCase(c_p, obj);
    String string = obj.getParam(c_p);
    SmartText text = new SmartText(string, CASE.getColor());
    int width = getCompWidth();
    int height = getCompHeight();
    Point c = new Point(width - FontMaster.getStringWidth(text.getFont(), text.getText()), height - FontMaster.getFontHeight(text.getFont()) / 2);
    drawText(g, text, c);
    // TODO after sizing down stacked objects, this becomes invalid!!!
    Rectangle rect = new Rectangle(x, y, size, size);
    cellComp.getMouseMap().put(rect, INTERACTIVE_ELEMENT.AP);
}
Also used : VALUE_CASES(main.swing.renderers.SmartTextManager.VALUE_CASES) SmartText(main.system.text.SmartText) BufferedImage(java.awt.image.BufferedImage) PARAMETER(main.content.values.parameters.PARAMETER)

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