#include <dumbdisplay.h>
Public Member Functions | |
| void | addLevel (const String &levelId, float width, float height, bool switchToIt=false) |
| void | addLevel (const String &levelId, bool switchToIt=false) |
| another version of addLevel() | |
| void | addTopLevel (const String &levelId, float width=0, float height=0, bool switchToIt=false) |
| like addLevel() but add to the top (i.e. will be drawn last) | |
| void | addTopLevel (const String &levelId, bool switchToIt) |
| another version of addTopLevel() | |
| 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 | exportLevelAsRegisteredBackground (const String &backgroundId, bool replace=true) |
| void | setLevelBackground (const String &backgroundId, const String &backgroundImageName="", const String &drawBackgroundOptions="") |
| void | setLevelNoBackground () |
| set that the current level uses no background image | |
| void | animateLevelBackground (float 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 | backgroundImage (const String &backgroundImageName, const String &drawBackgroundOptions, int refImageWidth=0) |
| void | noBackgroundImage () |
| set no layer background image | |
| void | exportAsBackgroundImage (bool replace=true, bool noDrawBackground=true, int exportAsWidth=0) |
| void | animateBackgroundImage (float fps, bool reset=true, const String &options="") |
| void | stopAnimateBackgroundImage (bool reset=true) |
| 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=DDFeedbackType::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 DDFeedback * | getFeedback () |
| 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 |
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.
| void MultiLevelDDLayer::addLevel | ( | const String & | levelId, |
| float | width, | ||
| float | height, | ||
| bool | switchToIt = false |
||
| ) |
add a level, optionally change its "opening" size
| levelId | level ID; cannot be DD_DEF_LAYER_LEVEL_ID |
| width | width of the level "opening"; 0 means the maximum width (the width of the layer) |
| height | height of the level "opening"; 0 means the maximum height (the height of the layer) |
| void MultiLevelDDLayer::animateLevelBackground | ( | float | fps, |
| bool | reset = true, |
||
| const String & | options = "" |
||
| ) |
start animate level background (if level background has a series of images)
| fps | frames per second which is used to calculate the interval between the series of images |
| reset | reset to the first image in the series (before start animation) |
| options | can be "r" to reverse the order of the series of images |
| void MultiLevelDDLayer::exportLevelAsRegisteredBackground | ( | const String & | backgroundId, |
| bool | replace = true |
||
| ) |
experimental: export the current level as a registered background image – see exportLevelsAsImage() and registerLevelBackground()
| backgroundId | id to identify the background – see setLevelBackground() |
| replace | if true (default), replace the existing registered background image with the same id; if false, will add as an item of background image series that can be used for animation with animateLevelBackground() |
| void MultiLevelDDLayer::levelOpacity | ( | int | opacity | ) |
set the opacity of the current level
| opacity | background opacity (0 - 100) |
| void MultiLevelDDLayer::pushLevelAndSwitchTo | ( | const String & | switchTolevelId, |
| bool | addIfMissing = true |
||
| ) |
push the current level onto the level stack, to be pop with popLevel()
| switchTolevelId | switch to level ID (after pushing current level) |
| void MultiLevelDDLayer::registerLevelBackground | ( | const String & | backgroundId, |
| const String & | backgroundImageName, | ||
| const String & | drawBackgroundOptions = "" |
||
| ) |
register an image for setting as level's background
| backgroundId | id to identify the background – see setLevelBackground() |
| backgroundImageName | name of the image can be a series of images like dumbdisplay_##0-7##.png (for dumbdisplay_0.png to dumbdisplay_7.png) which can be used for animation with animateLevelBackground() |
| drawBackgroundOptions | options for drawing the background; same means as the option param of GraphicalDDLayer::drawImageFiler() |
| void MultiLevelDDLayer::reorderLevel | ( | const String & | levelId, |
| const String & | how | ||
| ) |
reorder the specified level (by moving it in the z-order plane)
| how | can be "T" for top; or "B" for bottom; "U" for up; or "D" for down |
| void MultiLevelDDLayer::setLevelBackground | ( | const String & | backgroundId, |
| const String & | backgroundImageName = "", |
||
| const String & | drawBackgroundOptions = "" |
||
| ) |
set a registered background image as the current level's background
| backgroundId | |
| backgroundImageName | if not registered, the name of the image to register; can be a series of images like dumbdisplay_##0-7##.png (for dumbdisplay_0.png to dumbdisplay_7.png) which can be used for animation with animateLevelBackground() |
| drawBackgroundOptions | if not registered, the options for drawing the background |
| void MultiLevelDDLayer::stopAnimateLevelBackground | ( | bool | reset = true | ) |
stop animate level background
| reset | reset to the first image in the series |
| 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
| levelId | level ID; use DD_DEF_LAYER_LEVEL_ID for the default level |
| addIfMissing | if true, add the level if it is missing |