Help with my problem ?

my game has a movement of touch screen, but when you change the size of the scene my actor is not fulfilling its role of movement not follow the position in which I press the screen

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,880

    The touch screen coordinates are not the same as the scene coordinates.

    They only look the same when the camera origin is at the same place as the screen origin. (Like when the game first starts.) But after you move the camera, the screen (touch) coordinates are no longer matched up with the scene coordinates.

    In order to get the correct scene coordinates, you will need to add the camera coordinates to the touch coordinates.

    sceneX = touchX + camera origin X
    sceneY = touchY + camera origin Y

  • santigrabisantigrabi Member Posts: 22

    @RThurman said:
    The touch screen coordinates are not the same as the scene coordinates.

    They only look the same when the camera origin is at the same place as the screen origin. (Like when the game first starts.) But after you move the camera, the screen (touch) coordinates are no longer matched up with the scene coordinates.

    In order to get the correct scene coordinates, you will need to add the camera coordinates to the touch coordinates.

    sceneX = touchX + camera origin X
    sceneY = touchY + camera origin Y

    I excuse my ignorance as I do that

  • santigrabisantigrabi Member Posts: 22

    @santigrabi said:

    @RThurman said:
    The touch screen coordinates are not the same as the scene coordinates.

    They only look the same when the camera origin is at the same place as the screen origin. (Like when the game first starts.) But after you move the camera, the screen (touch) coordinates are no longer matched up with the scene coordinates.

    In order to get the correct scene coordinates, you will need to add the camera coordinates to the touch coordinates.

    sceneX = touchX + camera origin X
    sceneY = touchY + camera origin Y

    >

    Pardon my ignorance how do I do that

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922

    In order to access the scene info like camera. Place an actor just off the scene open the actor and unlock the prototype. Now any behaviors you access will show the scene camera attributes.

  • santigrabisantigrabi Member Posts: 22

    @Lost_Oasis_Games said:
    In order to access the scene info like camera. Place an actor just off the scene open the actor and unlock the prototype. Now any behaviors you access will show the scene camera attributes.

    now tell me how it applies to what I say> @Lost_Oasis_Games said:

    In order to access the scene info like camera. Place an actor just off the scene open the actor and unlock the prototype. Now any behaviors you access will show the scene camera attributes.

    ok thanks, and now that attributes apply

Sign In or Register to comment.