Struct GameLayer2DData
Public Attributes
| Type | Name |
|---|---|
| char | atlasFilePath Path of loaded atlas file. |
| bool | bCurrentLocationIsDirty Current location has changed in such a way that it needs to be saved, when a new area is moved to or you sleep. |
| bool | bDebugLayerAttatched flag for whether the debug overlay is pushed on top of the game |
| bool | bFreeLookMode When in this mode the game is paused and you have a different set of controls to freely move the camera around, in future I might add editing. |
| bool | bLoaded mostly pointless |
| bool | bSkipDraw |
| struct Transform2D | camera the one and only camera |
| int | cameraClampedToTilemapLayer Which layer, if any, is the camera clamped to. If it is not clamped (the default) then this should be -1. |
| char | debugMsg A message to display on the screen when the debug overlay is on top of the game2dlayer. |
| struct Entity2DCollection | entities Entities collection. |
| struct FreeLookCameraModeControls | freeLookCtrls controls for free look mode |
| hAtlas | hAtlas handle to atlas containing sprite data |
| HEntity2DQuadtreeNode | hEntitiesQuadTree The top node of a quad tree that holds references to static sprites for culling. |
| HTimer | hNetworkStateUpdateTimer handler for timer that calls G2D_Enqueue_Worldstate_Packet |
| HPhysicsWorld | hPhysicsWorld Physics world handle. |
| LevelDataHandlerExtenderFn | levelDataHandlerExtender AS THE CLIENT : Read extra game specific data the server has written to the initial level data packet. |
| LevelDataPacketExtenderFn | levelDataPacketExtender AS THE SERVER : Write extra game specific data to the level data packet the server sends initially to each client. |
| LevelDataRequestHandlerExtenderFn | levelDataRequestHandlerExtender AS THE SERVER : Read extra game specific data from the level data request packet the client sends to the server. |
| struct GameFrameworkEventListener * | pDebugListener Listens for the debug overlay game framework layer being pushed. |
| DrawContext * | pDrawContext HACK : todo: sort out the availabilty of these draw and input contexts todo: use global getter for draw context. |
| struct GameFrameworkLayer * | pLayer for convenience, a reference back to the layer |
| void * | pUserData Game specific data. |
| PreFirstInitFn | preFirstInitCallback a callback called when the layer is pushed, and the level and all entities are loaded, but have not had their init methods called yet. An opportunity for your game to load sprite handles from the atlas that the entities will use in their init methods. |
| PreLoadLevelFn | preLoadLevelFn |
| struct TileMap | tilemap tilemap comprised of a list of tilemap layers |
| char | tilemapFilePath path of loaded level file |
| struct SDTimerPool | timerPool Use this to register timers that will be called after a given time, optionally on repeat. |
| H2DWorldspaceVertexBuffer | vertexBuffer |
| int | windowH Window height. |
| int | windowW Window width. |
Public Functions
| Type | Name |
|---|---|
| VECTOR (struct Vert2DTexture) buffers of vertices and indices populated each frame |
|
| VECTOR (VertIndexT) |
Public Attributes Documentation
variable atlasFilePath
Path of loaded atlas file.
char GameLayer2DData::atlasFilePath[MAX_GAME_LAYER_ASSET_FILE_PATH_LEN];
variable bCurrentLocationIsDirty
Current location has changed in such a way that it needs to be saved, when a new area is moved to or you sleep.
bool GameLayer2DData::bCurrentLocationIsDirty;
variable bDebugLayerAttatched
flag for whether the debug overlay is pushed on top of the game
bool GameLayer2DData::bDebugLayerAttatched;
variable bFreeLookMode
When in this mode the game is paused and you have a different set of controls to freely move the camera around, in future I might add editing.
bool GameLayer2DData::bFreeLookMode;
variable bLoaded
mostly pointless
bool GameLayer2DData::bLoaded;
variable bSkipDraw
bool GameLayer2DData::bSkipDraw;
variable camera
the one and only camera
struct Transform2D GameLayer2DData::camera;
variable cameraClampedToTilemapLayer
Which layer, if any, is the camera clamped to. If it is not clamped (the default) then this should be -1.
int GameLayer2DData::cameraClampedToTilemapLayer;
variable debugMsg
A message to display on the screen when the debug overlay is on top of the game2dlayer.
char GameLayer2DData::debugMsg[256];
variable entities
Entities collection.
struct Entity2DCollection GameLayer2DData::entities;
variable freeLookCtrls
controls for free look mode
struct FreeLookCameraModeControls GameLayer2DData::freeLookCtrls;
variable hAtlas
handle to atlas containing sprite data
hAtlas GameLayer2DData::hAtlas;
variable hEntitiesQuadTree
The top node of a quad tree that holds references to static sprites for culling.
HEntity2DQuadtreeNode GameLayer2DData::hEntitiesQuadTree;
variable hNetworkStateUpdateTimer
handler for timer that calls G2D_Enqueue_Worldstate_Packet
HTimer GameLayer2DData::hNetworkStateUpdateTimer;
variable hPhysicsWorld
Physics world handle.
HPhysicsWorld GameLayer2DData::hPhysicsWorld;
variable levelDataHandlerExtender
AS THE CLIENT : Read extra game specific data the server has written to the initial level data packet.
LevelDataHandlerExtenderFn GameLayer2DData::levelDataHandlerExtender;
variable levelDataPacketExtender
AS THE SERVER : Write extra game specific data to the level data packet the server sends initially to each client.
LevelDataPacketExtenderFn GameLayer2DData::levelDataPacketExtender;
variable levelDataRequestHandlerExtender
AS THE SERVER : Read extra game specific data from the level data request packet the client sends to the server.
LevelDataRequestHandlerExtenderFn GameLayer2DData::levelDataRequestHandlerExtender;
- extra data is written by extending the G2D_Enqueue_RequestLevelData function by calling G2D_Extend_RequestLevelDataMessage and registering an extender
variable pDebugListener
Listens for the debug overlay game framework layer being pushed.
struct GameFrameworkEventListener* GameLayer2DData::pDebugListener;
variable pDrawContext
HACK : todo: sort out the availabilty of these draw and input contexts todo: use global getter for draw context.
DrawContext* GameLayer2DData::pDrawContext;
variable pLayer
for convenience, a reference back to the layer
struct GameFrameworkLayer* GameLayer2DData::pLayer;
variable pUserData
Game specific data.
void* GameLayer2DData::pUserData;
variable preFirstInitCallback
a callback called when the layer is pushed, and the level and all entities are loaded, but have not had their init methods called yet. An opportunity for your game to load sprite handles from the atlas that the entities will use in their init methods.
PreFirstInitFn GameLayer2DData::preFirstInitCallback;
variable preLoadLevelFn
PreLoadLevelFn GameLayer2DData::preLoadLevelFn;
variable tilemap
tilemap comprised of a list of tilemap layers
struct TileMap GameLayer2DData::tilemap;
variable tilemapFilePath
path of loaded level file
char GameLayer2DData::tilemapFilePath[MAX_GAME_LAYER_ASSET_FILE_PATH_LEN];
variable timerPool
Use this to register timers that will be called after a given time, optionally on repeat.
struct SDTimerPool GameLayer2DData::timerPool;
variable vertexBuffer
H2DWorldspaceVertexBuffer GameLayer2DData::vertexBuffer;
variable windowH
Window height.
int GameLayer2DData::windowH;
variable windowW
Window width.
int GameLayer2DData::windowW;
Public Functions Documentation
function VECTOR [1/2]
buffers of vertices and indices populated each frame
GameLayer2DData::VECTOR (
struct Vert2DTexture
)
function VECTOR [2/2]
GameLayer2DData::VECTOR (
VertIndexT
)
The documentation for this class was generated from the following file /home/runner/work/2DFarmingRPG/2DFarmingRPG/Stardew/engine/include/Game2DLayer.h