holic 233 Share Posted September 6, 2020 I'm in the sharing mood so here's a real simple but very useful one. void drawStringShadow(Graphics g, String text, int x, int y) It's often hard to read text on the canvas but adding a shadow to your text goes a long ways. It's simple but I don't see it many scripts and I assume it's because once people see there's not a native method or property for it they bail on it so here, have at it! private void drawStringShadow(Graphics g, String text, int x, int y) { Color c = g.getColor(); g.setColor(Color.BLACK); g.drawString(text, x + 1, y + 1); g.setColor(c); g.drawString(text, x, y); } Use it just as you would Graphics#drawString but include your graphics variable in the arguments and set the graphic's colour before calling drawStringShadow, just as you would normally: g.setColor(new Color(168, 219, 168)); drawStringShadow(g, scriptStatus, drawX, drawY); Hope this helps some newbies! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.