I have a question regarding how you render "gray" pixels. You said that you use rectangles, because "dithered" pattern had low performance. But the rectangles cause "scanlines", which I presume are because of imprecise mapping to physical pixels.
Have you tried other shapes? Dividing the square by the diagonal should not have this problem, and you're even drawing a simpler shape (triangle vs rectangle).
Chrome definitely supports them on Windows at least, I don't know if it supports them on other operating systems. Here's a test page for the various kinds of color font tables: https://yoksel.github.io/color-fonts-demo/
I have tried other shapes at the pixel level, but not at the sprite level. Example: I draw from the top left pixel, draw the whole row of pixels (use the run length encoding), Then I draw the next row and so on. I haven't tried drawing the top left pixel and then drawing the to the bottom right corner, then moving up/down a diagonal row. You're right that might make it look a lot better, I will have to try it later. I stopped after I got it "good enough", because I wanted to finish the game.
Oh yeah. In that case, I did try that, but for whatever reason it didn't perform well or I wasn't happy with the look. (It was probably performance).
You can play around with the sprite rendering in the code. This [0] is the line for each individual pixel. And this[1] is where I generate the repeated pixel subroutines.
Comments (76) 29 threads
Show all comments
Showing thread 10 of 29
Have you tried other shapes? Dividing the square by the diagonal should not have this problem, and you're even drawing a simpler shape (triangle vs rectangle).
Continue this thread — 1 reply
0: https://github.com/mmulet/font-game-engine/blob/e92a97ecbf8c...
1: https://github.com/mmulet/font-game-engine/blob/e92a97ecbf8c...