@@ -140,8 +140,8 @@ public void setPosition(Vector2 position) {
140140 *
141141 */
142142 public Vector2 getSpritePosition (){
143- float x = (getPosition ().subtract (Main .getScene ().getCamera ().getPosition ()).getX ()-(( getScale (). getX ()/ 2 )) );
144- float y = (getPosition ().subtract (Main .getScene ().getCamera ().getPosition ()).getY ()-(( getScale (). getY ()/ 2 )) );
143+ float x = (getPosition ().subtract (Main .getScene ().getCamera ().getPosition ()).getX ());
144+ float y = (getPosition ().subtract (Main .getScene ().getCamera ().getPosition ()).getY ());
145145
146146 return new Vector2 (x ,y );
147147 }
@@ -301,13 +301,14 @@ public void update() {
301301 setMouseInside (false );
302302 }
303303 if (isMouseInside () && Input .isMousePressed () && isEnabled ()) {
304+ onMousePressed (Input .getMouseDown ());
304305 onMousePressed ();
305306 if (getParent () != null ) getParent ().onMousePressed ();
306307 }
307308
308309 if (parent !=null ) {
309- float x = (parent .getPosition ().getX ())- scale . getX ()/ 2 ;
310- float y = (parent .getPosition ().getY ())- scale . getY ()/ 2 ;
310+ float x = (parent .getPosition ().getX ());
311+ float y = (parent .getPosition ().getY ());
311312
312313 setPosition (new Vector2 (x ,y ).add (getLocalPosition ())); // we get the parents position and we add our localPosition
313314 // update this in the setScale and setRotation instead
@@ -446,10 +447,10 @@ public Vector2 movePosition(Vector2 add) {
446447 return add ;
447448 }
448449
450+ public void onMousePressed (LinkedList <Integer > mouseKeys ) {
451+ }
449452 public void onMousePressed () {
450- Debug .log ("pressed on " +this +" :/" );
451453 }
452-
453454 public void onMouseEntered () {
454455 //Debug.log("entered "+this);
455456 }
0 commit comments