Trying to write the correct formulas for drawing round hitboxes
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package gui;
|
||||
|
||||
import java.awt.BasicStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.event.MouseEvent;
|
||||
@ -79,7 +81,14 @@ public class EditableCanvas extends JPanel implements MouseListener, MouseMotion
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
g.drawImage(image, 0, 0, this);
|
||||
if(image!=null) {
|
||||
g.drawImage(image, 0, 0, this);
|
||||
g.setColor(Color.darkGray);
|
||||
g.drawRect(0, 0, image.getWidth(), image.getHeight());
|
||||
g.setColor(Color.RED);
|
||||
g.fillOval(image.getWidth()/2, image.getHeight(), 2, 2);
|
||||
g.setColor(Color.green);
|
||||
}
|
||||
if(entity != null) {
|
||||
drawing((Graphics2D)g);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user