lv_obj_pos.h

API reference for lv_obj_pos.h

Report on GitHub

Functions

lv_obj_set_pos

Set the position of an object relative to the set alignment.

 
void lv_obj_set_pos(lv_obj_t *obj, int32_t x, int32_t y)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
xint32_tnew x coordinate
yint32_tnew y coordinate

With default alignment it's the distance from the top left corner

E.g. LV_ALIGN_CENTER alignment it's the offset from the center of the parent

The position is interpreted on the content area of the parent

The values can be set in pixel or in percentage of parent size with lv_pct(v)

lv_obj_set_x

Set the x coordinate of an object

 
void lv_obj_set_x(lv_obj_t *obj, int32_t x)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
xint32_tnew x coordinate

With default alignment it's the distance from the top left corner

E.g. LV_ALIGN_CENTER alignment it's the offset from the center of the parent

The position is interpreted on the content area of the parent

The values can be set in pixel or in percentage of parent size with lv_pct(v)

lv_obj_set_y

Set the y coordinate of an object

 
void lv_obj_set_y(lv_obj_t *obj, int32_t y)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
yint32_tnew y coordinate

With default alignment it's the distance from the top left corner

E.g. LV_ALIGN_CENTER alignment it's the offset from the center of the parent

The position is interpreted on the content area of the parent

The values can be set in pixel or in percentage of parent size with lv_pct(v)

lv_obj_set_size

Set the size of an object.

 
void lv_obj_set_size(lv_obj_t *obj, int32_t w, int32_t h)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
wint32_tthe new width
hint32_tthe new height

possible values are: pixel simple set the size accordingly LV_SIZE_CONTENT set the size to involve all children in the given direction lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). x should be in [0..1000]% range

lv_obj_set_width

Set the width of an object

 
void lv_obj_set_width(lv_obj_t *obj, int32_t w)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
wint32_tthe new width

possible values are: pixel simple set the size accordingly LV_SIZE_CONTENT set the size to involve all children in the given direction lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). x should be in [0..1000]% range

lv_obj_set_height

Set the height of an object

 
void lv_obj_set_height(lv_obj_t *obj, int32_t h)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
hint32_tthe new height

possible values are: pixel simple set the size accordingly LV_SIZE_CONTENT set the size to involve all children in the given direction lv_pct(x) to set size in percentage of the parent's content area size (the size without paddings). x should be in [0..1000]% range

lv_obj_set_content_width

Set the width reduced by the left and right padding and the border width.

 
void lv_obj_set_content_width(lv_obj_t *obj, int32_t w)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
wint32_tthe width without paddings in pixels

lv_obj_set_content_height

Set the height reduced by the top and bottom padding and the border width.

 
void lv_obj_set_content_height(lv_obj_t *obj, int32_t h)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
hint32_tthe height without paddings in pixels

lv_obj_set_layout

Set a layout for an object

 
void lv_obj_set_layout(lv_obj_t *obj, uint32_t layout)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
layoutuint32_tpointer to a layout descriptor to set

lv_obj_set_align

Change the alignment of an object.

 
void lv_obj_set_align(lv_obj_t *obj, lv_align_t align)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object to align
alignlv_align_ttype of alignment (see 'lv_align_t' enum) LV_ALIGN_OUT_... can't be used.

lv_obj_set_transform

Set the transform matrix of an object

 
void lv_obj_set_transform(lv_obj_t *obj, const lv_matrix_t *matrix)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
matrixconst lv_matrix_t *pointer to a matrix to set

LV_DRAW_TRANSFORM_USE_MATRIX needs to be enabled.

lv_obj_set_ext_click_area

Set the size of an extended clickable area

 
void lv_obj_set_ext_click_area(lv_obj_t *obj, int32_t size)
Parameters
NameTypeDescription
objlv_obj_t *pointer to an object
sizeint32_textended clickable area in all 4 directions [px]

Enums

lv_obj_point_transform_flag_t

NameValueDescription
LV_OBJ_POINT_TRANSFORM_FLAG_NONE0x00No flags
LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE0x01Consider the transformation properties of the parents too
LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE0x02Execute the inverse of the transformation (-angle and 1/zoom)
LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE0x03Both inverse and recursive
Used by 3 functions
  • lv_obj_transform_point — param flags
  • lv_obj_transform_point_array — param flags
  • lv_obj_get_transformed_area — param flags

Dependencies

How is this guide?

Last updated on

On this page