Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
hyperPad

hyperPad Forum

  1. Home
  2. Help and Support
  3. Grid based placement

Grid based placement

Scheduled Pinned Locked Moved Help and Support
8 Posts 4 Posters 1.4k Views 1 Watching
  • 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.
  • GadgetkkG Offline
    GadgetkkG Offline
    Gadgetkk
    wrote on last edited by
    #1

    Hi everyone,

    I’m new here and looking for some assistance... I’m making a top down game that requires grid based drag and drop and grid based item placement (think similar to the pc game factories and thousands of others, that’s just the one that come to mind for this).

    Is that do able? Any have an example I can look at or point me in the right direction?

    Thanks in advance.

    1 Reply Last reply
    0
    • RobinsonXR Offline
      RobinsonXR Offline
      RobinsonX
      wrote on last edited by
      #2

      This requires math.

      You take the inputs of the position (x and y) and perform modulus with a number, the number will be how big each block will be in the grid (In meters), we will call this number x. Subtract the original inputs by the corresponding outputs and then add half of x to both outputs from the modulus.

      The outputs of the sum will be the fixed outputs of the new coordinate. If you want me to do it for you, or if you want more help, just tell me. :)

      1 Reply Last reply
      0
      • GadgetkkG Offline
        GadgetkkG Offline
        Gadgetkk
        wrote on last edited by
        #3

        I will see what I can do with that info. If I’m still struggling I will back.

        Side question... how does a meter measure on the screen.

        MurtazaM 1 Reply Last reply
        0
        • GadgetkkG Gadgetkk

          I will see what I can do with that info. If I’m still struggling I will back.

          Side question... how does a meter measure on the screen.

          MurtazaM Offline
          MurtazaM Offline
          Murtaza
          Admin
          wrote on last edited by
          #4

          @gadgetkk
          A meter is 32 pixels. But you can change this when creating a new project or in the global properties of the project. It is referred as the PTM ratio. (Pixel to Meter)

          1 Reply Last reply
          0
          • GadgetkkG Offline
            GadgetkkG Offline
            Gadgetkk
            wrote on last edited by
            #5

            Ok here is what I’m trying...

            While touching > get position
            Modulus position_x by 1
            Modulus position_y by 1
            Sub position_x minus final mod value
            Sub position_y minus final mod value
            Move to point X result Y result

            And it doesn’t move at all.

            Clue #2 please.

            1 Reply Last reply
            0
            • RobinsonXR Offline
              RobinsonXR Offline
              RobinsonX
              wrote on last edited by
              #6

              Try a larger number, because 1 is too small. The number represents how big each block in the grid will be. You're basically having each block being 1 meter wide.

              1 Reply Last reply
              0
              • RobinsonXR Offline
                RobinsonXR Offline
                RobinsonX
                wrote on last edited by
                #7

                @Gadgetkk Well, actually, you can use any number you want. I just found out that you need to use world coordinates in the While Touching behavior. :)

                I've made an example that you can try out! I labeled all the behaviors so it can be easily understood, they are located in the large white box in the scene. Open the link in safari and then you can press "open in hyperPad".

                http://bit.ly/2ZVr9Il

                1 Reply Last reply
                0
                • Aidan_FireA Offline
                  Aidan_FireA Offline
                  Aidan_Fire
                  wrote on last edited by
                  #8

                  I uploaded an example of this to the hub a looooong time ago, wonder if it still works.

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Search