/* **slide\_title\_in()**, **slide\_title\_out()** and * **bling\_title()** are used by the level * timeline to animate the title. * * We use cosine interpolation to slide the title in * and out, creating a smoother effect. * * **progress** will hold a value between 0 to 1 * based on the event progess/duration, making it ideal * for use with interpolation functions. */ static void* before_title_in(void* data, float elapsed_ms, float progress) { struct rectangle c = { 0, 0, 192, 108 }; struct rectangle r = { 0, 0, 64, 64 }; struct level_data* ldata = data; UNUSED(elapsed_ms); UNUSED(progress); clear_image(ldata->title.mask, color_from_RGB(0, 0, 0)); draw_on_image(ldata->title.mask); draw_image(ldata->title.spot, -15, 40, &r, 0); draw_on_screen(); draw_image(ldata->title.mask, 0, 0, &c, 0); return NULL; }
save_menu() { set_top_lines(); if (zoom_flag) /* do some re-arranging so menu's in our screen */ { zbuf_to_screen(); draw_on_screen(); zscale_cursor = 0; } else { copy_screen(pscreen, bscreen); } }
static void* slide_title_in(void* data, float elapsed_ms, float progress) { struct rectangle c = { 0, 0, 192, 108 }; struct rectangle r = { 0, 0, 64, 64 }; struct level_data* ldata = data; UNUSED(elapsed_ms); clear_image(ldata->title.mask, color_from_RGB(255 * progress, 255 * progress, 255 * progress)); draw_on_image(ldata->title.mask); draw_image(ldata->title.spot, -15, 40, &r, 0); draw_on_screen(); draw_image(ldata->title.mask, 0, 0, &c, 0); draw_sprite(ldata->title.sprite, interpolate(-100, 20, progress, circular_ease_out), 10); return NULL; }