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

Support for square tiles and non-square-ratio text #178

Open
ddmills opened this issue May 3, 2020 · 3 comments
Open

Support for square tiles and non-square-ratio text #178

ddmills opened this issue May 3, 2020 · 3 comments

Comments

@ddmills
Copy link

ddmills commented May 3, 2020

When rendering maps, forceSquareRatio: true is perfect, but when rendering display text, the square ratio makes it difficult to read:

image

when rendering text, it would be great to have an additional flag or option to allow the aspect ratio to be non-square.

@ondras
Copy link
Owner

ondras commented May 4, 2020

The rot.js Display is supposed to represent a grid with rows and columns. It is not possible and not feasible to mix different character widths. I can highly recommend creating an independent rendering area for your text needs. It can be either a different ROT.Display instance, or simply a HTML <p> (with the additional benefit of CSS styling).

Alternatively, you might want to try different monospace fonts to find some with more square-like aspect ratio. This is a good place to start: https://github.com/chrissimpkins/codeface

@ddmills
Copy link
Author

ddmills commented May 4, 2020

I was thinking more along the lines of how it's done in cogmind: https://www.gridsagegames.com/cogmind/game/cogmind_labels_items.png

a good article on how this was achieved: https://www.gridsagegames.com/blog/2014/09/fonts-in-roguelikes/

I think maybe a couple challenges here:

  1. would require support for multiple glyphs [Question] Is there a way to use two different tilesets? #163
  2. would require some decent math around how many non-square glyphs would fit in a square row
  3. goes against the grid-like row/column structure that is currently in place for rot.js

@ondras
Copy link
Owner

ondras commented May 5, 2020

Also, there remains an open question of a text-based vs. image-based Display. You mentioned the forceSquareRatio property that is used for text-based Displays, but you also linked the #163 which is only relevant in the context of Image Tiles.

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

No branches or pull requests

2 participants