namespace::draw

The draw namespace contains classes used for drawing and animating objects. The classes are built on the sgfx namespace which provides an API for accessing the Stratify Graphics library.

The base object is a Drawing. Classes that inherit objects must implement one of two methods: draw() or draw_to_scale().

The draw() method will draw objects on an abstract drawing canvas with a width and height of DrawingAttr::scale() usually 1000.

The draw_to_scale() is ultimately called by the draw() method to draw directly on a hal::Display.

Details

sg_color_t color_transparent()

drawing_area_t drawing_area(

drawing_size_t w,
drawing_size_t h
)

This returns a drawing_area_t populated with the width and height.

Parameters

  • w Width of the returned data

  • h Height of the retured data

Returns

A drawing_area_t with w and h populated as specified


drawing_area_t drawing_dim(

drawing_size_t w,
drawing_size_t h
)


drawing_point_t drawing_point(

drawing_int_t x,
drawing_int_t y
)

This returns a drawing_point_t populated with x and y


typedef s16 drawing_int_t

Drawing position (signed)


typedef u16 drawing_size_t

Drawing size (unsigned)


typedef DrawingAttributes DrawingAttr

typedef DrawingScaledAttributes DrawingScaledAttr

typedef ArcProgress ProgressArc

typedef BarProgress ProgressBar

typedef CircleProgress ProgressCircle

typedef Rectangle Rect

X

Thanks for Coming!

Subscribe to news and updates