Fix Song Title display.

r3cp3ct-Japanese-sticker-triggers
sigonasr2 6 years ago
parent 3f67b7973b
commit ecc303f0cd
  1. BIN
      sigIRCv2.jar
  2. 3
      src/sig/modules/BandoriModule.java
  3. 52
      src/sig/utils/DrawUtils.java

Binary file not shown.

@ -263,10 +263,11 @@ public class BandoriModule extends Module{
g.drawImage(s.scheme.base, (int)(s.randX+position.getX()), (int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107, g.drawImage(s.scheme.base, (int)(s.randX+position.getX()), (int)position.getY()+24, (int)(s.randX+130+position.getX()), (int)position.getY()+24+107,
s.scheme.stamp_index%6*270+4, s.scheme.stamp_index/6*223+3, s.scheme.stamp_index%6*270+260+4, s.scheme.stamp_index/6*223+214+3, sigIRC.panel); s.scheme.stamp_index%6*270+4, s.scheme.stamp_index/6*223+3, s.scheme.stamp_index%6*270+260+4, s.scheme.stamp_index/6*223+214+3, sigIRC.panel);
} }
Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()); Point2D basepos = new Point2D(this.getPosition().getX(),this.getPosition().getHeight()+this.getPosition().getY()+24);
double successChance = 1; double successChance = 1;
DecimalFormat df = new DecimalFormat("0"); DecimalFormat df = new DecimalFormat("0");
DecimalFormat df2 = new DecimalFormat("0.0"); DecimalFormat df2 = new DecimalFormat("0.0");
DrawUtils.drawOutlineText(g, sigIRC.panel.programFont, basepos.getX(), basepos.getY()-24, 2, Color.WHITE, Color.BLACK, songtitle);
for (int i=0;i<parts.size();i++) { for (int i=0;i<parts.size();i++) {
SongPart s = parts.get(i); SongPart s = parts.get(i);
if (s.getTotal()!=0) { if (s.getTotal()!=0) {

@ -27,31 +27,33 @@ public class DrawUtils {
drawOutlineText(g,font,x,y,0,0,font_thickness,outline_thickness,text_color,shadow_color,message); drawOutlineText(g,font,x,y,0,0,font_thickness,outline_thickness,text_color,shadow_color,message);
} }
static void drawOutlineText(Graphics g, Font font, double x, double y, double xoffset, double yoffset, int font_thickness, int outline_thickness, Color text_color, Color shadow_color, String message) { static void drawOutlineText(Graphics g, Font font, double x, double y, double xoffset, double yoffset, int font_thickness, int outline_thickness, Color text_color, Color shadow_color, String message) {
AttributedString as = new AttributedString(message); if (message.length()>0) {
as.addAttribute(TextAttribute.FONT, font); AttributedString as = new AttributedString(message);
g.setColor(shadow_color); as.addAttribute(TextAttribute.FONT, font);
Graphics2D g2 = (Graphics2D) g; g.setColor(shadow_color);
FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext(); Graphics2D g2 = (Graphics2D) g;
GlyphVector gv = font.createGlyphVector(frc, message); FontRenderContext frc = g2.getFontMetrics(font).getFontRenderContext();
Shape shape = gv.getOutline((int)(x+xoffset),(int)(y+yoffset)); GlyphVector gv = font.createGlyphVector(frc, message);
g2.setClip(null); Shape shape = gv.getOutline((int)(x+xoffset),(int)(y+yoffset));
g2.setStroke(new BasicStroke(font_thickness + outline_thickness*2)); g2.setClip(null);
g2.setColor(shadow_color); g2.setStroke(new BasicStroke(font_thickness + outline_thickness*2));
g2.setRenderingHint( g2.setColor(shadow_color);
RenderingHints.KEY_ANTIALIASING, g2.setRenderingHint(
RenderingHints.VALUE_ANTIALIAS_ON); RenderingHints.KEY_ANTIALIASING,
g2.draw(shape); RenderingHints.VALUE_ANTIALIAS_ON);
GlyphVector gv2 = font.createGlyphVector(frc, message); g2.draw(shape);
Shape shape2 = gv2.getOutline((int)(x+xoffset),(int)(y+yoffset)); GlyphVector gv2 = font.createGlyphVector(frc, message);
g2.setClip(null); Shape shape2 = gv2.getOutline((int)(x+xoffset),(int)(y+yoffset));
g2.setStroke(new BasicStroke(font_thickness)); g2.setClip(null);
g2.setColor(text_color); g2.setStroke(new BasicStroke(font_thickness));
g2.setRenderingHint( g2.setColor(text_color);
RenderingHints.KEY_ANTIALIASING, g2.setRenderingHint(
RenderingHints.VALUE_ANTIALIAS_ON); RenderingHints.KEY_ANTIALIASING,
g2.draw(shape2); RenderingHints.VALUE_ANTIALIAS_ON);
g2.setColor(text_color); g2.draw(shape2);
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset)); g2.setColor(text_color);
g2.drawString(as.getIterator(),(int)(x+xoffset),(int)(y+yoffset));
}
} }
public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) { public static void drawCenteredOutlineText(Graphics g, Font font, double x, double y, int outline_size, Color text_color, Color shadow_color, String message) {
Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(message, font); Rectangle2D textBounds = TextUtils.calculateStringBoundsFont(message, font);

Loading…
Cancel
Save