This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
zero_cool's profile picture

Char/Pixel Aspect Ratio

Started by zero_cool, 16 July 2013 - 04:39 PM
zero_cool #1
Posted 16 July 2013 - 06:39 PM
I'd like to get into GUIs on advanced monitors. I know you do that by using spaces with certain background colours. But what is the aspect ratio of such a "pixel" or a character in CC?
Grim Reaper #2
Posted 16 July 2013 - 07:06 PM
The aspect ratio of pixels that you can actually manipulate in ComputerCraft is 1:1. You can increase the width and height of your monitor, but the aspect ratio will remain the same, I believe.
zero_cool #3
Posted 16 July 2013 - 07:16 PM
No it's not. The "pixels" are no squares.

PS: Space Cows OP
Grim Reaper #4
Posted 16 July 2013 - 07:19 PM
Sorry, I guess? This was the definition of aspect ratio which I found:

The aspect ratio of an image describes the proportional relationship between its width and its height.

So, since you can only write one character at a time, being spaces for pixels, with a single text color and background color, the pixel's aspect ratio would be 1:1, right? What is it, if this is wrong? I'm genuinely confused.
Cranium #5
Posted 16 July 2013 - 07:23 PM
I think he is talking about the width and height of each individual pixel. If so, I'm not sure, but it's very easy to test. If you're referring to the amount of pixels, the default setting in the config is 19 tall by 52 wide
Grim Reaper #6
Posted 16 July 2013 - 07:24 PM
What would be the width and height of a single pixel? How would you measure that, in terms of units? I had always thought that you measured the screen size in pixels as the unit of measurement, not micro-meters or something else :P/>
zero_cool #7
Posted 16 July 2013 - 07:45 PM
Ninja Scripter is right, I want to know the size of a single pixel.

There actually are units like "dots per inch" or "pixels per inch" which are commonly used but in that case a certain unit isn't necessary because the aspect ratio matters and it has no unit at all.

EDIT: Okay, i thought you could determine it by the font's pixels but unfurtunately the characters have weird padding which is smaller than a font's pixel. It looks like it's half a pixel but I can't really confirm that…
n1ghtk1ng #8
Posted 16 July 2013 - 07:57 PM
What do you mean by pixels? Do you mean like scale related to the computer?
zero_cool #9
Posted 16 July 2013 - 08:07 PM
Well, I mean the smallest possible rectangle you can draw, like this:


monitor.setBackgroundColor(colors.red)
monitor.write(" ")

whats the aspect ratio of that red dot?
MysticT #10
Posted 16 July 2013 - 09:32 PM
Copied from the CC source:

public static int FONT_HEIGHT = 9;
public static int FONT_WIDTH = 6;
That's for terminal characters/pixels, but I guess it's the same aspect ratio for monitors.
zero_cool #11
Posted 16 July 2013 - 09:44 PM
Yeah, thanks, that seems to be right.
I was way too much focused on monitors :D/>
I just took a screenshot of the computer terminal and a pixel there is 36 by 24 :)/>

Thanks for the help everybody :)/>