Hi bjadams
Nop, it can be done anywhere you need.
For example, in my game I have a menu that makes a scroll to be displayed or not. Its placedthis in a separate .cpp file and the only precaution is to include the header file agk.h.
Here the code:
// (3) SHOWS THE UPPER MENU GAME (UP/DOWN) tit_sound_upper_gm_mnu
void do_show_upper_menu_01()
{
#ifdef MIDEBUG
agk::Print("do_show_upper_menu_01() ");
#endif
float m, n, k;
if (flip_flop_menu_sup == TRUE) // Up the Menu
{
m = agk::GetSpriteY( menu_sup_p1_Bckgrd_ID );
n = agk::GetSpriteY( tit_exit_game_menu_ID );
k = agk::GetSpriteY( tit_opts_pause_ID );
do {
agk::SetSpritePosition ( menu_sup_p1_Bckgrd_ID, 0, m );
agk::SetSpritePosition ( tit_save_gm_from_upper_gm_menu, 5, n + 1 );
agk::SetSpritePosition ( tit_restart_upper_menu_gm, 23, n -1 );
agk::SetSpritePosition ( tit_sound_upper_gm_mnu, 63, n );
agk::SetSpritePosition ( tit_exit_game_menu_ID, 46, n );
agk::SetSpritePosition ( tit_cancel_upper_gm_mnu, 81, n + 1 );
agk::SetSpritePosition ( tit_opts_pause_ID, 76, k );
m = m - 1;
n = n - 1;
k = k - 1;
agk::Sync (); // <<<<<<<
} while (m >= -17);
// Delete Pause title
int z = 255;
for (int f = 0; z > 0; f++)
{
agk::SetSpriteColor ( tit_pause_ID, 255, 255, 255, z );
z = z - 30;
agk::Sync(); // <<<<<<<<<<
};
agk::DeleteImage ( tit_pause_ID );
agk::DeleteSprite( tit_pause_ID );
….
….
….
As you can see I made two calls to agk::Sync () with no problems. My problem is that in do-while loops run all commands but those two ...