Created
February 16, 2016 01:23
-
-
Save bani/0a640fa3fd4964416a55 to your computer and use it in GitHub Desktop.
Pebble watchface background image example code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void set_background_gem(int color) { | |
APP_LOG(APP_LOG_LEVEL_DEBUG, "Updating background gem"); | |
if (s_bitmap) gbitmap_destroy(s_bitmap); | |
switch(color) { | |
case 0: | |
s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMOND); | |
break; | |
case 1: | |
s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMONDAQUA); | |
break; | |
// (...) | |
default: | |
s_bitmap = gbitmap_create_with_resource(RESOURCE_ID_DIAMOND); | |
} | |
bitmap_layer_set_bitmap(s_bitmap_layer, s_bitmap); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment