Jump to content




Char/Pixel Aspect Ratio


10 replies to this topic

#1 zero_cool

  • Members
  • 14 posts
  • LocationGermany

Posted 16 July 2013 - 05: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?

#2 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 16 July 2013 - 06: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.

#3 zero_cool

  • Members
  • 14 posts
  • LocationGermany

Posted 16 July 2013 - 06:16 PM

No it's not. The "pixels" are no squares.

PS: Space Cows OP

#4 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 16 July 2013 - 06:19 PM

Sorry, I guess? This was the definition of aspect ratio which I found:

Quote

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.

#5 Cranium

    Ninja Scripter

  • Moderators
  • 4,031 posts
  • LocationLincoln, Nebraska

Posted 16 July 2013 - 06: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

#6 Grim Reaper

  • Members
  • 503 posts
  • LocationSeattle, WA

Posted 16 July 2013 - 06: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

#7 zero_cool

  • Members
  • 14 posts
  • LocationGermany

Posted 16 July 2013 - 06: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...

#8 n1ghtk1ng

  • Members
  • 58 posts

Posted 16 July 2013 - 06:57 PM

What do you mean by pixels? Do you mean like scale related to the computer?

#9 zero_cool

  • Members
  • 14 posts
  • LocationGermany

Posted 16 July 2013 - 07: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?

#10 MysticT

    Lua Wizard

  • Members
  • 1,597 posts

Posted 16 July 2013 - 08: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.

#11 zero_cool

  • Members
  • 14 posts
  • LocationGermany

Posted 16 July 2013 - 08: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 :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users