Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Get the player's screen size?

I know getting the AbsoluteSize of a ScreenGui inside the player's PlayerGui can achieve this, but what if you need to get the size of the screen, without relying on a GUI's AbsoluteSize property? Is there any other way to do this?

1 comment

0

I don't think so, as of now

1 answer

✓ Accepted answer

You can get the screen size through the ViewSizeX and ViewSizeY properties of the player's mouse.

Here's an example:

local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

mouse.Button1Down:connect(function()
	print(mouse.ViewSizeX .."x" ..mouse.ViewSizeY)
end)

Assuming the size of the game window is 800x600, this would print:

800x600

Keep in mind, this represents the size of the game window, not the necessarily the full screen. Hope this helped.

This discussion is preserved as it was. New answers, comments, and votes are closed.