lv_obj_pos.h
API reference for lv_obj_pos.h
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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
x | int32_t | new x coordinate |
y | int32_t | new 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
x | int32_t | new 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
y | int32_t | new 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
w | int32_t | the new width |
h | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
w | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
h | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
w | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
h | int32_t | the 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
layout | uint32_t | pointer 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object to align |
align | lv_align_t | type 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
matrix | const 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)| Name | Type | Description |
|---|---|---|
obj | lv_obj_t * | pointer to an object |
size | int32_t | extended clickable area in all 4 directions [px] |
Enums
lv_obj_point_transform_flag_t
| Name | Value | Description |
|---|---|---|
LV_OBJ_POINT_TRANSFORM_FLAG_NONE | 0x00 | No flags |
LV_OBJ_POINT_TRANSFORM_FLAG_RECURSIVE | 0x01 | Consider the transformation properties of the parents too |
LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE | 0x02 | Execute the inverse of the transformation (-angle and 1/zoom) |
LV_OBJ_POINT_TRANSFORM_FLAG_INVERSE_RECURSIVE | 0x03 | Both inverse and recursive |
Used by 3 functions
lv_obj_transform_point— paramflagslv_obj_transform_point_array— paramflagslv_obj_get_transformed_area— paramflags
Dependencies
How is this guide?
Last updated on