Hazel icon indicating copy to clipboard operation
Hazel copied to clipboard

Allow drag/drop textures in editor (Untested)

Open NoahGWood opened this issue 2 years ago • 2 comments

May need to rework the ImGuiPayload creation, adapted from: https://github.com/NoahGWood/VersaMachina/blob/main/VersaEditor/src/EditorLayer.cpp

Describe the issue (if no issue has been made)

People generally expect to be able to drag/drop items from the content pane into the viewport and onto game objects.

PR impact

List of related issues/PRs this will solve:

Impact Issue/PR
Issues this solves None
Other PRs this solves https://github.com/TheCherno/Hazel/pull/487

Proposed fix

Check if texture file has been dropped on sprite component in the editor & set the texture

Additional context

Tasks to validate:

  • [ ] Build Hazelnut
  • [ ] Start Hazelnut
  • [ ] Add entity to scene
  • [ ] Add SpriteRendererComponent to entity
  • [ ] Drag & drop a texture (.png file) from the content browser panel into an empty space on viewport
  • [ ] Drag & drop a texture (.png file) from the content browser panel onto the quad in the viewport

NoahGWood avatar Aug 17 '23 18:08 NoahGWood

Sorry, but there already is a pull request on the very same topic: https://github.com/TheCherno/Hazel/pull/487/files#diff-075edf150e3610e06dc7477cd660bd51a62dd452ddc920dc500d41adafda1689

VagueLobster avatar Aug 17 '23 18:08 VagueLobster

Sorry, but there already is a pull request on the very same topic: https://github.com/TheCherno/Hazel/pull/487/files#diff-075edf150e3610e06dc7477cd660bd51a62dd452ddc920dc500d41adafda1689

Ah, didn't see that, I'll update my PR to reflect that

NoahGWood avatar Aug 18 '23 20:08 NoahGWood