Move pinned objects?

0 favourites
  • 13 posts
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • I have a grid full of sprites (I'm using Board, LayoutToBoard and SquareTx) and I need to move an entire row of sprites in a single touch swipe. I have a translucent place holder sprite on the layer above these sprites that covers the entire row and when I pin it to the sprites below and try to move it, some of the sprites end up off track and overlapping, while others just disappear.

    What I have right now is:

    For each Sprite1

    --Sprite2 Is overlapping Sprite1 -- Pin Sprite1 to Sprite2

    I've tried all of the Pin to mode options and it's the same outcome each time (excluding the angle only option). I've tried making the sprites a little smaller, so they don't collide when moving. I've tried moving all pinned objects forward one level. All to no avail. (Besides the fact they only let us have 4 layers in the free version)

    Am I going about this the wrong way? Is there an easier way than having a marker sprite? HEYLP! lol

  • could you attatch a capx. I personally am having trouble following the question. capx would help see whats happening.

  • NP Tylermon Sorry about not explaining it well. I'm not really sure how else to explain it. I have a feeling I'm making things a little harder than they actually are for myself. lol

    [edit]switched the .capx[/edit]

  • If I removed the "Slider" sprite, would things be easier? Would I be able to move the entire row at the same time?

  • I cant open the capx sadly because I dont use many of the plugins you have.

    That said, I made two sprites. Made one a drag and drop sprite.

    Pinned a bunch of sprites to it and shook the thing like crazy.

    I cant get my pinned sprites to get misplaced no matter how hard I try.

    You mention you use multiple layers. So I am thinking, if you move on one layer, that layer may have different x,y locations than the other layers. Trying to move sprites on different layers may be causing your issue.

    Do you use parallax or anything? are the layouts/layers the same size.

  • Yeah, I've been using a lot of rexrainbow 's plugins and behaviors. They are extremely useful!!!

    Basically, the .capx contains a 1 x 8 grid with a sprite in each grid square, eventually it will be 8x8. There is a long rectangular sprite that appears on top of the row once the screen is touched, which will eventually be clear, but for testing purposes I want to be able to see it. With this "slider" sprite, I want to move the entire row of sprites from side to side using touch controls. Then once I get this part working, I need to figure out how to get the sprites to wrap at the edges of the board, at the pixel level, so you can see the sprites at the edges on both sides of the grid when they crossover.

    At one point I was using multiple layers, but I found that if I just set the solid behavior of all the sprites to disabled, I don't need to use multiple layers.

    With that said, I tried using drag and drop before. I guess I just don't know it well enough to get it work. But, by the looks of the conditions and actions it provides, the functionality I need just isn't there. Right now, I am using a for each loop to pin all the sprites to the slider sprite, but it's just not working. I'll goof around with drag and drop some more though and look up the tutorials again.

    I haven't tried using parallax yet. I don't know how I would get it to work along with the wrap, since I'm not wrapping at the edge of the layout. Is it possible to view multiple layouts at the same time? That would make things a whole lot easier cuz then I could just set the board layout to the size of the board and have the UI stuff on the sides on another layout beneath the board. lol

  • Pin the sprites to the translucent sprite, then move the translucent sprite with drag drop. That should work fine.

  • Yeah, I've been using a lot of rexrainbow 's plugins and behaviors. They are extremely useful!!!

    Basically, the .capx contains a 1 x 8 grid with a sprite in each grid square, eventually it will be 8x8. There is a long rectangular sprite that appears on top of the row once the screen is touched, which will eventually be clear, but for testing purposes I want to be able to see it. With this "slider" sprite, I want to move the entire row of sprites from side to side using touch controls. Then once I get this part working, I need to figure out how to get the sprites to wrap at the edges of the board, at the pixel level, so you can see the sprites at the edges on both sides of the grid when they crossover.

    At one point I was using multiple layers, but I found that if I just set the solid behavior of all the sprites to disabled, I don't need to use multiple layers.

    With that said, I tried using drag and drop before. I guess I just don't know it well enough to get it work. But, by the looks of the conditions and actions it provides, the functionality I need just isn't there. Right now, I am using a for each loop to pin all the sprites to the slider sprite, but it's just not working. I'll goof around with drag and drop some more though and look up the tutorials again.

    I haven't tried using parallax yet. I don't know how I would get it to work along with the wrap, since I'm not wrapping at the edge of the layout. Is it possible to view multiple layouts at the same time? That would make things a whole lot easier cuz then I could just set the board layout to the size of the board and have the UI stuff on the sides on another layout beneath the board. lol

    You dont need a for each loop.

    Just say pin Sprite to sprite and all of that sprite gets pinned.

    Generally for each is useful when you want to do more specific things.

    Like check a variable.

    It helps pick only certain objects instead of all of them.

    Maybe the grid object or something you are using is what is breaking them? is it possible one of your plugins is trying to keep the objects in a certain spot, but the slider/pin behavior is conflicting so the two sort of fight each other making a giant mess?

  • Tylermon When I do that, it pins all the sprites on the entire grid. I need it to only pick one row or column, which is why I was trying the for each loop.

    codah That doesn't work when there are multiple rows on the grid though. It'll pin everything on one specified row when before runtime, but that's not what I'm looking for. I need it to work on a multi-row grid when the user swipes a row or column.

    Here's my full .capx so you can see what I'm talking about. In this version, it enabled dragdrop and took out the for each loop to try some other ways, but I haven't been able get it yet.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Ok, I got it. I ended up having to make a collision condition between the blocks and the slider and now the pin works.

    Thanks for your help Tylermon and codah

  • to be honest, you might not even need to pin anything. You could have that transparent sprite, check for a collision, and use the touch start/end to detect which way a swipe was, and lerp the sprites to the position you want.

    you ninja, haha. glad to see you got it working!

  • I would love to get these blocks to move without being pinned! I only have the free edition right now, so the fewer lines the better. lol I haven't messed around with lerp yet, but I'll take a look at a couple tutorials cuz it may be super useful.

  • So I've been looking at the liteTween behavior and I don't think it's right for what I need done. Or, I just don't understand it enough yet. lol Thanks so much for all the help!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)