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

GMS2 tile editor #1952

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

GMS2 tile editor #1952

wants to merge 4 commits into from

Conversation

CST1229
Copy link
Contributor

@CST1229 CST1229 commented Oct 17, 2024

Description

This PR ports over UTMTCE's tile editor for GMS2 tile layers. I tried to split it into a few commits.

Usage

  1. Go to a room and either select a tile layer or create one (this PR also adds an "Auto" button to automatically set the tile layer's size to the room size). Click the new "Edit" button next to "Tile data" to open the tile editor.
  2. The left half of this window is the tile layer view, and the right half is the tile palette. As GM automatically wraps some tilesets, I have added a "Tileset columns" option to allow manually fixing it (this will persist when closing and reopening the tile editor, but not when opening different data files).
    Select a tile from the right side (or pick using middleclick/Alt+click) to begin drawing. There are a variety of features to make drawing easier, like a preview of the room behind your tiles, using larger areas as a tile brush and filling areas (but no autotiling).
  3. Click the "Apply" button to apply your changes.

Caveats

I'm quite inexperienced in writing complex C# UIs, so I'm again not sure if the code quality is the best, mainly the stuff related to interacting with the XAML (like the RefreshBrush hack).

Notes

The tile editor has a custom-made tile drawing system so that it only needs to redraw edited tiles, this could probably be split off sometime.

Ported from the one in UTMTCE, though I have made a few tweaks to it here.
In GameMaker, tile flipping/mirroring is done before rotation.
i uhhh... accidentally added its implentation in a previous commit. split failed
@colinator27
Copy link
Member

At least on the surface, this looks really good. We'll have to give this some good testing, although I'm not sure if the UTMTCE version of it has been battle-tested already.

@luizzeroxis
Copy link
Contributor

That's really good! I'll be merging this on my branch. Since you are porting this from CE, I wanted to ask - did you make this entirely or were others involved? I want to credit the right people.

@CST1229
Copy link
Contributor Author

CST1229 commented Nov 9, 2024

That's really good! I'll be merging this on my branch. Since you are porting this from CE, I wanted to ask - did you make this entirely or were others involved? I want to credit the right people.

I made this feature entirely.

@Miepee
Copy link
Contributor

Miepee commented Nov 25, 2024

Dont want it in this PR, just asking out of curiosity: how doable would it be to port that system to gms1 games? Currently the workflow there isnt that great either because Tiles there are really just fancy objects.

@CST1229
Copy link
Contributor Author

CST1229 commented Nov 25, 2024

Dont want it in this PR, just asking out of curiosity: how doable would it be to port that system to gms1 games? Currently the workflow there isnt that great either because Tiles there are really just fancy objects.

due to tiles being more like instances there, i think it would be better to implement a more gms1-like workflow for them, directly in the room editor (for gms2 tiles, the room editor rerenders the whole tile layer on every change, which is mostly the reason why the tile editor is in a separate window, alongside some possible ux issues from accidentally clicking a tile layer and entering the tile edit mode)

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.

4 participants