center_x

center_y

Rotation center of the panel in pixels, relative to its pos_x / pos_y coordinates. The center is scaled with the panel.

Range:

0..panel size (default: 0)

Type:

var

Example:

PANEL* pan;

// rotate a panel about its center function pan_rotate(p) {   pan = p; // set the panel pointer from the function parameter pan.center_x = pan.size_x * 0.5; // set the rotation center at the panel center pan.center_y = pan.size_y * 0.5; while (pan.angle < 360) // one full rotation { pan.angle += 10*time_step; wait(1); pan = p; // local variables are preserved during wait(), global pointers aren't } pan.angle = 0; }

See Also:

PANEL, bmap, layer, angle