jade-engine  0.0
JadeEngine::SpriteParams Struct Reference

#include <Sprite.h>

Inheritance diagram for JadeEngine::SpriteParams:
JadeEngine::BoxSpriteParams

Public Attributes

ObjectLayer layer
 
std::string textureName
 
int32_t z
 
bool spriteSheet
 
std::string spriteSheetName
 

Detailed Description

Parameters required to create a Sprite game object.

See also
Game::Create

Template to copy:

SpriteParams spriteParams;
spriteParams.layer = kObjectLayer_UI;
spriteParams.textureName = "someTexture.png";
spriteParams.z = 0;
spriteParams.spriteSheet = false;
spriteParams.spriteSheetName = "";

Member Data Documentation

◆ layer

ObjectLayer JadeEngine::SpriteParams::layer

Layer that will the Sprite belong to.

See also
ObjectLayer

◆ spriteSheet

bool JadeEngine::SpriteParams::spriteSheet

Whether the texture is part of a sprite-sheet file or stand-alone texture file.

Affects the meaning of textureName.

If true spriteSheetName must be specified.

See also
SpriteParams::textureName

◆ spriteSheetName

std::string JadeEngine::SpriteParams::spriteSheetName

Name of the sprite-sheet corresponding to GameInitParamsSpriteSheetEntry::assetName that was used when initializing the game.

Has no effect if spriteSheet is false.

See also
SpriteParams::spriteSheet

◆ textureName

std::string JadeEngine::SpriteParams::textureName

Name of the texture that will be rendered by the sprite.

In the case of spriteSheet being false, the textureName must corresponds to assetName in GameInitParams::textures that was used when initializing the game. In the case of spriteSheet being true, the textureName must be the name of one of the files that were packed into sprite-sheet - it must be present in sprite-sheet JSON.

Note
If the texture is not found a default bright pink fall-back texture is used.
See also
SpriteParams::spriteSheet

◆ z

int32_t JadeEngine::SpriteParams::z

Z coordinate of the Sprite.

The game objects with higher Z coordinate will be drawn over the ones with lower one.


The documentation for this struct was generated from the following file: