You would need to sync before starting loading the game assets.
i.e. show loading sprite -> sync() -> load game assets
If you want also to include a loading bar (if you have that much loading going on), then the syncs need to be included between your loading routines. Example:
// --------- Load/Create some assets and hide them
//set loading bar to 25%
agk::SetSpriteScale(loadspriteID, 0.25,1.0);
// loop sync to show the updated loading bar
for (int i = 0;i<5;i++)
{
agk::sync()
}
// --------- Load/Create more assets and hide them
//set loading bar to 50%
agk::SetSpriteScale(loadspriteID, 0.5,1.0);
// loop sync to show the updated loading bar
for (int i = 0;i<5;i++)
{
agk::sync()
}
// --------- Load/Create more assets and hide them
//set loading bar to 75%
agk::SetSpriteScale(loadspriteID, 0.75,1.0);
// loop sync to show the updated loading bar
for (int i = 0;i<5;i++)
{
agk::sync()
}
// --------- Load/Create some more assets and hide them
//set loading bar to 100%
agk::SetSpriteScale(loadspriteID, 1.0,1.0);
// loop sync to show the updated loading bar
for (int i = 0;i<5;i++)
{
agk::sync()
}
// Hide loading bar
// Show game assets
// Start game