11package javagameengine .backend ;
22
3+ import Testing .Main ;
34import javagameengine .JavaGameEngine ;
45import javagameengine .backend .input .Input ;
6+ import javagameengine .components .Camera ;
57import javagameengine .components .Component ;
68import javagameengine .msc .Debug ;
79import javagameengine .msc .Vector2 ;
@@ -34,6 +36,7 @@ public class Scene extends JPanel{
3436 public static String fps = "0" ;
3537
3638 public int id =120313 ;
39+ private Camera camera = new Camera ();
3740
3841 private boolean active = false ;
3942
@@ -56,7 +59,7 @@ public void start(){
5659
5760 setActive (true );
5861 setBackground (new Color (44 , 157 , 228 ));
59- UpdateThread . camera .setPosition (new Vector2 (0 ,0 ));
62+ getCamera () .setPosition (new Vector2 (0 ,0 ));
6063
6164 }
6265 public void starts (){
@@ -82,6 +85,13 @@ public void update(){
8285 JavaGameEngine .origin = JavaGameEngine .getWindowSize ().devide (2 );
8386 }
8487
88+ public void setCamera (Camera c ){
89+ this .camera = c ;
90+ }
91+ public Camera getCamera (){
92+ return camera ;
93+ }
94+
8595 /**
8696 * Here is the main drawing function
8797 * */
@@ -96,7 +106,7 @@ private void drawComponents(Graphics g){
96106 //g.drawString(Input.getMouseWorldPosition().toString(), (int) Input.getMousePosition().getX(), (int) Input.getMousePosition().getY());
97107
98108 Graphics2D g1 = (Graphics2D ) g ;
99- Vector2 scale = UpdateThread . camera .getScale ();
109+ Vector2 scale = getCamera () .getScale ();
100110 //scale = scale.devide(JavaGameEngine.getWindowSize());
101111 g1 .scale (scale .getX (),scale .getY ());
102112
0 commit comments