Skip to content

Commit

Permalink
🔨Fixed rotation Issue on GameObject components
Browse files Browse the repository at this point in the history
  • Loading branch information
jabo-bernardo committed Apr 13, 2020
1 parent e00cb84 commit bf02d98
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dev/jabo/kree/components/MeshRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public void Update() {
public void Render(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
AffineTransform oldTransform = g2d.getTransform();
g2d.rotate(gameObject.transform.rotation, gameObject.transform.position.x, gameObject.transform.position.y);
g2d.rotate(Math.toRadians(gameObject.transform.rotation), gameObject.transform.position.x, gameObject.transform.position.y);
if(gameObject != null) {
g2d.fillRect(gameObject.transform.position.x - 16, gameObject.transform.position.y - 16, gameObject.transform.scale.x, gameObject.transform.scale.y);
}
Expand Down
2 changes: 1 addition & 1 deletion src/dev/jabo/kree/components/SpriteRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void Update() {
public void Render(Graphics g) {
Graphics2D g2d = (Graphics2D)g;
AffineTransform oldTransform = g2d.getTransform();
g2d.rotate(gameObject.transform.rotation, gameObject.transform.position.x, gameObject.transform.position.y);
g2d.rotate(Math.toRadians(gameObject.transform.rotation), gameObject.transform.position.x, gameObject.transform.position.y);
if(gameObject != null)
g2d.drawImage(sprite.image, gameObject.transform.position.x, gameObject.transform.position.y, gameObject.transform.scale.x, gameObject.transform.scale.y, null);
g2d.setTransform(oldTransform);
Expand Down

0 comments on commit bf02d98

Please sign in to comment.