Is it possible to tell if someone has moved their game window?

I am basically looking for some sort of way to read when someone drags their game window around on their screen. Not resizing it, but simply just moving it around.

I’m aware that it’s possible to read if Roblox’s game window is focused on, and it’s also possible to read the window’s size.

But are there any methods that currently allow developers to read the window’s position relative to the rest of the screen? In theory, this value would always be [0,0] if fullscreen were enabled, or on any non-PC devices.

3 Likes

Nope. The closest thing we have is WindowFocused and WindowFocusReleased. Roblox is really careful with giving players control over things outside of the game itself.

You should go upvote this feature request if you want this added:

3 Likes

I don’t think there’s a way to detect if a user is moving the game window.

Actually, there is a way, albeit a slightly hacky one.

local players = game:GetService("Players")
local starterGui = game:GetService("StarterGui")
local screenGui = starterGui:WaitForChild("ScreenGui")

screenGui:GetSignalPropertyChanged("AbsoluteSize"):Connect(function()
	print("Window size changed!")
end)

If “AbsoluteSize” changes then the player must have resized their window.

5 Likes

Thank you for the response, but I’m looking for a change in position, not size.

1 Like

It could likely indicate both, typically when a player resizes they are repositioning too. Unfortunately properties like “AbsolutePosition” remain unchanged, regardless of the position.

That’s correct. However, I was looking for a consistent method rather than something that only works occasionally:

Yeah, not possible, a lot of user-specific details are hidden from the developer, likely for security reasons.

Does the mouse position show absolute position or relative position when you click on a button? If it’s an absolute position, you can see if a relative position of a button was clicked at a different absolute position.

You can get both the mouse’s absolute and relative position, but unfortunately, this is only helpful for readings within the game’s window and doesn’t detect any sort of movement outside of it.

Here’s what I was thinking:

Last time the button (which is Z pixels wide) was clicked, was at absolute position X, now it is clicked at absolute position Y. X and Y are more than Z pixels apart, so the window was moved. Put this on the smallest GUI button you have, and run the checks on the server in silence.

I don’t know if this would work or not, but it’s the only logic I can think of to capture movement of a window when you can only see inside the window.