mapeditor / mapeditor/tiled

Drag & dropping images into Tiled should give option to create Tilesets with them

Open
#3,107 0 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

usability
Dominant language
C++
Stars
12.9k
Forks
2k
Avg merge
4h 27m
Merged PRs (30d)
8

Description

So far, at least three times on the Tiled Discord people have reported expecting that dragging images into Tiled should prompt them to create a tileset using that image. Currently, dragging images onto Tiled causes Tiled to show an error message saying the file format is unrecognized, presumably because Tiled expects a tileset or a tilemap. Since Tiled is a program that uses many images, I think this is a sensible expectation.

I think Tiled should at least show the New Tileset dialog when a user drops an image file on it, defaulting to "Based on Image" and with the path of the file prefilled.
~~If the user drops image data instead of a file instead (e.g. if they drag an image from a browser), then Tiled should show an error telling the user that only files from their drive may be used in Tiled.~~ I think it might be possible to embed image data in tilesets, in which case Tiled should let us do that, but it should perhaps warn the user that they're embedding the image.

For even better quality of life, it would be handy if this dropping could be context-sensitive. The above would be the default behaviour, but in specific other scenarios, other behaviour could be desirable:
- As current, dropping an image into a Collection of Images tileset in the Tileset Editor should add the image as a tile.
- Dragging an image into a Collection of Images tileset in the tilesets panel should prompt the user whether they want to add that image to the tileset, or make a new tileset.
- Dragging an image into the Layers panel should prompt the user whether they want to make an Image Layer using that image, or make a new tileset.
- Dragging an image (or any file, really...) onto a Property of type File should give the option set that property's value to the path of the file.

Perhaps all this prompting is unnecessary and when possible, the context-appropriate action should always be taken instead, with all other drops counting as "try to make a tileset out of this". The reason I suggested prompting is to avoid scenarios where a user wants one thing but drops the image somewhere else by accident, which might be common since many programs are not that context-sensitive and have the same behaviour regardless of where you drop the image.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files or tests; start by finding the existing drag-and-drop handling that produces the unrecognized-format error and the New Tileset dialog. Define the initial scope around dropping an image file to open that dialog with “Based on Image” and its path prefilled, then verify the remaining context-sensitive cases are explicitly resolved or deferred.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.