Jump to content




Ideas Monitor Text Scaling


  • You cannot reply to this topic
8 replies to this topic

#1 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 03:25 AM

Ok so I've made a program for a monitor (some of you know what it is) and I'm wanting it to try fill the monitor no matter the size with the text through text scaling. The total size of the render is 19x4 pixels... All attempts at doing an auto scale has not worked. Anyone got any ideas for a formula to calculate the text scale to set based off the size of the monitor?

#2 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 25 March 2013 - 04:13 AM

Well, it depends on how many characters you have on your monitor.

Then you can do it line based:

chars / width. You will get a number and then you have to round it to the closest scale. I dont have to tell you what scales there available, do I?

:P

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 04:18 AM

View PostEngineer, on 25 March 2013 - 04:13 AM, said:

Well, it depends on how many characters you have on your monitor.

Then you can do it line based:

chars / width. You will get a number and then you have to round it to the closest scale. I dont have to tell you what scales there available, do I?

:P
iirc its 0.5 — 5 yeh?

whats the largest screen char width (its been too long since I've actually played)?

#4 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 25 March 2013 - 04:32 AM

Yea thats right.

On max text scale: Posted Image

I felt like doing that :P

#5 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 04:59 AM

hmmm odd. the formula I used before is now working... wonder what I did different this time...

#6 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 25 March 2013 - 05:02 AM

What formula were you using? If you dont want it public, PM :)

#7 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 05:22 AM

Just the way you said before
local mw, mh = monitorObj.getSize()
local scale = mw / 19
if scale > 5 then scale = 5 end
if scale < 0.5 then scale = 0.5 end
monitorObj.setTextScale(scale)


#8 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 25 March 2013 - 05:25 AM

:D

#9 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 March 2013 - 05:43 AM

View PostEngineer, on 25 March 2013 - 05:25 AM, said:

:D
:D

API is now released :D





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users