Jump to content

Scaling


Recommended Posts

  • Scripting Moderators

Hey, i come across problem of scaling things. I am looking for best way to make it. Maybe there's some other ways to do it, excluding this:

1.

local screenX, screenY = guiGetScreenSize()

-- screenX * size/base X

The way above isn't good, on less resolutions some things are incorrect.

 

2.

local screenX, screenY = guiGetScreenSize()
local baseX = 1280
local zoom = 1 
local minZoom = 2 
if screenX < baseX then zoom = math.min(minZoom, baseX/screenX) end

This way probably is best so far, the problem is that i use it most likely in bad way, because positions for GUI aren't correct.

 

3. Or there's another, good way? Or i am doing this incorrect.

Link to comment
  • Moderators

@majqq

Scaling over the X axis? We do not play MTA on a  smartphone you know? (Yes, we want to)

 

For position? Sure!

Scaling? No!

 

The only thing that matters is comparing the same thing with the same thing.

Square! That is something we can work with. Out of every MTA screen format we can make the exact same square from the y axis with a different amount of pixels. This is something we can scale up and down!

If we are doing that with the X axis, then we are missing some pixels which we can't take in to account and it will look bad.

 

 

The only things that are going to be different per computer:

  • How sharp things are looking.
    So it might be handy to scale text down to a limit of 80%.
     
  • The pixel size of your monitor. (which not even your computer knows)


 

Edited by IIYAMA
  • Like 1
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...