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

Add tile mode #18

Open
narfman0 opened this issue Apr 27, 2013 · 3 comments
Open

Add tile mode #18

narfman0 opened this issue Apr 27, 2013 · 3 comments
Assignees
Labels

Comments

@narfman0
Copy link
Owner

Tile mode could have one bigger info/config window that includes basic settings (like tile scale) in a top pane followed by tile palette.

A tile palette will have a numbered list of tiles, each of which are associated with a renderable resource. A tile palette window that can identify which resources you want to associate with which tiles could go on the left. This will likely consist of a list of (numbered) resources (TextField), then to the right maybe an ImageButton that renders the resource and when clicked opens a FileChooser (to change resource).

After the palette is populated, one may choose the active tile from the list, then paint the tile on the screen.

@ghost ghost assigned cniles May 30, 2013
@narfman0
Copy link
Owner Author

A convenient tool would be a palette populater, which given a directory, could include all the pngs in the palette automatically.

Textures over 2048x2048 are tougher with varying graphics card support etc, so one may be splitting their levels into tiles of 2048x2048 textures, and thus having a tedious time lining up their tiles. This can be accomplished using something like imagemagick (e.g. "convert -crop picture.png 2048x2048 -type TrueColor picture.png"). Tile size or a scaling factor would be helpful here, where if a typical tile is defined as 128x128, the user would likely wish to stretch it to 2048x2048 or change scale to 16 before painting so their tiles aren't squashed.

@mattchaney
Copy link
Contributor

Okay, tile mode is under way. As of right now tile mode allows you to select a spritesheet to use to build a tile palette by specifying margin, spacing between tiles and tile size. You can then select a tile and add it to the level. I render a rudimentary grid based on tile size with a highlight cursor that shows where the tile will be placed upon clicking.

To do:

  • Deleting tiles
  • Painting multiple tiles as mouse is dragged
  • Not painting tiles over top of existing tiles
  • Selecting a tile group + copy, cut & paste
  • Flip / rotate tile before creating
  • Options to toggle: 1. grid rendering 2. snap to grid

@narfman0
Copy link
Owner Author

@mattchaney 's current branch: In GDXTile, you are using a Sprite, which can't cant be serialized with xstream. Should change to something like a string for texture name and dimensions within that texture. Then, in GDXLevel.createLevel return a list of sprites also or in the tile plugin somewhere you can retrieve the texture and region at runtime and make the sprite representing the tile.

Anything with GDX prefix is supposed to be the most public facing element, not implementing anything for the client, so something like strings and numbers are appropriate as we don't want to bind folks to Sprite or Texture or whatever. On the other hand GDXRenderer, and some of the utils, provide a base implementation that is used to render what is there currently and show people how they may use it. This can use sprites and such.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants