Skip to content
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

Point rotation #3854

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

IoriBranford
Copy link

@IoriBranford IoriBranford commented Dec 8, 2023

Some use cases:

  • give points visible directions/angles
  • place multiple points at the same position without overlapping, so it's easier to select the one you want

image

- Consider point rotatable
- Transform graphics item
- Rotate reference arrow position
- Rotate selection outline
- Let selection tool rotate but not resize single point
- Always use point position as the rotate origin
- Unlock rotation property on point
Fixes going to resize mode instead of rotate mode when creating new point object.
@eishiya
Copy link
Contributor

eishiya commented Dec 8, 2023

I don't think it makes sense for points to have a direction. Points are points, they are not lines or vectors. If your goal is to visualise vectors, then I think a new vector type with different visualisation would be a clearer option.

I do like the idea of having a way to clearly display multiple points at a location, but I feel this would be better solved by smarter handling of the labels than by giving points rotation.

@IoriBranford
Copy link
Author

IoriBranford commented Dec 8, 2023

I know mathematically a "directed point" isn't a thing, but looking at a map editor as a creativity tool, I'd think enabling more ways to be creative with shapes is worth it.

I could add a choice of point appearances. I'd rather that than implement a new shape type logically identical to a point except for having rotation. For starters the choices would be either the current appearance, or a dot with attached arrowhead for the "directed point" case. Later on this option could be expanded with more point shapes you could use for classification and personalization. It would be a property of each point, and later there could be a default setting in editor preferences or project settings.

I think I see what you mean by handling the labels, maybe auto arranging them to not overlap but that doesn't help with clicking a specific one unless we allow clicking its label to select it.

@eishiya
Copy link
Contributor

eishiya commented Dec 8, 2023

I think vectors would be better as a new object type because they have two things Points don't: direction and length. So, vectors are really closer to Polylines than to Points, since they can be described as two points xP And if we run with that comparison, then perhaps a Vector Object could consist of two points - its position (the base of the arrow), and a second point indicating its length and direction (the tip of the arrow), and they could potentially be manipulated independently, with entirely different controls than for Points. Unlike a Polyline, however, it would store Length and Direction rather than the coordinates of the second point. The Direction would be equivalent to Rotation, just with a more appropriate name for the context.

Arguably, vectors also call for a third difference from Points: a scale factor. It's common for vectors to use units other than those used for sizes, but the user may still want to conveniently manipulate/visualise them, and thus may want to set a multiplier so that the handles aren't too distant or too small. For example, if I'm implementing jump pads, I may want to scale the vector preview so it shows the approximate distance it will send the player, which will be in the tens or hundreds of pixels, rather than the impulse that vector represents, which may be in the thousands, way off the map if shown as pixels.


I should've been clearer with the "labels" bit - I meant not only the text labels, but the drawn points as well - those are also labels, since they are not themselves the Point, but sit offset from it. That is, I think rotating the points in this way should be something Tiled does automatically (possibly based on zoom level), without storing it in the map file.
Positioning text labels and making them clickable would be a good option as well. Perhaps the automatic positioning would only take effect when clickable text labels are enabled.


I realise I'm asking for a lot here - I don't expect you to implement any of this. I can see the usefulness of the feature as you've added it, but I think that as a merged Tiled feature rather than a local change, it would be better to have something more substantial which doesn't conflict with the usual understanding of a Point. Perhaps I should open an issue requesting Vector Objects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants