I have two scenes. In first scene is object centered. I change scene to second and I click to object to return to previous scene. Object is now moved to mouse coordinates. Why? What is bad?
This line of event is wrong if you are planning to center the actor object.
It’s SceneWindowWidth()/2 - actor.width()/2
Also you should place this in an event with no condition.
For the first screen shot you don’t have to use if all this conditions are true because there are no other conditions outside it. Also I would recommend you use the key released rather than the touch or left mouse button is down due to various reasons like the fact that you could activate buttons placed on the same spot as another in a different scene .