-
Notifications
You must be signed in to change notification settings - Fork 40
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
Player names overlap causing them to be unreadable #93
Comments
I have made some changes to allow random colors for every player (colors are not persistant between renders and are randomized every time): I don't know enough about git or github to turn this into a pull request. If you are interested in these changes, how could we proceed? Also any pointers to avoid the overlap? |
For now I have resorted to also display the list of players in the top left corner. At first I moved them to be displayed top left exclusively with the + sign showing their position, but it's hard to discern the marks on the map that way. Not sure how I can make it better than this without actually spacing the names between themselves. Should a player actually be top left of the map, the original problem would still occur and overlap. |
To make colors persistent between renders, you could generate a hash from the name string and use that as a basis for a randomly generated color. This could be as simple as keeping a list of 16 or so colors and modulating it with the hash (like IRC clients do). It may also be a good opportunity to add an outline around player names for better readability on mixed-color backgrounds. |
It's already a 7x13 pixel font so I don't know if it would look right. I can't find anything in the gd library that suggests the support of outlining or stroking the text. I just wanted to help fixing unreadable names :-) |
You can draw a shadow by drawing black text with the same contents with a 1-pixel (or 2-pixel) offset on the X and Y axes 🙂 Make sure to draw the shadow before the actual text, so that it appears behind the actual text. |
If you could contribute an implementation of that, that'd be nice. |
Is it possible to assign different colors to different players and avoid overlap?
Playing with the zoom level alleviates the problem a bit, but it's still not perfect (and results in very large images).
Left is
--zoom 4
, right is no zoom:The text was updated successfully, but these errors were encountered: