3030#include "Layer.h"
3131#include "supervisor/shared/translate.h"
3232
33- //| .. currentmodule:: _stage
33+ //| class Layer:
34+ //| """.. currentmodule:: _stage
3435//|
35- //| :class:`Layer` -- Keep information about a single layer of graphics
36- //| ===================================================================
36+ //| :class:`Layer` -- Keep information about a single layer of graphics
37+ //| ==================================================================="""
3738//|
38- //| .. class:: Layer(width, height, graphic, palette, [grid])
39+ //| def __init__(self, width: int, height: int, graphic: bytearray, palette: bytearray, grid: bytearray):
40+ //| """Keep internal information about a layer of graphics (either a
41+ //| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering
42+ //| with the ``render()`` function.
3943//|
40- //| Keep internal information about a layer of graphics (either a
41- //| ``Grid`` or a ``Sprite``) in a format suitable for fast rendering
42- //| with the ``render()`` function.
44+ //| :param int width: The width of the grid in tiles, or 1 for sprites.
45+ //| :param int height: The height of the grid in tiles, or 1 for sprites.
46+ //| :param bytearray graphic: The graphic data of the tiles.
47+ //| :param bytearray palette: The color palette to be used.
48+ //| :param bytearray grid: The contents of the grid map.
4349//|
44- //| :param int width: The width of the grid in tiles, or 1 for sprites.
45- //| :param int height: The height of the grid in tiles, or 1 for sprites.
46- //| :param bytearray graphic: The graphic data of the tiles.
47- //| :param bytearray palette: The color palette to be used.
48- //| :param bytearray grid: The contents of the grid map.
49- //|
50- //| This class is intended for internal use in the ``stage`` library and
51- //| it shouldn't be used on its own.
50+ //| This class is intended for internal use in the ``stage`` library and
51+ //| it shouldn't be used on its own."""
52+ //| ...
5253//|
5354STATIC mp_obj_t layer_make_new (const mp_obj_type_t * type , size_t n_args ,
5455 const mp_obj_t * args , mp_map_t * kw_args ) {
@@ -90,9 +91,9 @@ STATIC mp_obj_t layer_make_new(const mp_obj_type_t *type, size_t n_args,
9091 return MP_OBJ_FROM_PTR (self );
9192}
9293
93- //| .. method:: move(x , y)
94- //|
95- //| Set the offset of the layer to the specified values .
94+ //| def move(self, x: Any , y: Any) -> Any:
95+ //| """Set the offset of the layer to the specified values."""
96+ //| .. .
9697//|
9798STATIC mp_obj_t layer_move (mp_obj_t self_in , mp_obj_t x_in , mp_obj_t y_in ) {
9899 layer_obj_t * self = MP_OBJ_TO_PTR (self_in );
@@ -102,10 +103,10 @@ STATIC mp_obj_t layer_move(mp_obj_t self_in, mp_obj_t x_in, mp_obj_t y_in) {
102103}
103104STATIC MP_DEFINE_CONST_FUN_OBJ_3 (layer_move_obj , layer_move );
104105
105- //| .. method:: frame(frame, rotation)
106- //|
107- //| Set the animation frame of the sprite, and optionally rotation its
108- //| graphic .
106+ //| def frame(self, frame: Any , rotation: Any) -> Any:
107+ //| """Set the animation frame of the sprite, and optionally rotation its
108+ //| graphic."""
109+ //| .. .
109110//|
110111STATIC mp_obj_t layer_frame (mp_obj_t self_in , mp_obj_t frame_in ,
111112 mp_obj_t rotation_in ) {
0 commit comments