Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
99ada903d1
@ -215,6 +215,66 @@ const mp_obj_property_t displayio_tilegrid_y_obj = {
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| width: int
|
||||
//| """Width of the tilegrid in tiles."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_width(mp_obj_t self_in) {
|
||||
displayio_tilegrid_t *self = native_tilegrid(self_in);
|
||||
return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_tilegrid_get_width(self));
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_width_obj, displayio_tilegrid_obj_get_width);
|
||||
|
||||
const mp_obj_property_t displayio_tilegrid_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_width_obj,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| height: int
|
||||
//| """Height of the tilegrid in tiles."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_height(mp_obj_t self_in) {
|
||||
displayio_tilegrid_t *self = native_tilegrid(self_in);
|
||||
return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_tilegrid_get_height(self));
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_height_obj, displayio_tilegrid_obj_get_height);
|
||||
|
||||
const mp_obj_property_t displayio_tilegrid_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_height_obj,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| tile_width: int
|
||||
//| """Width of a single tile in pixels."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_tile_width(mp_obj_t self_in) {
|
||||
displayio_tilegrid_t *self = native_tilegrid(self_in);
|
||||
return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_tilegrid_get_tile_width(self));
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_tile_width_obj, displayio_tilegrid_obj_get_tile_width);
|
||||
|
||||
const mp_obj_property_t displayio_tilegrid_tile_width_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_tile_width_obj,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| tile_height: int
|
||||
//| """Height of a single tile in pixels."""
|
||||
//|
|
||||
STATIC mp_obj_t displayio_tilegrid_obj_get_tile_height(mp_obj_t self_in) {
|
||||
displayio_tilegrid_t *self = native_tilegrid(self_in);
|
||||
return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_tilegrid_get_tile_height(self));
|
||||
}
|
||||
MP_DEFINE_CONST_FUN_OBJ_1(displayio_tilegrid_get_tile_height_obj, displayio_tilegrid_obj_get_tile_height);
|
||||
|
||||
const mp_obj_property_t displayio_tilegrid_tile_height_obj = {
|
||||
.base.type = &mp_type_property,
|
||||
.proxy = {(mp_obj_t)&displayio_tilegrid_get_tile_height_obj,
|
||||
MP_ROM_NONE},
|
||||
};
|
||||
|
||||
//| flip_x: bool
|
||||
//| """If true, the left edge rendered will be the right edge of the right-most tile."""
|
||||
//|
|
||||
@ -385,6 +445,10 @@ STATIC const mp_rom_map_elem_t displayio_tilegrid_locals_dict_table[] = {
|
||||
{ MP_ROM_QSTR(MP_QSTR_hidden), MP_ROM_PTR(&displayio_tilegrid_hidden_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_x), MP_ROM_PTR(&displayio_tilegrid_x_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_y), MP_ROM_PTR(&displayio_tilegrid_y_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_width), MP_ROM_PTR(&displayio_tilegrid_width_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_height), MP_ROM_PTR(&displayio_tilegrid_height_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_tile_width), MP_ROM_PTR(&displayio_tilegrid_tile_width_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_tile_height), MP_ROM_PTR(&displayio_tilegrid_tile_height_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_flip_x), MP_ROM_PTR(&displayio_tilegrid_flip_x_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_flip_y), MP_ROM_PTR(&displayio_tilegrid_flip_y_obj) },
|
||||
{ MP_ROM_QSTR(MP_QSTR_transpose_xy), MP_ROM_PTR(&displayio_tilegrid_transpose_xy_obj) },
|
||||
|
@ -56,6 +56,9 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self,
|
||||
uint16_t common_hal_displayio_tilegrid_get_width(displayio_tilegrid_t *self);
|
||||
uint16_t common_hal_displayio_tilegrid_get_height(displayio_tilegrid_t *self);
|
||||
|
||||
uint16_t common_hal_displayio_tilegrid_get_tile_width(displayio_tilegrid_t *self);
|
||||
uint16_t common_hal_displayio_tilegrid_get_tile_height(displayio_tilegrid_t *self);
|
||||
|
||||
uint8_t common_hal_displayio_tilegrid_get_tile(displayio_tilegrid_t *self, uint16_t x, uint16_t y);
|
||||
void common_hal_displayio_tilegrid_set_tile(displayio_tilegrid_t *self, uint16_t x, uint16_t y, uint8_t tile_index);
|
||||
|
||||
|
@ -229,6 +229,14 @@ uint16_t common_hal_displayio_tilegrid_get_height(displayio_tilegrid_t *self) {
|
||||
return self->height_in_tiles;
|
||||
}
|
||||
|
||||
uint16_t common_hal_displayio_tilegrid_get_tile_width(displayio_tilegrid_t *self) {
|
||||
return self->tile_width;
|
||||
}
|
||||
|
||||
uint16_t common_hal_displayio_tilegrid_get_tile_height(displayio_tilegrid_t *self) {
|
||||
return self->tile_height;
|
||||
}
|
||||
|
||||
uint8_t common_hal_displayio_tilegrid_get_tile(displayio_tilegrid_t *self, uint16_t x, uint16_t y) {
|
||||
uint8_t *tiles = self->tiles;
|
||||
if (self->inline_tiles) {
|
||||
|
Loading…
Reference in New Issue
Block a user