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);
}
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);
}
}
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));
}
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);
}
}
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);
}
Aggregations