30
30
#include "Layer.h"
31
31
#include "supervisor/shared/translate.h"
32
32
33
- //| .. currentmodule:: _stage
33
+ //| class Layer:
34
+ //| """.. currentmodule:: _stage
34
35
//|
35
- //| :class:`Layer` -- Keep information about a single layer of graphics
36
- //| ===================================================================
36
+ //| :class:`Layer` -- Keep information about a single layer of graphics
37
+ //| ==================================================================="""
37
38
//|
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.
39
43
//|
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.
43
49
//|
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
+ //| ...
52
53
//|
53
54
STATIC mp_obj_t layer_make_new (const mp_obj_type_t * type , size_t n_args ,
54
55
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,
90
91
return MP_OBJ_FROM_PTR (self );
91
92
}
92
93
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
+ //| .. .
96
97
//|
97
98
STATIC mp_obj_t layer_move (mp_obj_t self_in , mp_obj_t x_in , mp_obj_t y_in ) {
98
99
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) {
102
103
}
103
104
STATIC MP_DEFINE_CONST_FUN_OBJ_3 (layer_move_obj , layer_move );
104
105
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
+ //| .. .
109
110
//|
110
111
STATIC mp_obj_t layer_frame (mp_obj_t self_in , mp_obj_t frame_in ,
111
112
mp_obj_t rotation_in ) {
0 commit comments