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
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: getting the screen resolution?

Previous Thread :: Next Thread 
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:44 PM
Is there a way I can do this?
I'm trying to make a third person camera, I was thinking if I got the screen resolution and divided the X and Y by 180 I could make it work.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Mar 2015 05:45 PM
GUI.AbsoluteSize
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:46 PM
That returns Vector2.new(0,0) >.>
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:48 PM
I just noticed, I'd be locking the mouse, I need to get the speed in which the mouse is moving. o3o
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Mar 2015 05:48 PM
Are you using a local script? How do you expect the server to know the size of a client's screen c:
Report Abuse
WebGL3D is online. WebGL3D
Joined: 04 Sep 2013
Total Posts: 28311
17 Mar 2015 05:48 PM
@drah it will return the screen resolution, but only for LocalScript, as it is a client-sided property.


~ 1Topcop ~ WebGL3D ~ Java3D ~ Data3D ~ Purple Squid >
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:50 PM
I normal use local scripts. o3o

Btw in a local script:

g = Instance.new("ScreenGui")
print(g.AbsoluteSize)

>(0,0)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Mar 2015 05:51 PM
You need to actually parent it, and if it still doesn't work add a wait() or something.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:52 PM
Yeah, I just noticed that. :p
Anyways, I don't even need it, As I noticed I need to get the speed in which the mouse is moving rather than the position of the mouse.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:56 PM
The wiki has nothing on getting the speed in which the mouse is moving. o3o
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Mar 2015 05:56 PM
well store the position of the mouse coords, wait x seconds and get the current position. v = displacement/time waited
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 05:58 PM
But The mouse will be locked.
It's coords will always be (0,0)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
17 Mar 2015 05:58 PM
Well check for the camera since that moves :)
Report Abuse
MrJoeyJoeJoey is not online. MrJoeyJoeJoey
Joined: 20 Aug 2011
Total Posts: 20787
17 Mar 2015 05:59 PM
you take the mouse maxscreen whatever and then you ahve to divide the delta by that or do something else or big screens = slow af
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 06:00 PM
What?
You mean like
Mouse.Move:connect(function()
--Something to do with the camera?
end)
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 06:03 PM
I currently have
local g = Instance.new("ScreenGui",game.Players.LocalPlayer)
local Size = g.AbsoluteSize
g:Destroy()
while wait(1/60) do
local mPos = Vector2.new(mouse.X,mouse.Y)
--print(mPos)
cam.CoordinateFrame = Player.Core.CFrame*CFrame.new(0,3,12)*CFrame.fromEulerAnglesXYZ(Size.Y-mPos.Y/180,Size.X-mPos.X/180,0)
end

but This has nothing to do with the mouse movement speed.
Report Abuse
kert109 is not online. kert109
Joined: 31 Dec 2009
Total Posts: 681
17 Mar 2015 06:20 PM
Didn't read anything in between the post.


Roblox will be coming out with lots of functions for the camera, one letting you get the screen size.

I don't want to say much yet, but that's one of them.

For now, you can use Mouse.X and Mouse.Y for the screen size.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 06:23 PM
I don't need the screen size though, I need the mouse speed. o3o
Report Abuse
kert109 is not online. kert109
Joined: 31 Dec 2009
Total Posts: 681
17 Mar 2015 06:25 PM
From the wiki:

Game:GetService("UserInputService").MouseBehavior = Enum.MouseBehavior.LockCenter
Game:GetService("UserInputService").InputChanged:connect(function(inputObject)
if inputObject.UserInputType == Enum.UserInputType.MouseMovement then
print("delta is (" .. tostring(inputObject.Delta.x) .. ", " .. tostring(inputObject.Delta.y) .. ")")
end
end)


Delta is what your looking for.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 06:33 PM
Thanks.

while wait(1/60) do
game:GetService("UserInputService").InputChanged:connect(function(inputObject)
cam.CoordinateFrame = Player.Core.CFrame*CFrame.new(0,5,-3)
cam.CoordinateFrame = cam.CoordinateFrame*CFrame.fromEulerAnglesXYZ(inputObject.Delta.x/10,inputObject.Delta.y/10,0)
end)
end

It's buggy, but I'll figure it out.
Report Abuse
drahsid5 is not online. drahsid5
Joined: 13 May 2011
Total Posts: 3937
17 Mar 2015 06:59 PM
I can't seem to get it to stay at the angle it returns to (0,0) (Even though I add it too the lookVector?)

while wait(1/60) do
game:GetService("UserInputService").InputChanged:connect(function(inputObject)
cam.CoordinateFrame = (Player.Core.CFrame+Vector3.new(0,4,3))*(CFrame.fromEulerAnglesXYZ(inputObject.Delta.y/10,inputObject.Delta.x/10*-1,0)+cam.CoordinateFrame.lookVector)
print("delta is (" .. tostring(inputObject.Delta.x) .. ", " .. tostring(inputObject.Delta.y) .. ")")
end)
end
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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