Watch Gradient Spot

The watch gradientm spot widget allows you to create a pointer watchface with dynamic water drops in the center.

Usage

Create Widget

You can create a watch gradient spot widget by calling the gui_watch_gradient_spot_create().

Set Center

The center position of the widget can be freely set by using the gui_watch_gradient_spot_set_center() function to change the center position, where c_x and c_y are the coordinate points of the central position.

Example



API

Defines

WATCH_GRADIENT_SPOT_BASE
WATCH_GRADIENT_SPOT_SCLAE

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);

}

Parameters:
  • parent – parent widget

  • name – widget name

  • x – left

  • y – top

  • w – width

  • h – high

Returns:

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);

}

Parameters:
Returns:

void

struct gui_watch_gradient_spot_t

Public Members

gui_obj_t base
float c_x
float c_y