Resolution?

Started by Kewun, Jul 06, 2016, 09:06 AM

Previous topic - Next topic

Kewun

How to check a players resolution? I tried with vector screens but i failed :/

Thijn

Why'd you need it?

Just use set your sprites/textdraws to use relative positioning and position them according to a 1024x768 screen

Kewun

i just want to add a notificaton if player joins example
Your resolution: 640x840, We recommend using 1366x768 at least

Thijn

In that case you can't :)

DizzasTeR

You can, unless I misunderstood the question.

Thijn

Right, you can probably use GUI::GetScreenSize() on the clientside to get the screen resolution.

(I've not used client scripts at all so far, so I don't know all functions out of my head yet :P)

Stormeus

Like @Thijn said, you can use GUI::GetScreenSize() to get the player's resolution, and Console::Print(message) to give the player a notice if their resolution is too small.

DizzasTeR

A small example code [client-side]:
function Script::ScriptLoad() {
    local client_resolution = GUI.GetScreenSize()
    local X = client_resolution.X, Y = client_resolution.Y;
    if( X < 1366 && Y < 768 ) {
        Console.Print( "Your resolution: " + X + "x" + Y + ", We recommend using 1366x768 at least" )
    }
}

EK.IceFlake

We should have a GUI.ForceScreenSize or something

DizzasTeR

Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

Nothing could be more useless than this, sorry mate.

Stormeus


KAKAN

#11
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something
if the game would be set to windowed, it would cause problems. Like, a player has a HD monitor, but, I'll set his screen size to 4K, then, he would see a magnified version of the game. I've experienced it when I was using some ASI mods :p
And the well known, Stone age PC.
oh no

EK.IceFlake

Quote from: KAKAN on Jul 09, 2016, 07:03 AM
Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something
if the game would be set to windowed, it would cause problems. Like, a player has a HD monitor, but, I'll set his screen size to 4K, then, he would see a magnified version of the game. I've experienced it when I was using some ASI mods :p
And the well known, Stone age PC.
I know I know its the scripters responsibility

Kewun


Mötley

Quote from: ext-d.CrystalBlue on Jul 08, 2016, 04:49 PMWe should have a GUI.ForceScreenSize or something

LOL!!! You know what this would do to some of use right? Crash our monitors. I happen to be using a really old monitor at the moment and if the games screen is windowed and goes beyond what I can see well better off pressing the reset button on the tower as the monitor goes into sleep mode,. Had this issue with old LCD monitors in the past. So bad Idea unless you want to troll players :D. The concept is kinda cool though ;)