ggiOvlSetCoordBase : Set the units and point of origin used when positioning an overlay
#include <ggi/ggi.h> int ggiOvlSetCoordBase(ggiOvl_t ovl, enum ggi_ll_coordbase units, long x, long y, long w, long h);
ggiOvlSetCoordBase sets the units used by future calls to ggiOvl* functions on the provided object ovl, not including the :p:`x`, :p:`y`, :p:`w`, :p:`h` parameters passed in the current call, which are subject to translation from any coordinate base which was set with a previous call to this function.
The parameter units decides the units that will be passed from this point forward to LibOvl functions such as ggiOvlSetPos and ggiOvlSetSize. It may contain any of the following self-descriptive values: LL_COORDBASE_PIXEL, LL_COORDBASE_DOT, LL_COORDBASE_MILLIMETER, LL_COORDBASE_MICROMETER, LL_COORDBASE_1_64_INCH.
These values may be combined with a few bit flags:
The parameters :p:`x`, :p`y` set the origin offset for the object :p:`ovl`. Coordinates passed to any future calls on ovl will be subject to translation from this point of reference. The parameters :p:`w`, :p:`h` are analogous to that for sizing operations; generally you should leave them alone by setting them to 0; most people will never need them.
ggiOvlSetCoordBase returns 0 on success or a negative error value on failure.
Center a sprite at 50mm, 50mm and spiral it out from there:
ggiOvlSetCoordBase(GA_COORDBASE_MILLIMETERS, 0, 0, 0, 0); ggiOvlGetSize(sprite, &sx, &sy); ggiOvlSetCoordBase(ovl, GA_COORDBASE_RESET, 50 - sx/2, 50 - sy/2, 0, 0); for (i = 0; i < 500; i++) { /* Note lack of "+ offset" in below. Handy, eh? */ ggiOvlSetPos(ovl, sin(i/100) * i / 10, cos(i/100) * i / 10); }