CanvasLayerpublic class ImageLayer extends Layer
Texture it
renders.react.Closeable.Set, react.Closeable.UtilLayer.HitTester, Layer.Origin, Layer.State, Layer.Visitor| Modifier and Type | Field | Description |
|---|---|---|
float |
forceHeight |
An explicit width and height for this layer.
|
float |
forceWidth |
An explicit width and height for this layer.
|
pythagoras.f.Rectangle |
region |
The subregion of the tile to render.
|
DEBUG_RECTS, state| Constructor | Description |
|---|---|
ImageLayer() |
Creates a texture layer with no texture.
|
ImageLayer(playn.core.Tile tile) |
Creates an image layer with the supplied texture tile.
|
ImageLayer(playn.core.TileSource source) |
Obtains the tile from
source, asynchronously if necessary, and displays it. |
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
Disposes this layer, removing it from its parent layer.
|
float |
height() |
Returns the height of this layer.
|
ImageLayer |
setRegion(pythagoras.f.Rectangle region) |
Sets
region. |
ImageLayer |
setSize(float width,
float height) |
Sets
forceWidth and forceHeight. |
ImageLayer |
setSize(pythagoras.f.IDimension size) |
Sets
forceWidth and forceHeight. |
ImageLayer |
setSource(playn.core.TileSource source) |
Sets the texture rendered by this layer to the texture provided by
source. |
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. |
playn.core.Tile |
tile() |
Returns the tile rendered by this layer.
|
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 float forceWidth
< 0 that indicates that the
size of the tile being rendered should be used.
Note: if you use these sizes in conjunction with a logical origin, you must set them via
setSize(float, float) to cause the origin to be recomputed.
public float forceHeight
< 0 that indicates that the
size of the tile being rendered should be used.
Note: if you use these sizes in conjunction with a logical origin, you must set them via
setSize(float, float) to cause the origin to be recomputed.
public pythagoras.f.Rectangle region
null (the default) the entire tile is
rendered. If forceWidth or forceHeight are not set, the width and height of
this image layer will be the width and height of the supplied region.
Note: when a subregion is configured, a texture will always be scaled, never repeated. If you want to repeat a texture, you have to use the whole texture. This is a limitation of OpenGL.
Note: if you use this region in conjunction with a logical origin, you must set it via
setRegion(pythagoras.f.Rectangle) to cause the origin to be recomputed.
public ImageLayer(playn.core.Tile tile)
public ImageLayer(playn.core.TileSource source)
source, asynchronously if necessary, and displays it. If the
source is not ready, this layer will display nothing until it becomes ready and delivers its
tile.public ImageLayer()
public playn.core.Tile tile()
public ImageLayer setTile(playn.core.Tile tile)
null 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.public ImageLayer setSource(playn.core.TileSource source)
source. If
source is not yet ready, the texture will be set when it becomes ready. Until then any
previous texture will continue to be displayed.public ImageLayer setTile(react.RFuture<? extends playn.core.Tile> tile)
tile. When the
future completes, this layer's tile will be set. Until then, the current tile (if any) will
continue to be rendered.public ImageLayer setSize(float width, float height)
forceWidth and forceHeight.this, for convenient call chaining.public ImageLayer setSize(pythagoras.f.IDimension size)
forceWidth and forceHeight.this, for convenient call chaining.public ImageLayer setRegion(pythagoras.f.Rectangle region)
region.this, for convenient call chaining.public float width()
Layerpublic float height()
Layerpublic void close()
LayerCopyright © 2018. All Rights Reserved.