本文整理汇总了C++中resource_get_handle函数的典型用法代码示例。如果您正苦于以下问题:C++ resource_get_handle函数的具体用法?C++ resource_get_handle怎么用?C++ resource_get_handle使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了resource_get_handle函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_fonts
// define all the fonts used
static void load_fonts() {
s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_NHL_VAN_64));
s_date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_NHL_VAN_28));
s_temperature_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_NHL_VAN_22));
s_battery_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_NHL_VAN_22));
s_colon_font = fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD);
}
示例2: main_window_load
static void main_window_load(Window *window) {
// Create GFonts
s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_48));
s_weather_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_20));
// Create GBitmap, then set to created BitmapLayer
s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
s_background_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));
// Create the weather TextLayer
s_weather_layer = text_layer_create(GRect(0, 130, 144, 25));
text_layer_set_background_color(s_weather_layer, GColorClear);
text_layer_set_text_color(s_weather_layer, GColorWhite);
text_layer_set_text_alignment(s_weather_layer, GTextAlignmentCenter);
text_layer_set_text(s_weather_layer, "Loading...");
text_layer_set_font(s_weather_layer, s_weather_font);
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_weather_layer));
// Create the time TextLayer
s_time_layer = text_layer_create(GRect(5,52,139,50));
text_layer_set_background_color(s_time_layer, GColorClear);
text_layer_set_text_color(s_time_layer, GColorBlack);
text_layer_set_font(s_time_layer, s_time_font);
text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_time_layer));
}
示例3: window_load
static void window_load(Window *window) {
font24 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_24));
font18 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_18));
Layer *window_layer = window_get_root_layer(window);
// add the doge face
image = gbitmap_create_with_resource(RESOURCE_ID_DOGEFACE);
image_layer = bitmap_layer_create(GRect(8, 0, 132, 116));
bitmap_layer_set_bitmap(image_layer, image);
layer_add_child(window_layer, bitmap_layer_get_layer(image_layer));
text_time_layer = text_layer_create(GRect(12, 120, 132, 144));
text_layer_set_text_alignment(text_time_layer, GTextAlignmentCenter);
text_layer_set_text_color(text_time_layer, GColorBlack);
text_layer_set_background_color(text_time_layer, GColorClear);
text_layer_set_font(text_time_layer, font24);
layer_add_child(window_layer, text_layer_get_layer(text_time_layer));
text_price_layer = text_layer_create(GRect(12, 146, 132, 167));
text_layer_set_text_alignment(text_price_layer, GTextAlignmentCenter);
text_layer_set_text_color(text_price_layer, GColorBlack);
text_layer_set_background_color(text_price_layer, GColorClear);
text_layer_set_font(text_price_layer, font18);
layer_add_child(window_layer, text_layer_get_layer(text_price_layer));
}
示例4: handle_init
static void handle_init(AppContextRef ctx) {
(void) ctx;
window_init(&s_data.window, "Clock_Window");
const bool animated = true;
window_stack_push(&s_data.window, animated);
window_set_background_color(&s_data.window, GColorBlack);
resource_init_current_app(&APP_RESOURCES);
//GFont gotham = fonts_get_system_font(FONT_KEY_DROID_SERIF_28_BOLD);
GFont fontPlain = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SANSATION_LIGHT_42));
GFont fontBold = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SANSATION_BOLD_42));
text_layer_init(&s_data.label, GRect(0, 0, s_data.window.layer.frame.size.w, 100));
text_layer_init(&s_data.label2, GRect(0, 37, s_data.window.layer.frame.size.w, s_data.window.layer.frame.size.h - 37));
text_layer_set_background_color(&s_data.label, GColorClear);
text_layer_set_background_color(&s_data.label2, GColorClear);
text_layer_set_text_color(&s_data.label, GColorWhite);
text_layer_set_text_color(&s_data.label2, GColorWhite);
text_layer_set_font(&s_data.label, fontBold);
text_layer_set_font(&s_data.label2, fontPlain);
layer_add_child(&s_data.window.layer, &s_data.label.layer);
layer_add_child(&s_data.window.layer, &s_data.label2.layer);
PblTm t;
get_time(&t);
update_time(&t);
}
示例5: window_load
static void window_load(Window *window) {
Layer *window_layer = window_get_root_layer(window);
GRect bounds = layer_get_bounds(window_layer);
const GPoint center = grect_center_point(&bounds);
//Load bitmap image
background_layer = layer_create(bounds);
layer_set_update_proc(background_layer, background_layer_update);
layer_add_child(window_layer, background_layer);
custom_font_text = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_BOXY_TEXT_20));
custom_font_outline = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_BOXY_OUTLINE_20));
//Add analog hands
analog_init(my_window);
// Render layer ontop for cool transparency
render_layer = layer_create(bounds);
layer_set_update_proc(render_layer, render_layer_update);
layer_add_child(window_layer, render_layer);
//Force time update
time_t current_time = time(NULL);
struct tm *current_tm = localtime(¤t_time);
tick_handler(current_tm, MINUTE_UNIT | DAY_UNIT);
//Setup tick time handler
tick_timer_service_subscribe((MINUTE_UNIT), tick_handler);
}
示例6: handle_init
void handle_init(void) {
window = window_create();
window_stack_push(window, true /* Animated */);
window_set_background_color(window, GColorBlack);
Layer *window_layer = window_get_root_layer(window);
text_date_layer = text_layer_create(GRect(8, 68, 144-8, 168-68));
text_layer_set_text_color(text_date_layer, GColorWhite);
text_layer_set_background_color(text_date_layer, GColorClear);
text_layer_set_font(text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
layer_add_child(window_layer, text_layer_get_layer(text_date_layer));
text_time_layer = text_layer_create(GRect(7, 92, 144-7, 168-92));
text_layer_set_text_color(text_time_layer, GColorWhite);
text_layer_set_background_color(text_time_layer, GColorClear);
text_layer_set_font(text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49)));
layer_add_child(window_layer, text_layer_get_layer(text_time_layer));
GRect line_frame = GRect(8, 97, 139, 2);
line_layer = layer_create(line_frame);
layer_set_update_proc(line_layer, line_layer_update_callback);
layer_add_child(window_layer, line_layer);
// Ensures time is displayed immediately (will break if NULL tick event accessed).
// (This is why it's a good idea to have a separate routine to do the update itself.)
time_t now = time(NULL);
struct tm *current_time = localtime(&now);
handle_minute_tick(current_time, MINUTE_UNIT);
tick_timer_service_subscribe(MINUTE_UNIT, handle_minute_tick);
}
示例7: handle_init
void handle_init(AppContextRef ctx) {
(void)ctx;
window_init(&window, "Orbit");
window_stack_push(&window, false /* Not Animated */);
window_set_background_color(&window, GColorBlack);
resource_init_current_app(&RESOURCES);
bmp_init_container(RESOURCE_ID_IMAGE_FACE, &faceImage);
layer_add_child(&window.layer, &faceImage.layer.layer);
rotbmp_pair_init_container(RESOURCE_ID_IMAGE_MINUTE_PLANET_WHITE, RESOURCE_ID_IMAGE_MINUTE_PLANET_BLACK, &minuteImage);
layer_add_child(&window.layer, &minuteImage.layer.layer);
rotbmp_pair_init_container(RESOURCE_ID_IMAGE_HOUR_PLANET_WHITE, RESOURCE_ID_IMAGE_HOUR_PLANET_BLACK, &hourImage);
layer_add_child(&window.layer, &hourImage.layer.layer);
text_layer_init(&minuteText, GRect(0,0,0,0));
text_layer_set_text_color(&minuteText, GColorWhite);
text_layer_set_background_color(&minuteText, GColorClear);
text_layer_set_text_alignment(&minuteText, GTextAlignmentCenter);
text_layer_set_font(&minuteText, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_14)));
layer_add_child(&window.layer, &minuteText.layer);
text_layer_init(&hourText, GRect(0,0,0,0));
text_layer_set_text_color(&hourText, GColorWhite);
text_layer_set_background_color(&hourText, GColorClear);
text_layer_set_text_alignment(&hourText, GTextAlignmentCenter);
text_layer_set_font(&hourText, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_22)));
layer_add_child(&window.layer, &hourText.layer);
update_rings();
}
示例8: window_load
static void window_load(Window *window) {
Layer *window_layer = window_get_root_layer(window);
font49 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49));
font39 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_39));
font21 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21));
// create time layer - this is where time goes
text_time_layer = text_layer_create(GRect(8, 24, 144-7, 168-92));
text_layer_set_text_color(text_time_layer, GColorWhite);
text_layer_set_background_color(text_time_layer, GColorClear);
text_layer_set_font(text_time_layer, font49);
layer_add_child(window_layer, text_layer_get_layer(text_time_layer));
// create date layer - this is where the date goes
text_date_layer = text_layer_create(GRect(8, 0, 144-16, 24));
text_layer_set_text_alignment(text_date_layer, GTextAlignmentCenter);
text_layer_set_text_color(text_date_layer, GColorWhite);
text_layer_set_background_color(text_date_layer, GColorClear);
text_layer_set_font(text_date_layer, font21);
layer_add_child(window_layer, text_layer_get_layer(text_date_layer));
// create temperature layer - this is where the temperature goes
text_temp_layer = text_layer_create(GRect(80, 108, 144-80, 168-108));
text_layer_set_text_color(text_temp_layer, GColorWhite);
text_layer_set_background_color(text_temp_layer, GColorClear);
text_layer_set_font(text_temp_layer, font39);
layer_add_child(window_layer, text_layer_get_layer(text_temp_layer));
}
示例9: handle_init
void handle_init(AppContextRef ctx) {
(void)ctx;
window_init(&window, "Demo");
window_stack_push(&window, true /* Animated */);
resource_init_current_app(&FUZZYZEIT_RESOURCES);
custom_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_MPC_32));
custom_font2 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_MPBC_32));
window_set_background_color(&window, GColorBlack);
graphics_context_set_text_color(ctx, GColorWhite);
text_layer_init(&min_layer, GRect(4, 35, 144 /* width */, 50 /* height */));
text_layer_set_text_color(&min_layer, GColorWhite);
text_layer_set_text(&min_layer, "");
text_layer_set_font(&min_layer, custom_font);
text_layer_set_background_color(&min_layer, GColorClear);
layer_add_child(&window.layer, &min_layer.layer);
layer_mark_dirty(&min_layer.layer);
text_layer_init(&hour_layer, GRect(4, 80, 144 /* width */, 50 /* height */));
text_layer_set_text_color(&hour_layer, GColorWhite);
text_layer_set_text(&hour_layer, "");
text_layer_set_font(&hour_layer, custom_font2);
text_layer_set_background_color(&hour_layer, GColorClear);
layer_add_child(&window.layer, &hour_layer.layer);
layer_mark_dirty(&hour_layer.layer);
update_layer(ctx);
}
示例10: set_text_to_window
static void set_text_to_window() {
//Time TextLayer
s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_CRYSTAL_36));
s_time_layer = text_layer_create(GRect(5, 50, 130, 40));
text_layer_set_background_color(s_time_layer, GColorClear);
text_layer_set_text_color(s_time_layer, GColorWhite);
text_layer_set_text(s_time_layer, "00:00");
text_layer_set_font(s_time_layer, s_time_font);
text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);
//Time TextLayer
s_timephase_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_CRYSTAL_18));
timephase_layer = text_layer_create(GRect(85, 85, 30, 30));
text_layer_set_background_color(timephase_layer, GColorClear);
text_layer_set_text_color(timephase_layer, GColorWhite);
text_layer_set_text(timephase_layer, "00");
text_layer_set_font(timephase_layer, s_timephase_font);
text_layer_set_text_alignment(timephase_layer, GTextAlignmentCenter);
// Create current date TextLayer
s_date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_CRYSTAL_18));
current_date_layer = text_layer_create(GRect(12, 133, 120, 30));
text_layer_set_background_color(current_date_layer, GColorClear);
text_layer_set_text_color(current_date_layer, GColorWhite);
text_layer_set_text(current_date_layer, "00.00 000");
text_layer_set_font(current_date_layer, s_date_font);
text_layer_set_text_alignment(current_date_layer, GTextAlignmentCenter);
}
示例11: handle_init
void handle_init( void )
{
// Create the window, add it to the stack, and get its boundaries.
window = window_create();
window_stack_push( window, true );
GRect window_bounds = layer_get_bounds( window_get_root_layer(window) );
// Init the background image layer.
background_image = gbitmap_create_with_resource( RESOURCE_ID_IMAGE_BACKGROUND );
background_layer = bitmap_layer_create( window_bounds );
bitmap_layer_set_bitmap( background_layer, background_image );
layer_add_child( window_get_root_layer(window), bitmap_layer_get_layer(background_layer) );
// Init the text layer used to show the time.
time_layer = text_layer_create( GRect( 54, 1, 144, 168 ) );
text_layer_set_text_color( time_layer, GColorBlack );
text_layer_set_background_color( time_layer, GColorClear );
text_layer_set_font( time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_CHICAGO_13)) );
layer_add_child( window_get_root_layer(window), text_layer_get_layer(time_layer) );
// Init the text layer used to show the date.
date_layer = text_layer_create( GRect( 9, 86, 144, 168 ) );
text_layer_set_text_color( date_layer, GColorBlack );
text_layer_set_background_color( date_layer, GColorClear );
text_layer_set_font( date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_GENEVA_12)) );
layer_add_child( window_get_root_layer(window), text_layer_get_layer(date_layer) );
// Avoid a blank screen on watch start.
time_t t = time( NULL );
struct tm *tick_time = localtime( &t );
update_display( tick_time );
// Request an update signal every minute.
tick_timer_service_subscribe( MINUTE_UNIT, handle_tick );
}
示例12: main_window_load
static void main_window_load(Window *window) {
s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_BACKGROUND_TEST);
s_background_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));
s_time_layer = text_layer_create(GRect(5, 55, 139, 50));
s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_42));
init_text_layer(s_time_layer, s_time_font, GColorBlack, GColorClear, GTextAlignmentCenter);
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_time_layer));
s_weather_layer = text_layer_create(GRect(5, 15, 139, 25));
s_weather_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_PERFECT_DOS_20));
init_text_layer(s_weather_layer, s_weather_font, GColorWhite, GColorClear, GTextAlignmentCenter);
text_layer_set_text(s_weather_layer, "Loading...");
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_weather_layer));
s_wday_layer = text_layer_create(GRect(5, 115, 139, 25));
init_text_layer(s_wday_layer, s_weather_font, GColorWhite, GColorClear, GTextAlignmentCenter);
text_layer_set_text(s_wday_layer, "...");
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_wday_layer));
s_date_layer = text_layer_create(GRect(5, 143, 139, 25));
init_text_layer(s_date_layer, s_weather_font, GColorWhite, GColorClear, GTextAlignmentCenter);
text_layer_set_text(s_date_layer, "...");
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_date_layer));
update_time();
}
示例13: main_window_load
static void main_window_load(Window *window) {
// Create Background Layer
s_background_bitmap = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_BACKGROUND);
s_background_layer = bitmap_layer_create(GRect(0, 0, 144, 168));
bitmap_layer_set_bitmap(s_background_layer, s_background_bitmap);
// Create time Textlayer
s_time_layer = text_layer_create(GRect(5, 52, 139, 50));
text_layer_set_background_color(s_time_layer, GColorClear);
text_layer_set_text_color(s_time_layer, GColorWhite);
// Create trends TextLayer
s_trending_layer = text_layer_create(GRect(0, 110, 144, 25));
text_layer_set_background_color(s_trending_layer, GColorClear);
text_layer_set_text_color(s_trending_layer, GColorWhite);
text_layer_set_text(s_trending_layer, "Mewing...");
// Time Font
s_time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_ROBOTO_CONDENSED_BOLD_42));
text_layer_set_font(s_time_layer, s_time_font);
text_layer_set_text_alignment(s_time_layer, GTextAlignmentCenter);
// Trending Font
s_trending_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_ROBOTO_CONDENSED_LT_20));
text_layer_set_font(s_trending_layer, s_trending_font);
text_layer_set_text_alignment(s_trending_layer, GTextAlignmentCenter);
//Add layers in order as child layers to the Window's root layer
layer_add_child(window_get_root_layer(window), bitmap_layer_get_layer(s_background_layer));
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_time_layer));
layer_add_child(window_get_root_layer(window), text_layer_get_layer(s_trending_layer));
}
示例14: window_load
static void window_load(Window *window) {
Layer *window_layer = window_get_root_layer(window);
// GRect bounds = layer_get_bounds(window_layer);
deco_layer = layer_create(GRect(0, 0, 144, 8));
layer_set_update_proc(deco_layer, deco_layer_onupdate);
arrow_image = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_ARROW_24);
image_layer = bitmap_layer_create(GRect(12, 20, 24, 24));
bitmap_layer_set_bitmap(image_layer, arrow_image);
text_layer = text_layer_create(GRect(16, 113, 128, 24));
text_layer_set_background_color(text_layer, METRO_APP_BACK_COLOR);
text_layer_set_text_color(text_layer, METRO_APP_TEXT_COLOR);
text_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_OSWALD_LIGHT_18));
text_layer_set_font(text_layer, text_font);
time_layer = text_layer_create(GRect(16, 58, 128, 48));
text_layer_set_background_color(time_layer, METRO_APP_BACK_COLOR);
text_layer_set_text_color(time_layer, METRO_APP_TEXT_COLOR);
time_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_OSWALD_REGULAR_48));
text_layer_set_font(time_layer, time_font);
layer_add_child(window_layer, deco_layer);
layer_add_child(window_layer, bitmap_layer_get_layer(image_layer));
layer_add_child(window_layer, text_layer_get_layer(text_layer));
layer_add_child(window_layer, text_layer_get_layer(time_layer));
}
示例15: handle_init
void handle_init(AppContextRef ctx) {
window_init(&window, "Simplicity");
window_stack_push(&window, true /* Animated */);
window_set_background_color(&window, GColorBlack);
resource_init_current_app(&APP_RESOURCES);
layer_init(&time_layer, GRect(0, 12, 144, 168-68));
layer_add_child(&window.layer, &time_layer);
text_layer_init(&text_date_layer, window.layer.frame);
text_layer_set_text_color(&text_date_layer, GColorWhite);
text_layer_set_background_color(&text_date_layer, GColorClear);
layer_set_frame(&text_date_layer.layer, GRect(8, 0, 144-8, 168-68));
text_layer_set_font(&text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
layer_add_child(&time_layer, &text_date_layer.layer);
text_layer_init(&text_time_layer, window.layer.frame);
text_layer_set_text_color(&text_time_layer, GColorWhite);
text_layer_set_background_color(&text_time_layer, GColorClear);
layer_set_frame(&text_time_layer.layer, GRect(7, 24, 144-7, 168-92));
text_layer_set_font(&text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49)));
layer_add_child(&time_layer, &text_time_layer.layer);
layer_init(&line_layer, window.layer.frame);
line_layer.update_proc = &line_layer_update_callback;
layer_add_child(&time_layer, &line_layer);
layer_init(&car_layer, GRect(0, 90, 144, 168-90));
layer_add_child(&window.layer, &car_layer);
text_layer_init(&text_rated_layer, window.layer.frame);
text_layer_set_text_color(&text_rated_layer, GColorWhite);
text_layer_set_background_color(&text_rated_layer, GColorClear);
layer_set_frame(&text_rated_layer.layer, GRect(8, 0, 144-8, 168-68));
text_layer_set_font(&text_rated_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
layer_add_child(&car_layer, &text_rated_layer.layer);
text_layer_init(&text_state_layer, window.layer.frame);
text_layer_set_text_color(&text_state_layer, GColorWhite);
text_layer_set_background_color(&text_state_layer, GColorClear);
layer_set_frame(&text_state_layer.layer, GRect(8, 20, 144-8, 168-68));
text_layer_set_font(&text_state_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
layer_add_child(&car_layer, &text_state_layer.layer);
layer_init(&battery_layer, GRect(72, 10, 144-70, 10));
battery_layer.update_proc = &battery_layer_update_callback;
layer_add_child(&car_layer, &battery_layer);
Tuplet initial_values[] = {
TupletInteger(TESLA_RATED_REMAIN_KEY, (uint16_t) 148),
TupletCString(TESLA_STATE_STRING_KEY, "Charging"),
TupletInteger(TESLA_BATTERY_PERCENT_KEY, (uint8_t) 72),
};
app_sync_init(&sync, sync_buffer, sizeof(sync_buffer), initial_values, ARRAY_LENGTH(initial_values),
sync_tuple_changed_callback, sync_error_callback, NULL);
}