JugiMap Framework
Layer Class Reference

The Layer class is the base class for layers. More...

#include <jmLayers.h>

Inherited by DrawingLayer, SpriteLayer, and VectorLayer.

Public Member Functions

 Layer ()
 Constructor. More...
 
virtual void InitLayerParameters ()
 Initialize layer properties from the parameters set in the editor. More...
 
virtual void InitEngineObjects ()
 Initialize all engine objects related to this layer and its content. More...
 
virtual void UpdateEngineObjects ()
 Update all engine objects related to this layer and its content. More...
 
virtual void DrawEngineObjects ()
 Draw all engine objects related to this layer and its content. More...
 
MapGetMap ()
 Returns a Map object where this layer is stored. More...
 
ComposedSpriteGetParentComposedSprite ()
 Returns a ComposedSprite where this layer is stored or nullptr if it is stored in a map. More...
 
bool IsMapLayer ()
 Returns true if this layer is stored in a Map; if it's stored in a ComposedSprite returns false. More...
 
LayerKind GetKind ()
 Returns the kind of this layer. More...
 
std::string GetName ()
 Returns the name of this layer. More...
 
std::vector< jugimap::Parameter > & GetParameters ()
 Returns a reference to the vector of stored paramters in this layer. More...
 
int GetZOrder ()
 Returns the zOrder of this layer. More...
 
virtual void UpdateBoundingBox ()
 Update the map bounding box of this layer. More...
 
Rectf GetBoundingBox ()
 Returns the map bounding box of this layer. More...
 
LayerType GetLayerType ()
 Returns the LayerType factor of this layer. More...
 
StretchingVariant GetStretchingVariant ()
 Returns the AlignX factor of this layer. More...
 
Vec2i GetAlignPosition ()
 Returns the allign position factor of this layer. More...
 
Vec2f GetAlignOffset ()
 Returns the allign offset factor of this layer. More...
 
Vec2f GetLayersPlaneSize ()
 Returns the layers plane size of this layer. More...
 
Vec2f GetParallaxFactor ()
 Returns the ParallaxLayerMode factor of this layer. More...
 
Vec2f GetParallaxOffset ()
 Returns the parallax offset of this layer. More...
 
void _SetName (const std::string &_name)
 Returns the ScreenLayerMode factor of this layer. More...
 
void _SetKind (LayerKind _kind)
 Sets the kind of this layer to the given *_kind*. More...
 
void _SetLayerType (LayerType _layerType)
 Sets the layer mode of this layer to the given *_layerType*. More...
 
void _SetParallaxFactor (Vec2f _parallaxFactor)
 Sets the parallax factor of this layer to the given *_parallaxFactor*. More...
 
void _SetAlignPosition (Vec2i _alignPosition)
 Sets the align position of this layer to the given *_alignPosition*. More...
 
void _SetAlignOffset (Vec2f _alignOffset)
 Sets the align offset of this layer to the given *_alignOffset*. More...
 
void _SetAttachToLayer (std::string _attachToLayer)
 Sets the 'attachToLayer' of this layer to the given *_attachToLayer*. More...
 
void _SetStretchingVariant (StretchingVariant _stretchingVariant)
 Sets the stretching variant of this layer to the given *_stretchingVariant*. More...
 
void _SetZOrder (int _zOrder)
 Sets the z-order factor of this layer to the given *_zOrder*. More...
 

Protected Member Functions

virtual ~Layer ()
 Destructor. More...
 

Detailed Description

The Layer class is the base class for layers.

Constructor & Destructor Documentation

◆ Layer()

Layer ( )
inline

Constructor.

◆ ~Layer()

virtual ~Layer ( )
inlineprotectedvirtual

Destructor.

Member Function Documentation

◆ InitLayerParameters()

void InitLayerParameters ( )
virtual

Initialize layer properties from the parameters set in the editor.

This function should usually not be used manually as it gets called in the Map::InitMapParameters function.

Reimplemented in VectorLayer, and SpriteLayer.

◆ InitEngineObjects()

virtual void InitEngineObjects ( )
inlinevirtual

Initialize all engine objects related to this layer and its content.

This function should usually not be used manually as it gets called in the Map::InitEngineMap function.

Reimplemented in SpriteLayer, and DrawingLayer.

◆ UpdateEngineObjects()

virtual void UpdateEngineObjects ( )
inlinevirtual

Update all engine objects related to this layer and its content.

This function should usually not be used manually as it gets called in the Map::UpdateEngineMap function.

Reimplemented in VectorLayer, SpriteLayer, SpriteLayerAGK, and DrawingLayer.

◆ DrawEngineObjects()

virtual void DrawEngineObjects ( )
inlinevirtual

Draw all engine objects related to this layer and its content.

This function should usually not be used manually as it gets called in the Map::DrawEngineMap function. It is needed only for the engines which do not handle drawing (rendering) internally.

Reimplemented in SpriteLayer.

◆ GetMap()

Map* GetMap ( )
inline

Returns a Map object where this layer is stored.

If this layer is stored in a ComposedSprite it will returns the map where this composed sprite is located.

◆ GetParentComposedSprite()

ComposedSprite* GetParentComposedSprite ( )
inline

Returns a ComposedSprite where this layer is stored or nullptr if it is stored in a map.

◆ IsMapLayer()

bool IsMapLayer ( )
inline

Returns true if this layer is stored in a Map; if it's stored in a ComposedSprite returns false.

◆ GetKind()

LayerKind GetKind ( )
inline

Returns the kind of this layer.

◆ GetName()

std::string GetName ( )
inline

Returns the name of this layer.

◆ GetParameters()

std::vector<jugimap::Parameter>& GetParameters ( )
inline

Returns a reference to the vector of stored paramters in this layer.

◆ GetZOrder()

int GetZOrder ( )
inline

Returns the zOrder of this layer.

The zOrder is usable in engines where we set drawing order via zOrder factor.

◆ UpdateBoundingBox()

virtual void UpdateBoundingBox ( )
inlinevirtual

Update the map bounding box of this layer.

Reimplemented in VectorLayer, and SpriteLayer.

◆ GetBoundingBox()

Rectf GetBoundingBox ( )
inline

Returns the map bounding box of this layer.

◆ GetLayerType()

LayerType GetLayerType ( )
inline

Returns the LayerType factor of this layer.

This factor is used for layers stored in parallax maps.

◆ GetStretchingVariant()

StretchingVariant GetStretchingVariant ( )
inline

Returns the AlignX factor of this layer.

This factor is used for layers stored in parallax maps and screen maps.

Returns the AlignY factor of this layer.

This factor is used for layers stored in parallax maps and screen maps.

◆ GetAlignPosition()

Vec2i GetAlignPosition ( )
inline

Returns the allign position factor of this layer.

This position is used for layers stored in parallax maps and screen maps.

◆ GetAlignOffset()

Vec2f GetAlignOffset ( )
inline

Returns the allign offset factor of this layer.

This factor is used for layers stored in parallax maps and screen maps.

◆ GetLayersPlaneSize()

Vec2f GetLayersPlaneSize ( )
inline

Returns the layers plane size of this layer.

This factor is used for layers stored in parallax maps and screen maps.

◆ GetParallaxFactor()

Vec2f GetParallaxFactor ( )
inline

Returns the ParallaxLayerMode factor of this layer.

This factor is used for layers stored in parallax maps.

Returns the parallax factor of this layer.

This factor is used for layers stored in parallax maps.

◆ GetParallaxOffset()

Vec2f GetParallaxOffset ( )
inline

Returns the parallax offset of this layer.

The parallax offset is an extra offset added to the sprites position. This factor is used for layers stored in parallax maps.

◆ _SetName()

void _SetName ( const std::string &  _name)
inline

Returns the ScreenLayerMode factor of this layer.

This factor is used for layers stored in screen maps.

Sets the name of this layer to the given *_name*.

This function is available for the cases where we manually create layers.

◆ _SetKind()

void _SetKind ( LayerKind  _kind)
inline

Sets the kind of this layer to the given *_kind*.

This function is available for the cases where we manually create layers.

◆ _SetLayerType()

void _SetLayerType ( LayerType  _layerType)
inline

Sets the layer mode of this layer to the given *_layerType*.

This function is available for the cases where we manually create layers.

◆ _SetParallaxFactor()

void _SetParallaxFactor ( Vec2f  _parallaxFactor)
inline

Sets the parallax factor of this layer to the given *_parallaxFactor*.

The parallax factor is used only for layers of LayerType::PARALLAX This function is available for the cases where we manually create layers.

◆ _SetAlignPosition()

void _SetAlignPosition ( Vec2i  _alignPosition)
inline

Sets the align position of this layer to the given *_alignPosition*.

The align position is used only for layers of LayerType::PARALLAX and LayerType::SCREEN This function is available for the cases where we manually create layers.

◆ _SetAlignOffset()

void _SetAlignOffset ( Vec2f  _alignOffset)
inline

Sets the align offset of this layer to the given *_alignOffset*.

The align offset is used only for layers of LayerType::PARALLAX and LayerType::SCREEN This function is available for the cases where we manually create layers.

◆ _SetAttachToLayer()

void _SetAttachToLayer ( std::string  _attachToLayer)
inline

Sets the 'attachToLayer' of this layer to the given *_attachToLayer*.

The 'attachToLayer' is used only for layers of LayerType::PARALLAX and LayerType::SCREEN This function is available for the cases where we manually create layers.

◆ _SetStretchingVariant()

void _SetStretchingVariant ( StretchingVariant  _stretchingVariant)
inline

Sets the stretching variant of this layer to the given *_stretchingVariant*.

The stretching variant is used only for layer of LayerType::PARALLAX_STRETCHING_SINGLE_SPRITE. This function is available for the cases where we manually create layers.

◆ _SetZOrder()

void _SetZOrder ( int  _zOrder)
inline

Sets the z-order factor of this layer to the given *_zOrder*.

This function is available for the cases where we manually create layers.


The documentation for this class was generated from the following files: