Hello All,
I modify the function pan_rotate from the manual and add another parameter which is equal to number of rotations.. I just want to have an effect at the center of the screen and where the panels is rotating from small scale until it reaches to it's original scale..
My problem is since pos_x and pos_y of the panel is at the upper left corner I got a rotating panel effect that comes from the left side then to the center..
Is there a way that I can get an effect of a rotating panel at the center regardless of its scale??
Here's my function..
//----------------------------------------------------------------------
// ROTATES A PANEL
//----------------------------------------------------------------------
void pan_rotate(PANEL* panel, var num_rotate)
{
set(panel, SHOW);
panel.center_x = panel.size_x * 0.5;
panel.center_y = panel.size_y * 0.5;
while (num_rotate > 0)
{
panel.scale_x = 1/(maxv(1, num_rotate));
panel.scale_y = panel.scale_x;
panel.angle += (50*time_step) + (num_rotate*5);
if (panel.angle >= 360)
{
num_rotate--;
panel.angle = 0;
}
wait(1);
}
panel.angle = 0;
}
the output of this function is rotating the panel from small scale until it reaches its original scale..
before calling the above function I set the panel on the center of the screen..
Any idea how??