public class CanvasLayer extends ImageLayer
react.Closeable.Set, react.Closeable.UtilLayer.HitTester, Layer.Origin, Layer.State, Layer.VisitorforceHeight, forceWidth, regionDEBUG_RECTS, state| Constructor | Description |
|---|---|
CanvasLayer(playn.core.Graphics gfx,
float width,
float height) |
Creates a canvas layer with a backing canvas of size
width x height (in display
units). |
CanvasLayer(playn.core.Graphics gfx,
playn.core.Canvas canvas) |
Creates a canvas layer with the supplied backing canvas.
|
CanvasLayer(playn.core.Graphics gfx,
pythagoras.f.IDimension size) |
Creates a canvas layer with a backing canvas of
size (in display units). |
| Modifier and Type | Method | Description |
|---|---|---|
playn.core.Canvas |
begin() |
Starts a drawing operation on this layer's backing canvas.
|
void |
close() |
Disposes this layer, removing it from its parent layer.
|
void |
end() |
Informs this layer that a drawing operation has just completed.
|
float |
height() |
Returns the height of this layer.
|
void |
resize(float width,
float height) |
Resizes the canvas that is displayed by this layer.
|
ImageLayer |
setTile(playn.core.Tile tile) |
Sets the texture rendered by this layer.
|
ImageLayer |
setTile(react.RFuture<? extends playn.core.Tile> tile) |
Sets the tile rendered by this layer to the asynchronous result of
tile. |
float |
width() |
Returns the width of this layer.
|
absorbHits, alpha, debugPrint, depth, disposed, events, hasEventListeners, hitTest, hitTestDefault, interactive, name, onAdded, onDisposed, onRemoved, origin, origin, originX, originY, paint, parent, rotation, scale, scaledHeight, scaledWidth, scaleX, scaleY, setAlpha, setBatch, setDepth, setHitTester, setInteractive, setName, setOrigin, setOrigin, setRotation, setScale, setScale, setScaleX, setScaleY, setTint, setTranslation, setTranslation, setTx, setTy, setVisible, tint, toString, transform, translation, translation, tx, ty, visible, visitpublic CanvasLayer(playn.core.Graphics gfx,
pythagoras.f.IDimension size)
public CanvasLayer(playn.core.Graphics gfx,
float width,
float height)
public CanvasLayer(playn.core.Graphics gfx,
playn.core.Canvas canvas)
public void resize(float width,
float height)
Note: this throws away the old canvas and creates a new blank canvas with the desired size.
Thus this should immediately be followed by a begin()/end() pair which updates
the contents of the new canvas. Until then, it will display the old image data.
public playn.core.Canvas begin()
end() when the drawing is complete.public void end()
public ImageLayer setTile(playn.core.Tile tile)
ImageLayernull to release and clear
any texture currently being rendered and leave this layer in an uninitialized state. This
isn't something one would normally do, but could be useful if one was free-listing image
layers for some reason.setTile in class ImageLayerpublic ImageLayer setTile(react.RFuture<? extends playn.core.Tile> tile)
ImageLayertile. When the
future completes, this layer's tile will be set. Until then, the current tile (if any) will
continue to be rendered.setTile in class ImageLayerpublic float width()
Layerwidth in class ImageLayerpublic float height()
Layerheight in class ImageLayerpublic void close()
Layerclose in class ImageLayerCopyright © 2018. All Rights Reserved.