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

    Is it possible to nest objects / labels?

    Scheduled Pinned Locked Moved
    Help and Support
    4
    10
    577
    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.
    • R
      reynslagdev
      last edited by

      Hi
      I'm currently trying out HP and in the process I'm building a small educational game.
      I have a scene, where fruits are dropping from the sky and I want them to show a letter and in stead of making a new frame displaying a new letter, I want to make a label which is nested to the fruit. Is that possible, is there a smart workaround or do I have to go with the tedious solution and make a new frame for showing different letters?

      Thanx in advance

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

        @reynslagdev if you use a label to display the letter, I think you can make it a passable physics object and use the 'weld attach' behaviour to attach it to the fruit. I haven't used labels as physics objects, but I'm assuming it works because there is a physics option for them.

        1 Reply Last reply Reply Quote 0
        • R
          reynslagdev
          last edited by

          I've tried that of a sort. The problem is, that i cant get it to work since I'm spawning the fruit. I haven't found a way to dynamically attach the label to the fruit.

          R 1 Reply Last reply Reply Quote 0
          • R
            reynslagdev @reynslagdev
            last edited by

            @Jack8680 But yes. It works fine using physic's on labels.

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

              @reynslagdev yeah, that's a bit more complex. You could use a loop set to 'for each' with a tag so you loop through each object and for example use an attribute to determine which one to weld attach to. You could also use collisions with a tag to do this. For example, if you want the label to attach to the latest spawned fruit you could move them both to the same spot offscreen and use collided with tag then weld attach to tag. This works because it carries the object in the tag it collides with down to all attached behaviours that select that tag. You can then turn collided off after it happens the first time so it only attaches once.

              R 1 Reply Last reply Reply Quote 0
              • R
                reynslagdev @Jack8680
                last edited by

                @Jack8680 Interesting. I'll try your suggestion. Thank you for your answer.

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

                  @reynslagdev with the changes to the broadcast/receive message behaviors in the next update, controlling spawned objects is really easy.

                  R 1 Reply Last reply Reply Quote 0
                  • T-StudiosT
                    T-Studios
                    last edited by

                    Put the apple in a group called apple, set the apple to spawn a label on itself upon creation, next go into the label, add a behaviour making it so whenever it collides with anything in the apple group, it will weld to it

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      reynslagdev @T-Studios
                      last edited by

                      @T-Studios Interesting! I'll try that out. Thanks.

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

                        @iTap-Development That sounds nice.

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