rot.js icon indicating copy to clipboard operation
rot.js copied to clipboard

ROT.Display.Hex doesn't support image drawing

Open jaycrossler opened this issue 9 years ago • 3 comments

It appears that ROT.Display.Tile.prototype.draw will draw an image if passed in using tileMap and tileColorize for the tile, but hexes don't (likely because of the complex geometry of building a tile map of an image). Any suggestions on how best to add in similar capability for hexes so as to align to the functionality found in: http://ondras.github.io/rot.js/manual/#tiles

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/28792740-rot-display-hex-doesn-t-support-image-drawing?utm_campaign=plugin&utm_content=tracker%2F297828&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F297828&utm_medium=issues&utm_source=github).

jaycrossler avatar Dec 02 '15 18:12 jaycrossler

Right, the Tile backend is closely coupled to the Rect one, using inheritance: https://github.com/ondras/rot.js/blob/master/src/display/tile.js#L11

Technically, drawing image tiles in a hex layout is a more/less solved stuff: we have the math (Hex backend), we have the image stuff (Tile). The only real issue here is how to make this work API-wise, where the individual ROT.Display backends form a hierarchy that is not exactly suited for plugging in this Hex+Tile newcomer.

ondras avatar Dec 02 '15 19:12 ondras

However, I think that having this is a reasonable request, thus assigning myself to the issue.

ondras avatar Dec 02 '15 19:12 ondras

Thanks so much. I'm excited!

jaycrossler avatar Dec 02 '15 19:12 jaycrossler