ondras / rot.js

ROguelike Toolkit in JavaScript. Cool dungeon-related stuff, interactive manual, documentation, tests!
https://ondras.github.io/rot.js/hp/
BSD 3-Clause "New" or "Revised" License
2.33k stars 254 forks source link

ROT.Display.Hex doesn't support image drawing #82

Open jaycrossler opened 8 years ago

jaycrossler commented 8 years ago

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).
ondras commented 8 years ago

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 commented 8 years ago

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

jaycrossler commented 8 years ago

Thanks so much. I'm excited!