[Previous] [Contents] [Index] [Next]

PgSetTranslation()

Translate draw commands horizontally and vertically

Synopsis:

void PgSetTranslation ( PhPoint_t const *translation,
                        int flags );

Description:

This function causes all subsequent draw commands to be translated by translation->x pixels horizontally and translation->y pixels vertically. The default translation is (0,0). You can set flags to:

0
translation is absolute, and replaces the current translation.
Pg_RELATIVE
translation is relative to the current translation, and is added to it.

Examples:

Draw a square from (100,100) to (200,200):

PhPoint_t translation;

PgSetFillColor( Pg_RED );
translation.x = translation.y = 100;
PgSetTranslation( &translation, Pg_RELATIVE );
PgDrawIRect( 0, 0, 100, 100, Pg_DRAW_FILL );

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PgClearTranslation()


[Previous] [Contents] [Index] [Next]