You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
rosalila()->sound->playMusic("music.ogg", 0/*music loops, 0 means infinite*/);
rosalila()->sound->addSound("my_sound", "sound.ogg");
[...]
rosalila()->sound->playSound("my_sound", -1/*channel, use -1 to autopick*/, 1/*loops, 0 means infinite*/, -1/*stereo panning, 0 means mono, range from 1 to screen width*/);
[...]
rosalila()->sound->stopMusic();
Check if an input is down or was pressed
if(rosalila()->receiver->isDown(0/*0 is player 1, 1 is player 2 etc.*/, "up"))
{
// Player 1's "Up" button is down
}
if(rosalila()->receiver->isPressed(1/*0 is player 1, 1 is player 2 etc.*/, "a"))
{
// Player 2 pressed the "a" button
}
rosalila()->api_integrator->findLeaderboard("Top scores"); // Retreive the leaderboard externallywhile (rosalila()->api_integrator->getState() == "loading") // Wait for it...
{
rosalila()->update();
}
if (rosalila()->api_integrator->getState() != "error")
{
Leaderboard *leaderboard = rosalila()->api_integrator->getLeaderboard("Top scores");
for (auto entry : current_leaderboard->top_entries) // Inspect entries
{
int rank = entry->rank;
std::string name = entry->name;
int score = entry->score;
[...]
}
for (auto entry : current_leaderboard->near_entries) // Same thing for entries near the player
{
[...]
}
for (auto entry : current_leaderboard->friends_entries) // And for his friend's entries
{
[...]
}
} else
{
// Handle errors
}
Check if external API is running (Compatible with Steam)
if (rosalila()->api_integrator->isUsingApi())
{
// External api is running
}
Trigger a notification
rosalila()->graphics->notification_handler.notifications.push_back(
new Notification(image,
0/*x*/, 0/*y*/,
100/*target y, used for moving animation*/,
300/*duration, in frames*/));
[...]
rosalila()->graphics->notification_handler.interruptCurrentNotification(); // Interrupt / Hide it
Get screen size
int width = rosalila()->graphics->screen_width;
int height = rosalila()->graphics->screen_height;
Get a random number
int random_number = rosalila()->utility->getRandomNumber();
int non_seeded_random_number = rosalila()->utility->getNonSeededRandomNumber();