diff --git a/.gitignore b/.gitignore index 1470da5..b41ca9b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ /.clangd /build -/resources /.lock* diff --git a/resources/fonts/LICENSE b/resources/fonts/LICENSE new file mode 100644 index 0000000..83cde03 --- /dev/null +++ b/resources/fonts/LICENSE @@ -0,0 +1,9 @@ +Retro Computer is an all-caps style retro pixel-font influenced by classic video games. + +-------------------- + +This font is free for personal use. +Commercial use requires free amount donation through PayPal: hello@petyka.com +-------------------- + +www.petyka.com \ No newline at end of file diff --git a/resources/fonts/RetroComputerTime.ttf b/resources/fonts/RetroComputerTime.ttf new file mode 100644 index 0000000..8c471f1 Binary files /dev/null and b/resources/fonts/RetroComputerTime.ttf differ diff --git a/resources/images/b001.png b/resources/images/b001.png new file mode 100644 index 0000000..57ad15a Binary files /dev/null and b/resources/images/b001.png differ diff --git a/resources/images/b002.png b/resources/images/b002.png new file mode 100644 index 0000000..229f2cb Binary files /dev/null and b/resources/images/b002.png differ diff --git a/resources/images/b003.png b/resources/images/b003.png new file mode 100644 index 0000000..89f777a Binary files /dev/null and b/resources/images/b003.png differ diff --git a/resources/images/b004.png b/resources/images/b004.png new file mode 100644 index 0000000..8e6d211 Binary files /dev/null and b/resources/images/b004.png differ diff --git a/resources/images/b005.png b/resources/images/b005.png new file mode 100644 index 0000000..d4fc150 Binary files /dev/null and b/resources/images/b005.png differ diff --git a/resources/images/b006.png b/resources/images/b006.png new file mode 100644 index 0000000..01748ff Binary files /dev/null and b/resources/images/b006.png differ diff --git a/resources/images/b007.png b/resources/images/b007.png new file mode 100644 index 0000000..85bda2d Binary files /dev/null and b/resources/images/b007.png differ diff --git a/resources/images/b008.png b/resources/images/b008.png new file mode 100644 index 0000000..1de1b2b Binary files /dev/null and b/resources/images/b008.png differ diff --git a/resources/images/b009.png b/resources/images/b009.png new file mode 100644 index 0000000..92519fb Binary files /dev/null and b/resources/images/b009.png differ diff --git a/resources/images/b010.png b/resources/images/b010.png new file mode 100644 index 0000000..6fda0a9 Binary files /dev/null and b/resources/images/b010.png differ diff --git a/resources/images/b011.png b/resources/images/b011.png new file mode 100644 index 0000000..31453e8 Binary files /dev/null and b/resources/images/b011.png differ diff --git a/resources/images/b012.png b/resources/images/b012.png new file mode 100644 index 0000000..ae085a4 Binary files /dev/null and b/resources/images/b012.png differ diff --git a/resources/images/b013.png b/resources/images/b013.png new file mode 100644 index 0000000..adf22f7 Binary files /dev/null and b/resources/images/b013.png differ diff --git a/resources/images/b014.png b/resources/images/b014.png new file mode 100644 index 0000000..45c685f Binary files /dev/null and b/resources/images/b014.png differ diff --git a/resources/images/b015.png b/resources/images/b015.png new file mode 100644 index 0000000..c2bd0bd Binary files /dev/null and b/resources/images/b015.png differ diff --git a/resources/images/b016.png b/resources/images/b016.png new file mode 100644 index 0000000..a91c33a Binary files /dev/null and b/resources/images/b016.png differ diff --git a/resources/images/b017.png b/resources/images/b017.png new file mode 100644 index 0000000..61ffa3e Binary files /dev/null and b/resources/images/b017.png differ diff --git a/resources/images/b018.png b/resources/images/b018.png new file mode 100644 index 0000000..7564a8d Binary files /dev/null and b/resources/images/b018.png differ diff --git a/resources/images/b019.png b/resources/images/b019.png new file mode 100644 index 0000000..bdd7ef1 Binary files /dev/null and b/resources/images/b019.png differ diff --git a/resources/images/b020.png b/resources/images/b020.png new file mode 100644 index 0000000..de4583e Binary files /dev/null and b/resources/images/b020.png differ diff --git a/resources/images/b021.png b/resources/images/b021.png new file mode 100644 index 0000000..422a6d2 Binary files /dev/null and b/resources/images/b021.png differ diff --git a/resources/images/b022.png b/resources/images/b022.png new file mode 100644 index 0000000..898009b Binary files /dev/null and b/resources/images/b022.png differ diff --git a/resources/images/b023.png b/resources/images/b023.png new file mode 100644 index 0000000..1d16418 Binary files /dev/null and b/resources/images/b023.png differ diff --git a/resources/images/b024.png b/resources/images/b024.png new file mode 100644 index 0000000..2e50db1 Binary files /dev/null and b/resources/images/b024.png differ diff --git a/resources/images/b025.png b/resources/images/b025.png new file mode 100644 index 0000000..2959673 Binary files /dev/null and b/resources/images/b025.png differ diff --git a/resources/images/h001.png b/resources/images/h001.png new file mode 100644 index 0000000..45b97b3 Binary files /dev/null and b/resources/images/h001.png differ diff --git a/resources/images/h002.png b/resources/images/h002.png new file mode 100644 index 0000000..e6cb725 Binary files /dev/null and b/resources/images/h002.png differ diff --git a/resources/images/h003.png b/resources/images/h003.png new file mode 100644 index 0000000..81f7623 Binary files /dev/null and b/resources/images/h003.png differ diff --git a/resources/images/h004.png b/resources/images/h004.png new file mode 100644 index 0000000..d7c4049 Binary files /dev/null and b/resources/images/h004.png differ diff --git a/resources/images/h005.png b/resources/images/h005.png new file mode 100644 index 0000000..ca10e5c Binary files /dev/null and b/resources/images/h005.png differ diff --git a/resources/images/h006.png b/resources/images/h006.png new file mode 100644 index 0000000..bf4ba9a Binary files /dev/null and b/resources/images/h006.png differ diff --git a/resources/images/h007.png b/resources/images/h007.png new file mode 100644 index 0000000..03134d6 Binary files /dev/null and b/resources/images/h007.png differ diff --git a/resources/images/h008.png b/resources/images/h008.png new file mode 100644 index 0000000..9ebbe99 Binary files /dev/null and b/resources/images/h008.png differ diff --git a/resources/images/h009.png b/resources/images/h009.png new file mode 100644 index 0000000..7d98daa Binary files /dev/null and b/resources/images/h009.png differ diff --git a/resources/images/h010.png b/resources/images/h010.png new file mode 100644 index 0000000..e0026d5 Binary files /dev/null and b/resources/images/h010.png differ diff --git a/resources/images/h011.png b/resources/images/h011.png new file mode 100644 index 0000000..5c8f50d Binary files /dev/null and b/resources/images/h011.png differ diff --git a/resources/images/h012.png b/resources/images/h012.png new file mode 100644 index 0000000..a5d5f75 Binary files /dev/null and b/resources/images/h012.png differ diff --git a/resources/images/h013.png b/resources/images/h013.png new file mode 100644 index 0000000..8ea1659 Binary files /dev/null and b/resources/images/h013.png differ diff --git a/resources/images/h014.png b/resources/images/h014.png new file mode 100644 index 0000000..a834ccc Binary files /dev/null and b/resources/images/h014.png differ diff --git a/resources/images/h015.png b/resources/images/h015.png new file mode 100644 index 0000000..55d961f Binary files /dev/null and b/resources/images/h015.png differ diff --git a/resources/images/h016.png b/resources/images/h016.png new file mode 100644 index 0000000..48721fe Binary files /dev/null and b/resources/images/h016.png differ diff --git a/resources/images/h017.png b/resources/images/h017.png new file mode 100644 index 0000000..d5e1610 Binary files /dev/null and b/resources/images/h017.png differ diff --git a/resources/images/h018.png b/resources/images/h018.png new file mode 100644 index 0000000..ffddeb5 Binary files /dev/null and b/resources/images/h018.png differ diff --git a/resources/images/h019.png b/resources/images/h019.png new file mode 100644 index 0000000..654fe66 Binary files /dev/null and b/resources/images/h019.png differ diff --git a/resources/images/h020.png b/resources/images/h020.png new file mode 100644 index 0000000..e139d8b Binary files /dev/null and b/resources/images/h020.png differ diff --git a/resources/images/h021.png b/resources/images/h021.png new file mode 100644 index 0000000..060b192 Binary files /dev/null and b/resources/images/h021.png differ diff --git a/resources/images/h022.png b/resources/images/h022.png new file mode 100644 index 0000000..9d42dc3 Binary files /dev/null and b/resources/images/h022.png differ diff --git a/resources/images/h023.png b/resources/images/h023.png new file mode 100644 index 0000000..36e7a17 Binary files /dev/null and b/resources/images/h023.png differ diff --git a/resources/images/h024.png b/resources/images/h024.png new file mode 100644 index 0000000..d8dae31 Binary files /dev/null and b/resources/images/h024.png differ diff --git a/resources/images/h025.png b/resources/images/h025.png new file mode 100644 index 0000000..d2cc449 Binary files /dev/null and b/resources/images/h025.png differ diff --git a/resources/images/xb001.png b/resources/images/xb001.png new file mode 100644 index 0000000..e110cb6 Binary files /dev/null and b/resources/images/xb001.png differ diff --git a/src/c/main.c b/src/c/main.c index 5f60fdc..8a33cbb 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -4,6 +4,7 @@ // declare general statics static Window *s_main_window; static GFont s_custom_font; +static Layer *s_time_bar_layer; static TextLayer *s_time_layer; static TextLayer *s_date_layer; static BitmapLayer *s_guy_head_layer; @@ -158,6 +159,11 @@ static void minute_handler(struct tm *tick_time, TimeUnits units_changed) { } } +static void time_bar_update_proc(Layer *layer, GContext *ctx) { + graphics_context_set_fill_color(ctx, GColorWhite); + graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone); +} + // define contents of the Window upon load static void main_window_load(Window *window) { Layer *window_layer = window_get_root_layer(window); @@ -165,9 +171,11 @@ static void main_window_load(Window *window) { // format silly guy layers s_guy_head_layer = bitmap_layer_create(s_guy_head_grect_on); s_guy_butt_layer = bitmap_layer_create(s_guy_butt_grect_on); - bitmap_layer_set_background_color(s_guy_head_layer, GColorBlack); + bitmap_layer_set_compositing_mode(s_guy_head_layer, GCompOpSet); + bitmap_layer_set_alignment(s_guy_head_layer, GAlignLeft); bitmap_layer_set_bitmap(s_guy_head_layer, s_head_current); - bitmap_layer_set_background_color(s_guy_butt_layer, GColorBlack); + bitmap_layer_set_compositing_mode(s_guy_butt_layer, GCompOpSet); + bitmap_layer_set_alignment(s_guy_butt_layer, GAlignTopLeft); bitmap_layer_set_bitmap(s_guy_butt_layer, s_butt_current); // format time layer @@ -182,9 +190,15 @@ static void main_window_load(Window *window) { text_layer_set_font(s_date_layer, fonts_get_system_font(FONT_KEY_GOTHIC_14)); text_layer_set_text_alignment(s_date_layer, GTextAlignmentLeft); + // create time bar layer + GRect time_bar_frame = GRect(0, PBL_IF_ROUND_ELSE(115, 99), PBL_IF_ROUND_ELSE(260, 200), 30); + s_time_bar_layer = layer_create(time_bar_frame); + layer_set_update_proc(s_time_bar_layer, time_bar_update_proc); + // add layers as children to window layer_add_child(window_layer, bitmap_layer_get_layer(s_guy_head_layer)); layer_add_child(window_layer, bitmap_layer_get_layer(s_guy_butt_layer)); + layer_add_child(window_layer, s_time_bar_layer); layer_add_child(window_layer, text_layer_get_layer(s_time_layer)); layer_add_child(window_layer, text_layer_get_layer(s_date_layer)); } @@ -224,6 +238,9 @@ static void init() { .load = main_window_load, .unload = main_window_unload}); + // set app background color + window_set_background_color(s_main_window, GColorBlack); + // load initial batch of silly guy parts into memory s_head_current = gbitmap_create_with_resource(s_random_heads[rand() % s_head_count]); s_butt_current = gbitmap_create_with_resource(s_random_butts[rand() % s_butt_count]);