Playmaker Forum

Playmaker Updates & Downloads => Official Action Updates => Topic started by: jeanfabre on June 11, 2013, 04:25:49 AM

Title: Screen Resolution actions
Post by: jeanfabre on June 11, 2013, 04:25:49 AM
Hi,

 Following a request, please find few actions to work with screen resolutions. The SetResolution action is not tested tho ( I never mess with my screen resolutions :) to begin with ) so if you have problems let me know.

-- ArrayListGetResolutions requires ArrayMaker, you can find it here:
https://hutonggames.fogbugz.com/default.asp?W715
it saves resolution inside a vector3: width,height,refreshRate.

-- GetCurrentResolution works on it own, arrayMaker not required

-- ScreenSetResolution works on it own as well.

GetCurrentResolution and ScreenSetResolution accepts a vector 3 as the resolution (width,height,refreshRate) so that if you use ArrayListGetResolutions, you can simply extract on of the resolution of the arrayList and use it as is without messing with it further.

bye,

 Jean
Title: Re: Screen Resolution actions
Post by: gecko on August 05, 2013, 01:54:26 PM
Get Screen Resolution is exactly what I'm looking for....but how would I use this with Set Guiskin (with several guiskins for different device resolutions)? I don't know how to set/retrieve variables, so if it requires that, I'll go learn about it, but can you give me some guidance?
Title: Re: Screen Resolution actions
Post by: jeanfabre on August 06, 2013, 12:52:33 AM
Hi,

 guiskin is only a system to define how component looks, not how they are placed on screen.

 can you precise what you are after?

bye,

 Jean
Title: Re: Screen Resolution actions
Post by: Gua on October 06, 2014, 03:44:01 AM
I don't understand how to get all list of resolution supported by user PC. The only thing I see when I use ArrayListGetResolutions is this.

(http://i.gyazo.com/dc72e61c5e7bb6956df4f1c80e2d2db0.png)

I would like to see example or explanation.
Title: Re: Screen Resolution actions
Post by: Gua on October 08, 2014, 01:04:14 AM
I don't understand how to get all list of resolution supported by user PC. The only thing I see when I use ArrayListGetResolutions is this.

(http://i.gyazo.com/dc72e61c5e7bb6956df4f1c80e2d2db0.png)

I would like to see example or explanation.

Looks like I've found the core of the problem.

"Screen.resolutions always returns 640x480 in the editor, presumably because there is no particular resolution in the editor; the game window can be anything. In a stand-alone or web player, though, Screen.resolutions does in fact return an array of all resolutions. You can see this in use with various Unity games that have in-game resolution switching (like this one).

--Eric"
Title: Re: Screen Resolution actions
Post by: jeanfabre on October 14, 2014, 05:59:45 AM
Hi,

When I run this, I have 10 items ranging from 640*480 to 1440*900, and I am in editor, on mac.

now when I run it on my pc laptop, I only get one... Maybe this is a bug, I have reported that to Unity, as it's the direct information I am accessing, I don't do anything fancy but just use this call:

http://docs.unity3d.com/ScriptReference/Screen-resolutions.html

Bye,

 Jean


 Bye,

 Jean
Title: Re: Screen Resolution actions
Post by: mweyna on December 24, 2014, 01:43:23 PM
From what I've seen, it looks like it's referencing the Monitor Resolution and not the Unity specific playback resolution. When I've set my desktop to difference sizes it pulls that size appropriately.
Title: Re: Screen Resolution actions
Post by: phannDOTde on February 25, 2015, 11:28:51 AM
just to mention it: under windows "getresolution" returns the monitors desktop resolution not the actual renderwindow - cost me a day until I saw that.
Title: Re: Screen Resolution actions
Post by: mweyna on February 25, 2015, 11:43:47 AM
Hey Jean, do you know if this is tweaked or fixed in Unity 5?
Title: Re: Screen Resolution actions
Post by: jeanfabre on February 25, 2015, 12:10:24 PM
Hi,

 These actions expose the Unity api:

http://docs.unity3d.com/ScriptReference/Resolution.html

 so, I am not sure how this can be fixed or tweaked, but maybe, if you have some links, I could study them and come up with appropriate actions.

Bye,

 Jean
Title: Re: Screen Resolution actions
Post by: phannDOTde on March 10, 2015, 04:04:37 AM
an pretty easy work around is just to get screen width and screen height than you got your actual window res instead of the desktop res.