Exemplo n.º 1
0
void MainScreen::become_front() {
    InterfaceScreen::become_front();
    if (Preferences::preferences()->play_idle_music() && !SongIsPlaying()) {
        LoadSong(kTitleSongID);
        SetSongVolume(kMaxMusicVolume);
        PlaySong();
    }
}
Exemplo n.º 2
0
void ScrollTextScreen::become_front() {
    // If a song was requested, play it.
    if (_play_song && Preferences::preferences()->play_idle_music()) {
        if (SongIsPlaying()) {
            StopAndUnloadSong();
        }
        LoadSong(_song_id);
        SetSongVolume(kMaxMusicVolume);
        PlaySong();
    }

    _start = now_usecs();
    _next_shift = _start;

    _clip = Rect(0, 0, world.width(), kScrollTextHeight);
    _clip.center_in(world);

    _position = _build_pix.size().as_rect();
    _position.center_in(_clip);
    _position.offset(0, _clip.bottom - _position.top);
}
Exemplo n.º 3
0
void ScrollTextScreen::resign_front() {
    // If a song was requested, stop it.
    if (_play_song && SongIsPlaying()) {
        StopAndUnloadSong();
    }
}