New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Move Selection feature. #650

Open
bryanedds opened this Issue Apr 26, 2014 · 13 comments

Comments

Projects
9 participants
@bryanedds

bryanedds commented Apr 26, 2014

This is really fundamental to building stages in side-scrolling games. In that context, you often need to move slices of the stages back and forth. The current tools are insufficient to do this smoothly.

Simple usage of Move Selection feature would be -

  • Select desired tiles with existing Selection tool.
  • Drag selection with right-click.

Usage in a side-scrolling level editing scenario would be -

  • Select tiles you wish to relocate with existing Selection tool.
  • Cut.
  • Select tiles you need to scoot out of the way.
  • Drag selection with right-click.
  • Paste, then place relocated tiles appropriately.

Additional polish feature would be -

  • Press escape to go from Stamp / Paste Mode back to previous mode (here would be Select Mode).

Implementation of main feature and polish should be straight-forward enough.

@GeorgeBroussard

This comment has been minimized.

Show comment
Hide comment
@GeorgeBroussard

GeorgeBroussard Aug 12, 2014

This is key and it's hard to believe some form of moving a selection isn't in here, as it's a core thing. It's about the first feature I ran into when making something. There is no easy way to move sections around. You have to painfully copy/paste each layer of the section you want to move. This kills iteration time.

GeorgeBroussard commented Aug 12, 2014

This is key and it's hard to believe some form of moving a selection isn't in here, as it's a core thing. It's about the first feature I ran into when making something. There is no easy way to move sections around. You have to painfully copy/paste each layer of the section you want to move. This kills iteration time.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Aug 12, 2014

Owner

@GeorgeBroussard Multi-layer editing operations are indeed missing and I understand this can be rather painful. That issue is covered by #282.

Owner

bjorn commented Aug 12, 2014

@GeorgeBroussard Multi-layer editing operations are indeed missing and I understand this can be rather painful. That issue is covered by #282.

@lazd

This comment has been minimized.

Show comment
Hide comment
@lazd

lazd Sep 13, 2014

+1 this would be really useful.

lazd commented Sep 13, 2014

+1 this would be really useful.

@joshmmo

This comment has been minimized.

Show comment
Hide comment
@joshmmo

joshmmo Feb 1, 2015

I need this

joshmmo commented Feb 1, 2015

I need this

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Mar 7, 2017

Owner

Another +1 from @eevee in his forum post. About time to raise the priority.

Owner

bjorn commented Mar 7, 2017

Another +1 from @eevee in his forum post. About time to raise the priority.

@bjorn bjorn added the urgent label Mar 7, 2017

@sanchaez

This comment has been minimized.

Show comment
Hide comment
@sanchaez

sanchaez Apr 2, 2017

Ok I'm on it :)

sanchaez commented Apr 2, 2017

Ok I'm on it :)

@Bobjt

This comment has been minimized.

Show comment
Hide comment
@Bobjt

Bobjt May 12, 2017

My crap-a-rific map editor implemented multi-layer movement with a global check box titled "current layer only" - if that was off, every operation applied to every layer. I had a proper move tool (and of course, selection), and so could move portions of my multi layered map around, Yayyyyy. Or just the current selected layer. Rudimentary, but it worked like a charm. I like Tiled so much, can't do both make a map editor AND game (i'll die before then), but man, what a big wall this is not having a move tool... holding out for this one, Thorbjørn, my maps are gonna suffer until then. Might even be willing to up my patronage for this one. If I do though, I'm gonna pm you directly and let you know what it's for with wide eyes and a ridiculously huge wink ;-)

Bobjt commented May 12, 2017

My crap-a-rific map editor implemented multi-layer movement with a global check box titled "current layer only" - if that was off, every operation applied to every layer. I had a proper move tool (and of course, selection), and so could move portions of my multi layered map around, Yayyyyy. Or just the current selected layer. Rudimentary, but it worked like a charm. I like Tiled so much, can't do both make a map editor AND game (i'll die before then), but man, what a big wall this is not having a move tool... holding out for this one, Thorbjørn, my maps are gonna suffer until then. Might even be willing to up my patronage for this one. If I do though, I'm gonna pm you directly and let you know what it's for with wide eyes and a ridiculously huge wink ;-)

@sanchaez

This comment has been minimized.

Show comment
Hide comment
@sanchaez

sanchaez May 12, 2017

@Bobjt I've been working on this, but it's current state is not really good and I don't have much free time :(
I will push the changes to my fork today.

sanchaez commented May 12, 2017

@Bobjt I've been working on this, but it's current state is not really good and I don't have much free time :(
I will push the changes to my fork today.

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 7, 2017

Contributor

Should this be specific to a particular tile layer, because the right now, the selection tool selects only from the currently active layer?

Another doubt: Should this be a new tool? Or should be added to the current selection tool itself (will work only when a particular key/mouse button is pressed)?

Contributor

ketanhwr commented Jun 7, 2017

Should this be specific to a particular tile layer, because the right now, the selection tool selects only from the currently active layer?

Another doubt: Should this be a new tool? Or should be added to the current selection tool itself (will work only when a particular key/mouse button is pressed)?

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jun 7, 2017

Owner

@ketanhwr Multi-layer move would be awesome, but I suggest you implement single-layer move first, which would already be a nice addition.

Whether it should be a new tool, I'm not entirely sure. In GIMP, moving of selection is handled by a special layer mode which is called "Floated Layer". There can be only one floating layer and when there is one, it is always the currently selected layer. The floated layer can be dragged around by grabbing it, and it can be "anchored" (applied to the layer below it) by clicking outside of it. GIMP goes another step further, and allows selecting a region while having a floating layer, in which case anchoring the floated layer will only apply in the selected region.

So, implementing a move tool like that would be one option. However, it could also be simply a separate tool that cuts the selection when you drag it away and applies it at a new location when you click outside of it (or switch tools, I presume). I would probably go that way for now, since the floating layer approach will be quite involved even though the functionality is otherwise very similar.

Regarding the preview rendering, you can use the BrushItem for the draggable preview, and you could probably just cut out the part when the user starts to drag.

Owner

bjorn commented Jun 7, 2017

@ketanhwr Multi-layer move would be awesome, but I suggest you implement single-layer move first, which would already be a nice addition.

Whether it should be a new tool, I'm not entirely sure. In GIMP, moving of selection is handled by a special layer mode which is called "Floated Layer". There can be only one floating layer and when there is one, it is always the currently selected layer. The floated layer can be dragged around by grabbing it, and it can be "anchored" (applied to the layer below it) by clicking outside of it. GIMP goes another step further, and allows selecting a region while having a floating layer, in which case anchoring the floated layer will only apply in the selected region.

So, implementing a move tool like that would be one option. However, it could also be simply a separate tool that cuts the selection when you drag it away and applies it at a new location when you click outside of it (or switch tools, I presume). I would probably go that way for now, since the floating layer approach will be quite involved even though the functionality is otherwise very similar.

Regarding the preview rendering, you can use the BrushItem for the draggable preview, and you could probably just cut out the part when the user starts to drag.

@bjorn

This comment has been minimized.

Show comment
Hide comment
@bjorn

bjorn Jun 7, 2017

Owner

@sanchaez Btw, if you think your changes could help @ketanhwr with his project, please do still push them to your fork. Thanks!

Owner

bjorn commented Jun 7, 2017

@sanchaez Btw, if you think your changes could help @ketanhwr with his project, please do still push them to your fork. Thanks!

@ketanhwr

This comment has been minimized.

Show comment
Hide comment
@ketanhwr

ketanhwr Jun 8, 2017

Contributor

Alright, thanks @bjorn! 😄

Contributor

ketanhwr commented Jun 8, 2017

Alright, thanks @bjorn! 😄

@bjorn bjorn added this to Tiled 1.1 in Roadmap Jun 8, 2017

@bjorn bjorn moved this from Tiled 1.1 to In Progress in Roadmap Jun 12, 2017

@RhenaudTheLukark

This comment has been minimized.

Show comment
Hide comment
@RhenaudTheLukark

RhenaudTheLukark Mar 15, 2018

Contributor

I would like to get more information about this new feature, which seems to be urgent for quite some time.

How about adding some kind of option for the Rectangular selection tool (disabled by default, I don't know yet where we could toggle it but maybe pressing a key combination may be good like Ctrl+M when selecting the Rectangular selection tool) that would move the selection of tiles instead of remaking a new selection, only if the mouse is hovering over a tile in this selection?

The moved tiles' former position would contain empty tiles (tile value 0) after the action, and each tile under that new moved selection would be erased and replaced by the new moved tiles.

What do you think about that idea?

Contributor

RhenaudTheLukark commented Mar 15, 2018

I would like to get more information about this new feature, which seems to be urgent for quite some time.

How about adding some kind of option for the Rectangular selection tool (disabled by default, I don't know yet where we could toggle it but maybe pressing a key combination may be good like Ctrl+M when selecting the Rectangular selection tool) that would move the selection of tiles instead of remaking a new selection, only if the mouse is hovering over a tile in this selection?

The moved tiles' former position would contain empty tiles (tile value 0) after the action, and each tile under that new moved selection would be erased and replaced by the new moved tiles.

What do you think about that idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment