@@ -127,6 +127,7 @@ public class PlayerIndicatorsOverlay extends Overlay
|
|||||||
OverlayUtil.renderActorTextAndImage(graphics, actor, builtString, color,
|
OverlayUtil.renderActorTextAndImage(graphics, actor, builtString, color,
|
||||||
ImageUtil.resizeImage(Objects.requireNonNull(clanManager
|
ImageUtil.resizeImage(Objects.requireNonNull(clanManager
|
||||||
.getClanImage(clanManager.getRank(actor.getName()))), y, y), 0, ACTOR_HORIZONTAL_TEXT_MARGIN);
|
.getClanImage(clanManager.getRank(actor.getName()))), y, y), 0, ACTOR_HORIZONTAL_TEXT_MARGIN);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -286,14 +286,14 @@ public class OverlayUtil
|
|||||||
|
|
||||||
public static void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
|
public static void renderActorTextAndImage(Graphics2D graphics, Actor actor, String text, Color color, BufferedImage image, int yOffset, int xOffset)
|
||||||
{
|
{
|
||||||
Point textLocation = new Point(actor.getConvexHull().getBounds().x + xOffset,
|
Point textLocation = actor.getCanvasTextLocation(graphics, text, actor.getLogicalHeight() + yOffset);
|
||||||
actor.getConvexHull().getBounds().y + yOffset);
|
|
||||||
|
|
||||||
renderImageLocation(graphics, textLocation, image);
|
if (textLocation != null)
|
||||||
xOffset = image.getWidth() + 1;
|
{
|
||||||
yOffset = (image.getHeight() - (int) graphics.getFontMetrics().getStringBounds(text, graphics).getHeight());
|
renderImageLocation(graphics, textLocation, image);
|
||||||
textLocation = new Point(textLocation.getX() + xOffset, textLocation.getY() + image.getHeight() - yOffset);
|
textLocation = new Point(textLocation.getX() + xOffset , textLocation.getY());
|
||||||
renderTextLocation(graphics, textLocation, text, color);
|
renderTextLocation(graphics, textLocation, text, color);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint, boolean shadows, int yOffset)
|
public static void renderTextLocation(Graphics2D graphics, String txtString, int fontSize, int fontStyle, Color fontColor, Point canvasPoint, boolean shadows, int yOffset)
|
||||||
|
|||||||
Reference in New Issue
Block a user