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. Drag and drop if

Drag and drop if

Scheduled Pinned Locked Moved Help and Support
7 Posts 2 Posters 946 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.
  • RobertiiiR Offline
    RobertiiiR Offline
    Robertiii
    wrote on last edited by
    #1

    I need to create a toolbox of sorts. So you drag an item out and it allows moving around the screen. But I need to limit the number of times an object can be added. So you could put three of that item on screen and then no more would be available.

    1 Reply Last reply
    0
    • Michael KhalfinG Offline
      Michael KhalfinG Offline
      Michael Khalfin
      wrote on last edited by
      #2
      1. Make your toolbox. Space each of the objects the same distances apart, and use position and other visual calculations to make everything very organized. Organization is extremely important, and will make all the difference to a user.

      2. Personally, I like to distribute behaviors separately into each object. It takes a long time and it is not too efficient either; it's just way easier to work with. You can also put all of the behaviors inside of one object (this would be using objects tags as well), and group them conditionally; that would be more efficient and faster, too. It would just be harder to keep track of. You have to decide how you will group your behaviors, and then you can actually go one with the process.

      3. Make sure each of the objects are draggable, and organize in a way that you can turn this behavior off later.

      4. Use attributes to figure out how many times an object has been dragged onto the screen.

      5. I like to put this logic under a started touching label. I also like to dispose of objects if they stay inside of the toolbox or are out of screen parameters; you would have to subtract from the attributes though in order for them to still be valid.

      6. Put these objects on some type of grid: this is another additional step that will help keep your editor organized. You can search up different types of grids or look for examples on the hub. Some ideas are rounding or flooring, using sinus functionality, or using division and a function's modelo - honestly, there are many different possibilities depending on what you are looking for.

      7. Develop your behaviors in a way that you can add to them in the future. If you would like to include an additional editor that users can use to transform the object or if you want to allow users to put different settings into effect, you will have to leave space for that (examples: scaling objects, moving them using arrows, allowing more/less of a type of object, creating physical properties for that object, etc, etc.)

      8. Test. test. test. Always keep your users in mind, but remember that they won't see anything behind the scenes (take advantage of that!)

      If you would like more help, feel free to reach out to me.

      RobertiiiR 1 Reply Last reply
      0
      • Michael KhalfinG Michael Khalfin
        1. Make your toolbox. Space each of the objects the same distances apart, and use position and other visual calculations to make everything very organized. Organization is extremely important, and will make all the difference to a user.

        2. Personally, I like to distribute behaviors separately into each object. It takes a long time and it is not too efficient either; it's just way easier to work with. You can also put all of the behaviors inside of one object (this would be using objects tags as well), and group them conditionally; that would be more efficient and faster, too. It would just be harder to keep track of. You have to decide how you will group your behaviors, and then you can actually go one with the process.

        3. Make sure each of the objects are draggable, and organize in a way that you can turn this behavior off later.

        4. Use attributes to figure out how many times an object has been dragged onto the screen.

        5. I like to put this logic under a started touching label. I also like to dispose of objects if they stay inside of the toolbox or are out of screen parameters; you would have to subtract from the attributes though in order for them to still be valid.

        6. Put these objects on some type of grid: this is another additional step that will help keep your editor organized. You can search up different types of grids or look for examples on the hub. Some ideas are rounding or flooring, using sinus functionality, or using division and a function's modelo - honestly, there are many different possibilities depending on what you are looking for.

        7. Develop your behaviors in a way that you can add to them in the future. If you would like to include an additional editor that users can use to transform the object or if you want to allow users to put different settings into effect, you will have to leave space for that (examples: scaling objects, moving them using arrows, allowing more/less of a type of object, creating physical properties for that object, etc, etc.)

        8. Test. test. test. Always keep your users in mind, but remember that they won't see anything behind the scenes (take advantage of that!)

        If you would like more help, feel free to reach out to me.

        RobertiiiR Offline
        RobertiiiR Offline
        Robertiii
        wrote on last edited by
        #3

        @GameCRAZY

        How would I set the actions up to get the response I need?

        1 Reply Last reply
        0
        • Michael KhalfinG Offline
          Michael KhalfinG Offline
          Michael Khalfin
          wrote on last edited by
          #4

          @Robertiii

          Here's an example:

          For each object:

          Create a separate drag and drop behavior.

          Say if stopped touching, get object position. Then use ifs to calculate whether the position of the object is too small or too big x and y. If it is, make the ifs trigger a destroy object. Next to the ifs, include the grid functionality, and next to the grid functionality, you can insert the attribute logic (all under the get object position behavior).

          The grid functionality: you can just round the position if you want, x and y. Then move the object to that location.

          The attributes: create an attribute for each object, and under those object's behaviors, add 1 to that attribute. Also, check to see what the attributes already are. If there are too many objects, delete them, and maybe trigger some type of pop-up.

          Again, this is the way I do things. It is not efficient, and you should try to figure out a way to just include all this functionality inside of one logic object.

          1 Reply Last reply
          0
          • RobertiiiR Offline
            RobertiiiR Offline
            Robertiii
            wrote on last edited by
            #5

            Ok. Thanks! What if I want to not allow dragging if a certain value is reached.

            Michael KhalfinG 1 Reply Last reply
            0
            • RobertiiiR Offline
              RobertiiiR Offline
              Robertiii
              wrote on last edited by
              #6

              Kind of like hyper pad uses for attributes drag to screen but with a limited number of times

              1 Reply Last reply
              0
              • RobertiiiR Robertiii

                Ok. Thanks! What if I want to not allow dragging if a certain value is reached.

                Michael KhalfinG Offline
                Michael KhalfinG Offline
                Michael Khalfin
                wrote on last edited by
                #7

                @Robertiii Just turn the drag behavior off instead of deleting the objects (once you get to the attributes)

                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