SetPlayerZoom

Kategorie: Spieler / Sicht
Ab Engineversion: 5.0 OC

Beschreibung

Changes zoom or zoom limits vor all viewports of a player to direct values.

Syntax

bool SetPlayerZoom(int player, int zoom, int precision, int flags);

Parameter

player:
Spieler, dessen Zoom oder Zoomgrenzen angepasst werden sollen. NO_OWNER für alle Spieler.
zoom:
New zoom factor. A factor of zero disables direct zoom definition and reverts to the default method of calculating zoom by view range.
precision:
[opt] Value by which zoom is divided to achieve fractional numbers.
flags:
Es sind folgende Kommandos definiert:
Wert Beschreibung
PLRZOOM_Direct Der Zoom scrollt nicht sanft zum neuen Wert, sondern wird direkt gesetzt.
PLRZOOM_NoIncrease The new zoom is only to be set if it is smaller than the current value.
PLRZOOM_NoDecrease The new zoom is only to be set if it is greater than the current value.
PLRZOOM_LimitMin Setzt das minimale Grenze für den Zoom. Der Spieler kann nicht weiter herauszoomen als dieser Wert.
PLRZOOM_LimitMax Setzt das maximale Grenze für den Zoom. Der Spieler kann nicht weiter hineinzoomen als dieser Wert.
PLRZOOM_Set Set the current zoom. This flag is implied if neither PLRZOOM_LimitMin nor PLRZOOM_LimitMax is supplied but can be used if current zoom and limits should be set simultanuously.

Anmerkung

Setting zoom to a direct value causes the game to look different depending on which screen resolution the player has configured. Use this function only if you want to achieve direct pixel correspondance between the game world and the screen, e.g. because your scenario provides low resolution graphics only or because your scenario should be played in certain screen resolutions only. Regular scenarios should use SetPlayerZoomByViewRange to achieve visuals whcih are independent of the player's monitor size.

Beispiel

func InitializePlayer(int plr)
{
  SetPlayerZoom(plr, 1,1, PLRZOOM_LimitMin | PLRZOOM_LimitMax);
  SetPlayerViewLock(plr, true);
  return true;
}
Code for a scenario script: The zoom is fixed to 1, i.e. one landscape pixel corresponds to one pixel on the screen. Zooming in or out is not possible.
Siehe auch: GetPlayerZoomLimits, SetFoW, SetLightRange, SetPlayerViewLock, SetPlayerZoomByViewRange, SetPlrView
Sven2, 2014-03