Open narfman0 opened 11 years ago
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.
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:
@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.
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.