CLASS v1.8.0

tilemap.Layer

pykraken.tilemap.Layer

Layer is the base class for all tilemap layers.

More about tilemap.Layer

Attributes

  • visible (bool) — Whether the layer is visible.
  • offset (Vec2) — Per-layer drawing offset.
  • opacity (float) — Layer opacity (0.0-1.0).
  • name (str) — Layer name.
  • type (LayerType) — Layer type enum.

Methods

  • draw — Draw the layer to the current renderer.

Reference

PYTHON API
tilemap.Layer(/, *args, **kwargs)

Initialize self. See help(type(self)) for accurate signature.

name

property
name: str

Layer name.

offset

property
offset: Vec2

Per-layer drawing offset.

opacity

property
opacity: float

Layer opacity from 0.0 to 1.0.

type

property

Layer type enum.

visible

property
visible: bool

Whether the layer is visible.

draw

method
draw(self, angle: float = 0.0, pivot: Vec2 = Vec2(0.500000, 0.500000)) -> None

Draw the layer to the current renderer.

Args

  • angle (float, optional) — Rotation angle in degrees. Defaults to 0.0.
  • pivot (Vec2, optional) — Rotation pivot as normalized coordinates relative to the map size. Defaults to (0.5, 0.5).

Find your next step

Start typing to search the manual.