getResolution: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(example)
(Page refresh)
Line 1: Line 1:
{{Command|= Comments
{{Command|Comments=
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2oa |= Game name
| arma2oa |Game name=


|1.55|= Game version
|1.55|Game version=
____________________________________________________________________________________________
____________________________________________________________________________________________


| Returns an array containing all information about resolution.
| Returns an array containing all information about resolution.
<br>
{{Feature Arma3|'''Render resolution''' is not returned by this command.<br>
The returned [[Array]] is as follow: [width, height, 2D viewport width, 2D viewport height, aspect ratio, UI scale]
A setting of '''50%''' means half of native width ''and'' half of native height, resulting in a render resolution of '''''25%''''' the original resolution.}}
<br>
|Description=
Note: <em>aspect ratio and UI scale are returned as coefficients and not 16:9 for example.</em>|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| '''getResolution''' |= Syntax
| [[getResolution]] |Syntax=


| [[Array]] |= Return value
| [[Array]] - to format [width, height, uiViewPortWidth, uiViewPortHeight, aspectRatio, uiScale]
{{Informative|aspect ratio is returned as a coefficient:
* 16/9 {{=}} 1.777777(…)
* 4/3 {{=}} 1.333333(…)
* triple screen 16/9 {{=}} 5.333333(…)}}
|Return value=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>_res = [[getResolution]]; //some single monitor setup</code>
|x1= <code>_res = [[getResolution]]; {{codecomment|// a 16/9 single monitor setup}}</code>
<code>[
<code>[
1360, //width
1360, {{codecomment|// width}}
768, //height
768, {{codecomment|// height}}
867, //2D viewport width
867, {{codecomment|// 2D viewport width}}
653, //2D viewport height
653, {{codecomment|// 2D viewport height}}
1.77778, //aspect ratio
1.77778, {{codecomment|// aspect ratio}}
0.85 //UI scale
0.85 {{codecomment|// UI scale}}
]</code> |= |=  
]</code> |Example 1=
|x2= <code>_res = [[getResolution]];  //dedicated server</code>
|x2= <code>_res = [[getResolution]];  {{codecomment|// dedicated server}}</code>
<code>[
<code>[
160, //width
160, {{codecomment|// width}}
120, //height
120, {{codecomment|// height}}
136, //2D viewport width
136, {{codecomment|// 2D viewport width}}
102, //2D viewport height
102, {{codecomment|// 2D viewport height}}
1.33333, //aspect ratio
1.33333, {{codecomment|// aspect ratio}}
0.85 //UI scale
0.85 {{codecomment|// UI scale}}
]</code> |=  
]</code> |Example 2=
|x3= <code>_res = [[getResolution]]; //some triple monitor setup</code>
|x3= <code>_res = [[getResolution]]; {{codecomment|// a triple 16/9 monitor setup}}</code>
<code>[
<code>[
5760, //width
5760, {{codecomment|// width}}
1080, //height
1080, {{codecomment|// height}}
792, //2D viewport width
792, {{codecomment|// 2D viewport width}}
594, //2D viewport height
594, {{codecomment|// 2D viewport height}}
5.33333, //aspect ratio
5.33333, {{codecomment|// aspect ratio}}
0.55 //UI scale
0.55 {{codecomment|// UI scale}}
]</code> |=
]</code> |Example 3=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[worldToScreen]], [[screenToWorld]] |= See also
| [[worldToScreen]], [[screenToWorld]], [[safeZoneX]], [[safeZoneY]], [[safeZoneW]], [[safeZoneH]] |See also=
}}
}}


Line 56: Line 60:
<dd class="notedate">Posted on  05:38, 20 December 2010</dd>
<dd class="notedate">Posted on  05:38, 20 December 2010</dd>
<dt class="note">[[User:Tom 48 97|tom_48_97]]</dt>
<dt class="note">[[User:Tom 48 97|tom_48_97]]</dt>
<dd class="note">This command can be usefull to play a video (see this function [[BIS_fnc_playVideo]]) in the given format if you've compiled it for different UI scale.</dd>
<dd class="note">This command can be useful to play a video (see this function [[BIS_fnc_playVideo]]) in the given format if you have compiled it for different UI scale.</dd>
<!-- Note Section END -->
<!-- Note Section END -->
</dl>
</dl>
Line 64: Line 68:
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]
[[Category:ArmA 2 OA: New Scripting Commands List|{{uc:{{PAGENAME}}}}]]

Revision as of 14:48, 17 January 2019

Hover & click on the images for description

Description

Description:
Returns an array containing all information about resolution. Template:Feature Arma3
Groups:
Uncategorised

Syntax

Syntax:
getResolution
Return Value:
Array - to format [width, height, uiViewPortWidth, uiViewPortHeight, aspectRatio, uiScale]
aspect ratio is returned as a coefficient:
  • 16/9 = 1.777777(…)
  • 4/3 = 1.333333(…)
  • triple screen 16/9 = 5.333333(…)

Examples

Example 1:
_res = getResolution; // a 16/9 single monitor setup [ 1360, // width 768, // height 867, // 2D viewport width 653, // 2D viewport height 1.77778, // aspect ratio 0.85 // UI scale ]
Example 2:
_res = getResolution; // dedicated server [ 160, // width 120, // height 136, // 2D viewport width 102, // 2D viewport height 1.33333, // aspect ratio 0.85 // UI scale ]
Example 3:
_res = getResolution; // a triple 16/9 monitor setup [ 5760, // width 1080, // height 792, // 2D viewport width 594, // 2D viewport height 5.33333, // aspect ratio 0.55 // UI scale ]

Additional Information

See also:
worldToScreenscreenToWorldsafeZoneXsafeZoneYsafeZoneWsafeZoneH

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note

Notes

Posted on 05:38, 20 December 2010
tom_48_97
This command can be useful to play a video (see this function BIS_fnc_playVideo) in the given format if you have compiled it for different UI scale.

Bottom Section