监视点渐变 (Watch Gradient Spot)
监视点渐变是一个具有动态水滴效果的指针表盘控件。
用法
创建控件
使用 gui_watch_gradient_spot_create()
函数创建一个具有动态水滴效果的指针表盘控件。
设置中心位置
控件的中心位置可以自由设置,使用 gui_watch_gradient_spot_set_center()
函数改变中心位置,其中 c_x
和 c_y
为中心位置的坐标点。
示例

API
Functions
-
NVGcontext *nvgCreateAGGE(uint32_t w, uint32_t h, uint32_t stride, enum NVGtexture format, uint8_t *data)
-
void nvgDeleteAGGE(NVGcontext *ctx)
-
gui_watch_gradient_spot_t *gui_watch_gradient_spot_create(void *parent, const char *name, int16_t x, int16_t y, int16_t w, int16_t h)
create a watch widget
Example usage
void example_watch(void *parent) { win_watch = gui_win_create(parent, "win", 0, 0, 368, 448); gui_watch_gradient_spot_t *watch = gui_watch_gradient_spot_create(win_watch, "watchface", 0, 0, 0, 0); }
- 参数:
parent – parent widget
name – widget name
x – left
y – top
w – width
h – high
- 返回:
gui_watch_gradient_spot_t* widget pointer
-
void gui_watch_gradient_spot_set_center(gui_watch_gradient_spot_t *this, float c_x, float c_y)
set watch center
Example usage
void example_watch(void *parent) { win_watch = gui_win_create(parent, "win", 0, 0, 368, 448); gui_watch_gradient_spot_t *watch = gui_watch_gradient_spot_create(win_watch, "watchface", 0, 0, 0, 0); gui_watch_gradient_spot_t *watch = gui_watch_gradient_spot_set_center(watch, 368 / 2, 448 / 2); }
- 参数:
this – gui_watch_gradient_spot_t widget
c_x – left
c_y – top
- 返回:
void
-
struct gui_watch_gradient_spot_t
…