Potato Engine
Loading...
Searching...
No Matches
GameplayHelper Class Reference

Helper class with useful logic and shorthand functions. More...

#include <GameplayHelper.hpp>

Static Public Member Functions

static Vector2 VecToScreenVec (const Vector2 &worldPos)
 Converts world position to screen position.
static bool IsPositionInCameraFrame (const Vector2 &pos, Camera *camera)
 Checks if a position is visible in the view of a camera object.

Detailed Description

Helper class with useful logic and shorthand functions.

This class is uninstantiable. All helpers are static

Definition at line 11 of file GameplayHelper.hpp.

Member Function Documentation

◆ VecToScreenVec()

Vector2 GameplayHelper::VecToScreenVec ( const Vector2 & worldPos)
static

Converts world position to screen position.

World origin is game-relative (0,0). Screen origin is at the top left corner of the terminal window. Use this function to convert world coordinates to screen-relative

Parameters
worldPosposition to convert
Returns
converted screen position as vector

Definition at line 8 of file GameplayHelper.cpp.

◆ IsPositionInCameraFrame()

bool GameplayHelper::IsPositionInCameraFrame ( const Vector2 & pos,
Camera * camera )
static

Checks if a position is visible in the view of a camera object.

Parameters
posPosition to check
cameraCamera to check for visibility
Returns
true if is in frame

Definition at line 14 of file GameplayHelper.cpp.