playMaker

Author Topic: Screen Resolution actions  (Read 6460 times)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Screen Resolution actions
« 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

gecko

  • Junior Playmaker
  • **
  • Posts: 51
    • View Profile
Re: Screen Resolution actions
« Reply #1 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?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: Screen Resolution actions
« Reply #2 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

Gua

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Andrii Vintsevych
Re: Screen Resolution actions
« Reply #3 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.



I would like to see example or explanation.

Gua

  • Full Member
  • ***
  • Posts: 112
    • View Profile
    • Andrii Vintsevych
Re: Screen Resolution actions
« Reply #4 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.



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"

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: Screen Resolution actions
« Reply #5 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

mweyna

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Screen Resolution actions
« Reply #6 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.

phannDOTde

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • Peter Hann .de
Re: Screen Resolution actions
« Reply #7 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.

mweyna

  • Full Member
  • ***
  • Posts: 242
    • View Profile
Re: Screen Resolution actions
« Reply #8 on: February 25, 2015, 11:43:47 AM »
Hey Jean, do you know if this is tweaked or fixed in Unity 5?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 12344
  • Official Playmaker Support
    • View Profile
Re: Screen Resolution actions
« Reply #9 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

phannDOTde

  • Full Member
  • ***
  • Posts: 233
    • View Profile
    • Peter Hann .de
Re: Screen Resolution actions
« Reply #10 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.