The Background Layer¶
The Background Layer is the bottom-most layer of the tabletop Canvas. The Background Layer is responsible for rendering your underlying background image and defining the interactable area of the scene. By default, the canvas uses an interactive area which is 1.5 times the dimensions of your background image (with a minimum of 1000px.)
Mod developers may wish to interact with or manipulate this layer and can do so using the singleton instance of
the BackgroundLayer()
class which is accessible from within the client as canvas.background
.
-
class
BackgroundLayer
()¶ A PIXI.Container subclass of CanvasLayer responsible for rendering the scene background image. The singleton instance of this class is accessed through
canvas.background
.-
BackgroundLayer.
activate
()¶ The BackgroundLayer can never be active
-
BackgroundLayer.
createThumbnail
(texture)¶ Create a 300px by 100px thumbnail image for this scene background
Arguments: - texture (String) – The background texture path
Returns: String – base64 image data
-
BackgroundLayer.
draw
()¶ Draw the background image. We first load the image texture and store it in the PIXI loader. Once the requested image has been fully loaded we draw it as a PIXI.Sprite
Returns: Promise.<BackgroundLayer> – Returns the instance of the Background Layer for convenient chaining
-
BackgroundLayer.
img
¶ type: PIXI.Sprite
The background image
-
BackgroundLayer.
isVideo
¶ Return a Boolean flag for whether the Scene background texture is a Video element
-
BackgroundLayer.
layerOptions
¶ Customize behaviors of this PlaceablesLayer by modifying some behaviors at a class level
-
BackgroundLayer.
source
¶ Return the base HTML element which is used to generate the Scene background
-