Exemplo n.º 1
0
void InitializeMenuLayers(Window *window)
{
	Layer *window_layer = window_get_root_layer(window);
	
	int i;
	for(i = 0; i < MAX_MENU_ENTRIES; ++i)
	{
		if(!menuLayersInitialized)
		{
			GRect menuFrame = baseMenuFrame;
			menuFrame.origin.y += i * WINDOW_ROW_HEIGHT;
			menuLayers[i] = InitializeTextLayer(menuFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
			
		}
		layer_add_child(window_layer, text_layer_get_layer(menuLayers[i]));
		layer_set_hidden(text_layer_get_layer(menuLayers[i]), true);
	}

	if(!menuLayersInitialized)
	{
		// Init the text layer used to show the menu description
		menuDescLayer = InitializeTextLayer(menuDescFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
		
		menuLayersInitialized = true;
	}
	
	layer_add_child(window_layer, text_layer_get_layer(menuDescLayer));
}
Exemplo n.º 2
0
void InitializeMenuLayers(Window *window)
{
	int i;
	for(i = 0; i < MAX_MENU_ENTRIES; ++i)
	{
		if(!menuLayersInitialized)
		{
			GRect menuFrame = baseMenuFrame;
			menuFrame.origin.y += i * WINDOW_ROW_HEIGHT;
			InitializeTextLayer(&menuLayers[i], menuFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
		}
		layer_add_child(&window->layer, &menuLayers[i].layer);
		layer_set_hidden(&menuLayers[i].layer, true);
	}

	if(!menuLayersInitialized)
	{
		// Init the text layer used to show the menu description
		InitializeTextLayer(&menuDescLayer, menuDescFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
		
		menuLayersInitialized = true;
	}
	
	layer_add_child(&window->layer, &menuDescLayer.layer);
}
Exemplo n.º 3
0
void InitializeHealthLayer(Window *window)
{
	if(!healthLayersInitialized)
	{
		InitializeTextLayer(&currentHealthLayer, currentHealthFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
		InitializeTextLayer(&maxHealthLayer, maxHealthFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
		
		healthLayersInitialized = true;
	}

	layer_add_child(&window->layer, &currentHealthLayer.layer);
	layer_add_child(&window->layer, &maxHealthLayer.layer);
}
Exemplo n.º 4
0
void InitializeHealthLayer(Window *window)
{
	Layer *window_layer = window_get_root_layer(window);
	if(!healthLayersInitialized)
	{
		currentHealthLayer = InitializeTextLayer(currentHealthFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
		maxHealthLayer = InitializeTextLayer(maxHealthFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
		
		healthLayersInitialized = true;
	}

	layer_add_child(window_layer, text_layer_get_layer(currentHealthLayer));
	layer_add_child(window_layer, text_layer_get_layer(maxHealthLayer));
}
Exemplo n.º 5
0
void InitializeConfirmationWindow(Window *window, TextLayer *exitText, TextLayer *yesText, TextLayer *noText)
{
	InitializeWindow(window, "Exit", true);

	InitializeTextLayer(exitText, exitFrame, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
	text_layer_set_text(exitText, "Exit?");
	text_layer_set_text_alignment(exitText, GTextAlignmentCenter);
	layer_add_child(&window->layer, &exitText->layer);

	InitializeTextLayer(yesText, yesFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
	text_layer_set_text(yesText, "Yes");
	layer_add_child(&window->layer, &yesText->layer);

	InitializeTextLayer(noText, noFrame, fonts_get_system_font(FONT_KEY_GOTHIC_18_BOLD));
	text_layer_set_text(noText, "No");
	layer_add_child(&window->layer, &noText->layer);
}
Exemplo n.º 6
0
void InitializeLevelLayer(Window *window)
{
	if(!levelLayerInitialized)
	{
		InitializeTextLayer(&levelLayer, levelFrame, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
		levelLayerInitialized = true;
	}
	layer_add_child(&window->layer, &levelLayer.layer);
}
Exemplo n.º 7
0
void InitializeLevelLayer(Window *window)
{
	Layer *window_layer = window_get_root_layer(window);
	if(!levelLayerInitialized)
	{
		levelLayer = InitializeTextLayer(levelFrame, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
		levelLayerInitialized = true;
	}
	layer_add_child(window_layer, text_layer_get_layer(levelLayer));
}
Exemplo n.º 8
0
void InitializeClockLayer(Window *window)
{
	if(!clockLayerInitialized)
	{
		// Init the text layer used to show the time
		InitializeTextLayer(&clockLayer, clockFrame, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
		clockLayerInitialized = true;
		UpdateClock();
	}
	layer_add_child(&window->layer, &clockLayer.layer);
}
Exemplo n.º 9
0
void InitializeClockLayer(Window *window)
{
	Layer *window_layer = window_get_root_layer(window);
	if(!clockLayerInitialized)
	{
		// Init the text layer used to show the time
		clockLayer = InitializeTextLayer(clockFrame, fonts_get_system_font(FONT_KEY_GOTHIC_28_BOLD));
		clockLayerInitialized = true;
		UpdateClock();
	}
	layer_add_child(window_layer, text_layer_get_layer(clockLayer));
}
Exemplo n.º 10
0
void InitializeMainLayers(Window *window)
{
	int i;
	for(i = 0; i < MAX_MAIN_TEXT_LAYERS; ++i)
	{
		if(!mainLayersInitialized)
		{
			GRect localFrame = mainTextBaseFrame;
			localFrame.origin.y += i * WINDOW_ROW_HEIGHT;
			InitializeTextLayer(&mainTextLayers[i], localFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
			localFrame = mainNumberBaseFrame;
			localFrame.origin.y += i * WINDOW_ROW_HEIGHT;
			InitializeTextLayer(&mainNumberLayers[i], localFrame, fonts_get_system_font(FONT_KEY_GOTHIC_14));
			text_layer_set_text_alignment(&mainNumberLayers[i], GTextAlignmentRight);
		}

		layer_add_child(&window->layer, &mainTextLayers[i].layer);
		layer_set_hidden(&mainTextLayers[i].layer, true);
		layer_add_child(&window->layer, &mainNumberLayers[i].layer);
		layer_set_hidden(&mainNumberLayers[i].layer, true);
	}
	mainLayersInitialized = true;
}