Playmaker Forum
PlayMaker Updates & Downloads => Official Action Updates => Topic started by: jeanfabre on June 11, 2013, 07: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
-
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?
-
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
-
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.
-
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"
-
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
-
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.
-
just to mention it: under windows "getresolution" returns the monitors desktop resolution not the actual renderwindow - cost me a day until I saw that.
-
Hey Jean, do you know if this is tweaked or fixed in Unity 5?
-
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
-
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.
-
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
Hi Jean,
I know this post is really old but I cant seem to find anything else on the net about this.
I am also having the same problem. Though in my case, when I run it on a standalone I am getting 15 items. But when I run it in the editor, I only get 5 items. I have three monitors. My guess is this action is getting the resolution for ALL THREE monitors. (which explains having multiple same res)
Do you think that's the cause? If so, is there a way to fix this?
-
Hi,
As mentionned earlier, these actions only returns what Unity is providing or being provided by the OS... There is nothing much we can do here. Have you contacted Unity about this?
Bye,
Jean
-
Using resolutions directly can be tricky though with all these canvas scalers.
-
I'm having issue with ArrayListGetResolutions in Unity 2018.4.5. It worked fine in Unity 5.6. It works fine in editor. But in a build I get duplicate resolutions. Here's demonstration of the issue (enable sound to get full picture).
Maybe this topic can help fix this action?
https://forum.unity.com/threads/screen-resolutions-returns-duplicate-entries-on-unity-5-5-3.467912/
Here's what happens there
https://i.gyazo.com/ee444b7ed0ac136be4d1c64d9429e63c.png
-
Hi,
ok, pushed a new version of ArrayMaker on the Ecosystem, can you check it out, it features the mods you suggests, which I think is good.
Bye,
Jean
-
Oops. In my previous post I've attached wrong file, so I've deleted it. Here's correct file
I'm not much of the a coder, but by reading on this issue and experimenting, I was able to fix this action. Fixed version is in attachment.
-
Hi,
I just pushed a version on the Ecosystem fixing this.
Bye,
Jean
-
Thanks for this 8) I set my android project to 540p to support down to snapdragon 400 series devices:)