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

Allow drag/drop textures in editor (Untested) #640

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

Conversation

NoahGWood
Copy link

@NoahGWood NoahGWood commented Aug 17, 2023

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 #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

@VagueLobster
Copy link
Contributor

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

Fixed typo, also added new entity creation on drag when no entity is found.
@NoahGWood
Copy link
Author

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

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.

2 participants