GetScreenCenter
New function "GetScreenCenter" returns the width and the height of the window divided by two.
This commit is contained in:
parent
3101ab4079
commit
51bf8d0820
|
|
@ -1002,6 +1002,7 @@ RLAPI void SetWindowFocused(void); // Set window
|
|||
RLAPI void *GetWindowHandle(void); // Get native window handle
|
||||
RLAPI int GetScreenWidth(void); // Get current screen width
|
||||
RLAPI int GetScreenHeight(void); // Get current screen height
|
||||
RLAPI Vector2 GetScreenCenter(void); // Get the center of the current screen
|
||||
RLAPI int GetRenderWidth(void); // Get current render width (it considers HiDPI)
|
||||
RLAPI int GetRenderHeight(void); // Get current render height (it considers HiDPI)
|
||||
RLAPI int GetMonitorCount(void); // Get number of connected monitors
|
||||
|
|
|
|||
11
src/rcore.c
11
src/rcore.c
|
|
@ -819,6 +819,17 @@ int GetScreenHeight(void)
|
|||
return CORE.Window.screen.height;
|
||||
}
|
||||
|
||||
// Get the center of the current screen
|
||||
Vector2 GetScreenCenter(void)
|
||||
{
|
||||
Vector2 center = (Vector2)
|
||||
{
|
||||
GetScreenWidth() / 2.0f,
|
||||
GetScreenHeight() / 2.0f
|
||||
};
|
||||
return center;
|
||||
}
|
||||
|
||||
// Get current render width which is equal to screen width*dpi scale
|
||||
int GetRenderWidth(void)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user