logo hyperPad Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Login

    Do touch coordinates change when the screen is moved?

    Scheduled Pinned Locked Moved Unsolved
    Help and Support
    4
    15
    1.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • iTap DevelopmentI
      iTap Development @Hamed
      last edited by

      @Hamed or @Murtaza what I'm trying to say is I that, if I touch in the middle of the screen that point would be x16 y12 but if I first move the screen to the point x16 y11 then touch the middle of the screen, the point it would out put is x16 y13 I think...is that how it should work?

      1 Reply Last reply Reply Quote 0
      • HamedH
        Hamed Admin
        last edited by

        Sorry, I told @Murtaza the setup backwards. Screen coordinates will be the same, world coordinates will be different. So if you have world coordinates selected then that is how it should be working.

        iTap DevelopmentI 1 Reply Last reply Reply Quote 0
        • iTap DevelopmentI
          iTap Development @Hamed
          last edited by

          @Hamed how do you put it on screen coordinates? There is only a toggle for world coordinates, or does turning that off make it screen coordinates? Even with world coordinates off I still have the same problem.

          Jack8680J 1 Reply Last reply Reply Quote 0
          • Jack8680J
            Jack8680 @iTap Development
            last edited by Jack8680

            @iTap-Development World Coordinates returns the coordinates in the world, relative to 0,0 of the world coordinates. Turning it off returns where you touched, relative to the object you are touching. To get the screen coordinates, subtract the touching world coordinates from the screen position and add the screen offset (by default, 16 to x and 12 to y).

            iTap DevelopmentI 1 Reply Last reply Reply Quote 0
            • iTap DevelopmentI
              iTap Development @Jack8680
              last edited by

              @Jack8680 yeah that works....but isn't there a way to use screen coordinates without doing that @Murtaza ?

              iTap DevelopmentI 1 Reply Last reply Reply Quote 0
              • iTap DevelopmentI
                iTap Development @iTap Development
                last edited by

                yeah that works....but isn't there a way to use screen coordinates without doing that @Murtaza ?

                1 Reply Last reply Reply Quote 0
                • HamedH
                  Hamed Admin
                  last edited by

                  Can you make me a quick project to see whats going on? And tell me what you expect to happen and what is happening?

                  Thanks.

                  iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                  • iTap DevelopmentI
                    iTap Development @Hamed
                    last edited by

                    @Hamed I sent you a project in an email!

                    1 Reply Last reply Reply Quote 0
                    • HamedH
                      Hamed Admin
                      last edited by

                      I see whats happening. I assumed you were talking about touches using global behaviours. When turning off world coordinates, it outputs the position relative to itself.

                      eg. you have a blue box in the middle of the screen and you output the y coordinates of the finger with world coordinates off. As soon as your finger goes under neath the blue box, it will be less than zero. If your finger goes above the blue box, it will output the the height of the blue box + the distance away from the edge of the blue box.

                      iTap DevelopmentI 1 Reply Last reply Reply Quote 0
                      • iTap DevelopmentI
                        iTap Development @Hamed
                        last edited by

                        @Hamed so can I output the coordinates relative to the screen? Sorry if I'm confused🙈

                        Jack8680J 1 Reply Last reply Reply Quote 0
                        • Jack8680J
                          Jack8680 @iTap Development
                          last edited by

                          @iTap-Development not directly, but as I said before you can find the coordinates relative to 0,0 of the screen by doing this (for default zoom):
                          X=Touching.X(World Coords)-Screen.X+16
                          Y=Touching.Y(World Coords)-Screen.Y+12
                          When you change the zoom, this won't work anymore since the screen centre would change. To fix this, change the 16 and 12 offsets to the centre of the screen when you zoom.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post