Skip to content

Instantly share code, notes, and snippets.

@ermiry
Created January 3, 2020 22:07
Show Gist options
  • Save ermiry/91b128174e105bbbb03a8b4e1048f0dc to your computer and use it in GitHub Desktop.
Save ermiry/91b128174e105bbbb03a8b4e1048f0dc to your computer and use it in GitHub Desktop.
#include "cengine/renderer.h"
#include "cengine/ui/image.h"
void image_display_with_outline (const char *filename) {
if (filename) {
Renderer *main_renderer = renderer_get_by_name ("main");
Image *image = ui_image_create_static (0, 0, main_renderer);
// sets the image to be displayed at the center of the screen
ui_image_set_pos (image, NULL, UI_POS_MIDDLE_CENTER, main_renderer);
// sets the real image to be loaded from a file, like a jpg
ui_image_set_sprite (image, main_renderer, filename);
// sets a white outline for the image
ui_image_set_ouline_colour (image, RGBA_WHITE);
ui_image_set_outline_scale (image, 2, 2);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment