Category: Player
/ View
Since engine version: 5.0 OC
GetPlayerZoomLimits
Description
Returns currently set zoom limits for a player. The return value is a proplist with the following properties:
Property | Description |
---|---|
MaxWidth | Maximum width of landscpe in viewport, i.e. how far the player can view if zoomed out as far as possible. May be zero if MaxHeight is nonzero and zoom limits are determined by maximum view height only. |
MaxHeight | Maximum height of landscpe in viewport. May be zero if MaxWidth is nonzero. |
MinWidth | Minimum width of landscpe in viewport, i.e. how far the player can view if zoomed in as far as possible. May be zero if MinHeight is nonzero and zoom limits are determined by minimunm view height only. |
MinHeight | Minimum height of landscpe in viewport. May be zero if MinWidth is nonzero. |
MaxValue | Maximum zoom if set as a direct pixel-to-landscape correspondance value using SetPlayerZoom function. Zero if a direct zoom value is not specified. |
MinValue | Minimum zoom if set as a direct pixel-to-landscape correspondance value using SetPlayerZoom function. Zero if a direct zoom value is not specified. |
Syntax
proplist GetPlayerZoomLimits(int player);
Parameter
- player:
- Player whose zoom limits are queried.
Remark
It is currently not possible to query the current zoom because these values are not synchronized.
Example
func ReduceSight(int player) { var zoom_limits = GetPlayerZoomLimits(player); SetPlayerZoomByViewRange(player, zoom_limits.MaxWidth/2, zoom_limits.MaxHeight/2, PLRZOOM_LimitMax); return true; }
Halves the view range of a player.
See also: SetPlayerZoom, SetPlayerZoomByViewRange