ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
MultiLevelDDLayer Class Reference

#include <dumbdisplay.h>

Inheritance diagram for MultiLevelDDLayer:
DDLayer DDObject GraphicalDDLayer TurtleDDLayer

Public Member Functions

void addLevel (const String &levelId, float width=0, float height=0, bool switchToIt=false)
 
void addLevel (const String &levelId, bool switchToIt)
 another version of addLevel()
 
void switchLevel (const String &levelId, bool addIfMissing=true)
 
void pushLevel ()
 push the current level onto the level stack, to be pop with popLevel()
 
void pushLevelAndSwitchTo (const String &switchTolevelId, bool addIfMissing=true)
 
void popLevel ()
 pop a level from the level stack and make it the current level
 
void levelOpacity (int opacity)
 
void levelTransparent (bool transparent)
 set whether level is transparent
 
void setLevelAnchor (float x, float y, long reachInMillis=0)
 set the anchor of the level; note that level anchor is the top-left corner of the level "opening"
 
void moveLevelAnchorBy (float byX, float byY, long reachInMillis=0)
 move the level anchor
 
void registerLevelBackground (const String &backgroundId, const String &backgroundImageName, const String &drawBackgroundOptions="")
 
void setLevelBackground (const String &backgroundId, const String &backgroundImageName="", const String &drawBackgroundOptions="")
 
void setLevelNoBackground ()
 set that the current level uses no background image
 
void animateLevelBackground (int fps, bool reset=true, const String &options="")
 
void stopAnimateLevelBackground (bool reset=true)
 
void reorderLevel (const String &levelId, const String &how)
 
void exportLevelsAsImage (const String &imageFileName, bool cacheItNotSave=false)
 export (and save) the levels as an image (without the decorations of the layer like border)
 
void deleteLevel (const String &levelId)
 delete the specified level
 
- Public Member Functions inherited from DDLayer
void border (float size, const String &color, const String &shape="flat", float extraSize=0)
 
void noBorder ()
 
void padding (float size)
 
void padding (float left, float top, float right, float bottom)
 
void noPadding ()
 
void margin (float size)
 
void margin (float left, float top, float right, float bottom)
 
void noMargin ()
 
void backgroundColor (const String &color, int opacity=100)
 
void noBackgroundColor ()
 
void visible (bool visible)
 
void transparent (bool transparent)
 
void disabled (bool disabled=true)
 
void opacity (int opacity)
 
void alpha (int alpha)
 
void blend (const String &color, int alpha=255, const String &mode="darken")
 
void noblend ()
 
void clear ()
 clear the layer
 
void flash ()
 normally used for "feedback" – flash the default way (layer + border)
 
void flashArea (int x, int y)
 normally used for "feedback" – flash the area (x, y) where the layer is clicked
 
void explicitFeedback (int16_t x=0, int16_t y=0, const String &text="", DDFeedbackType type=CLICK, const String &option="")
 
const String & getLayerId () const
 
void setFeedbackHandler (DDFeedbackHandler handler, const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
 
void enableFeedback (const String &autoFeedbackMethod="", const String &allowFeedbackTypes="")
 
void disableFeedback ()
 disable "feedback"
 
const DDFeedbackgetFeedback ()
 
void debugOnly (int i)
 for debug use
 
DDFeedbackManager * getFeedbackManager () const
 
DDFeedbackHandler getFeedbackHandler () const
 

Protected Member Functions

 MultiLevelDDLayer (int8_t layerId)
 
- Protected Member Functions inherited from DDLayer
 DDLayer (int8_t layerId)
 
void _enableFeedback ()
 

Additional Inherited Members

- Public Attributes inherited from DDObject
int8_t objectType
 object type – DD_OBJECT_TYPE_LAYER or DD_OBJECT_TYPE_TUNNEL
 
String customData
 custom data
 
- Protected Attributes inherited from DDLayer
String layerId
 
DDFeedbackManager * pFeedbackManager
 
DDFeedbackHandler feedbackHandler
 

Detailed Description

Base class for a multi-level layer. A layer (single-level or multi-level) will have at least one level (DD_DEF_LAYER_LEVEL_ID). A multi-level layer can have other named levels, which act like separate sub-layers with separate sets of non-layer-specific properties.

Member Function Documentation

◆ addLevel()

void MultiLevelDDLayer::addLevel ( const String &  levelId,
float  width = 0,
float  height = 0,
bool  switchToIt = false 
)

add a level, optionally change its "opening" size

Parameters
levelIdlevel ID; cannot be DD_DEF_LAYER_LEVEL_ID
widthwidth of the level "opening"; 0 means the maximum width (the width of the layer)
heightheight of the level "opening"; 0 means the maximum height (the height of the layer)

◆ animateLevelBackground()

void MultiLevelDDLayer::animateLevelBackground ( int  fps,
bool  reset = true,
const String &  options = "" 
)

start animate level background (if level background has a series of images)

Parameters
fpsframes per second which is used to calculate the interval between the series of images
resetreset to the first image in the series
optionscan be "r" to reverse the order of the series of images

◆ levelOpacity()

void MultiLevelDDLayer::levelOpacity ( int  opacity)

set the opacity of the current level

Parameters
opacitybackground opacity (0 - 100)

◆ pushLevelAndSwitchTo()

void MultiLevelDDLayer::pushLevelAndSwitchTo ( const String &  switchTolevelId,
bool  addIfMissing = true 
)

push the current level onto the level stack, to be pop with popLevel()

Parameters
switchTolevelIdswitch to level ID (after pushing current level)

◆ registerLevelBackground()

void MultiLevelDDLayer::registerLevelBackground ( const String &  backgroundId,
const String &  backgroundImageName,
const String &  drawBackgroundOptions = "" 
)

register an image for setting as level's background

Parameters
backgroundIdid to identify the background
backgroundImageNamename of the image
drawBackgroundOptionsoptions for drawing the background; same means as the option param of GraphicalDDLayer::drawImageFiler()

◆ reorderLevel()

void MultiLevelDDLayer::reorderLevel ( const String &  levelId,
const String &  how 
)

reorder the specified level (by moving it in the z-order plane)

Parameters
howcan be "T" for top; or "B" for bottom; "U" for up; or "D" for down

◆ setLevelBackground()

void MultiLevelDDLayer::setLevelBackground ( const String &  backgroundId,
const String &  backgroundImageName = "",
const String &  drawBackgroundOptions = "" 
)

set a registered background image as the current level's background

Parameters
backgroundId
backgroundImageNameif not registered, the name of the image to register
drawBackgroundOptionsif not registered, the options for drawing the background

◆ stopAnimateLevelBackground()

void MultiLevelDDLayer::stopAnimateLevelBackground ( bool  reset = true)

stop animate level background

Parameters
resetreset to the first image in the series

◆ switchLevel()

void MultiLevelDDLayer::switchLevel ( const String &  levelId,
bool  addIfMissing = true 
)

switch to a different level (which is like a sub-layer), making it the current level

Parameters
levelIdlevel ID; use DD_DEF_LAYER_LEVEL_ID for the default level
addIfMissingif true, add the level if it is missing