generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Detecting window size changes

Previous Thread :: Next Thread 
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 05:59 PM
Any way of doing so?

Currently i'm using the move event of the mouse to re-calculate positions and sizes of GUIs for each time the window re-sizes (this is so that round things can stay round and so items won't become deformed). Using the mouse gives an un-professional look as when the mouse exists the window (say to re-size the window) movement is not detected, thus leaving the GUIs in a messed up state.

Is there any event that might be of use?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2013 06:00 PM
Well, not sure if this helps but:

The scale sizing options make it "compatable" with all screen sizes.
Report Abuse
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 06:02 PM
But is terribad for GUIs that you don't want deformed (such as circles).
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
24 Jul 2013 06:03 PM
True, hmm, I think one of the Roblox admins made a converter.
Other than that, to get screen size, I would think there is a method using the mouse.

Matbe Mouse.ViewSizeX/Y?
Report Abuse
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 06:05 PM
That's not the issue. I've explained the problem in the first post.
Report Abuse
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 06:20 PM
b1
Report Abuse
RoyStanford is not online. RoyStanford
Joined: 21 Oct 2008
Total Posts: 2222
24 Jul 2013 06:24 PM
I would use the changed event of a gui that has a position of UDim2.new(1,0,1,0) and then if that changes check to see if the AbsolutePosition changed, if so the window was resized.
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
24 Jul 2013 06:30 PM
ScreenGui.Changed:connect(function()
end)
Report Abuse
Ludici is not online. Ludici
Joined: 22 Jul 2013
Total Posts: 640
24 Jul 2013 06:34 PM
Lol crazyman just comes and makes it the simplest thing that anyone could come up with.

postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1
Report Abuse
crazyman32 is not online. crazyman32
Joined: 13 Apr 2008
Total Posts: 18027
24 Jul 2013 06:43 PM
:)
Any time the window is changed, the AbsoluteSize of a ScreenGui changes, therefore triggering the Changed event.

local screen = SOME_SCREENGUI

function GetAspectRatio()
return (screen.AbsoluteSize.x/screen.AbsoluteSize.y)
end

screen.Changed:connect(function()
print("Aspect ratio: " .. GetAspectRatio())
end
Report Abuse
Ludici is not online. Ludici
Joined: 22 Jul 2013
Total Posts: 640
24 Jul 2013 06:55 PM
Ahh there we go. That's more of an answer crazyman would give. Btw I'm making awesome edits to your plane kit. I love you for making that dude.

postCount=GetService("NetworkService"):findFirstChild("postCount") postCount = postCount+1
Report Abuse
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 07:42 PM
Thanks.
Report Abuse
stroudie is not online. stroudie
Joined: 28 Nov 2008
Total Posts: 2556
24 Jul 2013 07:47 PM
Now this is strange. It seems that only resizing the window in the X-axis makes it update the GUI. I believe the precise problem is ViewSizeY not updating, rather than the event not triggering.

You can see what I mean: http://www.roblox.com/Testing-Place-place?id=51028805
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image