May 30, 20178 yr Do you want to paint the mouse trail as your PC sees it or as jagexs servers see it? ;)
May 31, 20178 yr private final LinkedList<MousePathPoint> mousePath = new LinkedList<>(); public void onPaint(final Graphics2D g) { while (!mousePath.isEmpty() && mousePath.peek().isUp()) mousePath.remove(); Point clientCursor = getMouse().getPosition(); MousePathPoint mpp = new MousePathPoint(clientCursor.x, clientCursor.y, 300); //1000 = lasting time/MS if (mousePath.isEmpty() || !mousePath.getLast().equals(mpp)) mousePath.add(mpp); MousePathPoint lastPoint = null; for (MousePathPoint a : mousePath) { if (lastPoint != null) { g.setColor(Color.WHITE); g.drawLine(a.x, a.y, lastPoint.x, lastPoint.y); } lastPoint = a; } }
Create an account or sign in to comment