GetFullscreenRect

From ZDoom Wiki
Jump to navigation Jump to search
Note: This feature is for ZScript only.


Screen

native static double, double, double, double GetFullscreenRect(double vwidth, double vheight, int fsmode)

Usage

Gets a bounding area correctly scaled to fit the current view port. This can be used to calculate a virtual resolution within it to scale coordinates by or to scale a texture to fill the entire view port.

Parameters

  • vwidth - The width of the bounding box
  • vheight - The height of the bounding box
  • fsmode - The type of fullscreen mode to use when scaling the coordinates
  • FSMode_ScaleToFit - Scale the bounding box to fit the view port with dynamic pillarboxing and letterboxing based on aspect ratio
  • FSMode_ScaleToFill - Scale the bounding box to fit the view port with dynamic cropping based on aspect ratio
  • FSMode_ScaletoFit43 - Scale the bounding box to fit a centered 4:3 area in the view port
  • FSMode_ScaleToScreen - Stretch the bounding box to fill the entire view port
  • FSMode_ScaleToFit43Top - Same as FSMode_ScaleToFit43 but set the bounding box's top to the top of the view port
  • FSMode_ScaleToFit43Bottom - Same as FSMode_ScaleToFit43 but set the bounding box's bottom to the bottom of the view port
  • FSMode_ScaleToHeight - Scale the bounding box to always fit the view port vertically

Return value

Returns four values in the following order:

  • The starting x coordinate of the box in the view port
  • The starting y coordinate of the box in the view port
  • The width of the box
  • The height of the box

Examples

Nuvolachalk.png Note: This article lists no examples. If you make use of this feature in your own project(s) or know of any basic examples that could be shared, please add them. This will make it easier to understand for future authors seeking assistance. Your contributions are greatly appreciated.