Slippers Engine
 
Loading...
Searching...
No Matches
ImageManager Class Reference

Singleton responisble for loading and retrieving images. More...

#include <ImageManager.h>

Collaboration diagram for ImageManager:
Collaboration graph

Public Types

enum class  DefaultImages { STITCH }
 Collection of Preloaded Images. More...
 

Static Public Member Functions

static void Load (const MapKey &key, Texture *tex)
 Image Model with KEY and TEXTURE.
 
static void Load (const MapKey &key, Texture *tex, Rect *r)
 Load Image with KEY, TEXTURE and R.
 
static Image * GetImage (const MapKey &key)
 Returns image pointer with given KEY.
 
static Image * GetImage (DefaultImages key)
 Returns image pointer from DEFAULTIMAGES.
 

Private Types

using MapKey = std::string
 KEYS stored as STRINGS.
 

Detailed Description

Singleton responisble for loading and retrieving images.

Member Typedef Documentation

◆ MapKey

using ImageManager::MapKey = std::string
private

KEYS stored as STRINGS.

Member Enumeration Documentation

◆ DefaultImages

enum class ImageManager::DefaultImages
strong

Collection of Preloaded Images.

Enumerator
STITCH 

Member Function Documentation

◆ GetImage() [1/2]

static Image * ImageManager::GetImage ( const MapKey & key)
static

Returns image pointer with given KEY.

A function that returns a image pointer based on a user generated key. Checks if key already exists.

Parameters
key
Returns
Image*

◆ GetImage() [2/2]

static Image * ImageManager::GetImage ( DefaultImages key)
static

Returns image pointer from DEFAULTIMAGES.

A function that returns a image pointer based on the enum class DefaultModels.

Parameters
key
Returns
Image*

◆ Load() [1/2]

static void ImageManager::Load ( const MapKey & key,
Texture * tex )
static

Image Model with KEY and TEXTURE.

A function that creates an image based on a given texture. Images center gets defaulted to the center of the texture. Width and height are defaulted to the texture's width and height. Checks for repeated key use.

Parameters
key
tex

◆ Load() [2/2]

static void ImageManager::Load ( const MapKey & key,
Texture * tex,
Rect * r )
static

Load Image with KEY, TEXTURE and R.

A function that creates an image based on a given texture. R's x and y represent the image's center. R's Z and W represent the width and height in pixels. Checks for repeated key use.

Parameters
key
tex
r