-
Notifications
You must be signed in to change notification settings - Fork 11
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
Map editor update - add rotation #24
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When the materials are generated, set the proper uv scaling so they are correctly visualized in-game.
This fixes the situation where if two map editors are opened, only the last one receives input from the scroll wheel
Improved saving loading, added duplicate and delete buttons, icons
Add name and description labels to show info on a tile
Overmap chunks will stay consistent even after changing scenes.
Add icons to replace text for gui elements in the map editor
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This requires #22 to work. I will publish this PR as a draft to make sure #22 gets merged first.
This PR adds rotation to tiles on the map. I added a button that will rotate the tile. Next to the button is the amount of degrees it is rotated. Maybe I can replace the number with an arrow. I also added a hovering preview of the selected tile brush. You cannot see the cursor on my image so I added a red dot where the cursor is. You can see the preview floating besides it in a down-right position.
The map editor saves the rotation of the tile and then in the map generator the rotation is read and applied to the block that is created. As a proof of concept I added a tower you can climb to the generichouse.json map. In the image below you can see the shadow it produces.
I'm still figuring out what is the best way to apply rotation in Godot since apparently 0 degrees meens it's pointing east. For this game I want 0 degrees to point north so I made adjustments to the mapeditor and level generator to make sure that map tiles that are rotated 0 degrees are generated as a block that is rotated 90 degrees on the Y axis, meaning it is pointing north. For the other directions this means there is a bit of funky code to rotate it properly and can probably be improved upon in future prs.
I also added a shortcut to the rotate button but it doesn't work yet. I'll look into it later.