示例#1
0
void CreditsScreen::render() {
    UIShader_Prepare();
    UIBegin();
    DrawBackground(1.0f);

    const int numItems = ARRAY_SIZE(credits);
    int itemHeight = 36;
    int totalHeight = numItems * itemHeight + dp_yres + 200;
    int y = dp_yres - (frames_ % totalHeight);
    for (int i = 0; i < numItems; i++) {
        float alpha = linearInOut(y+32, 64, dp_yres - 192, 64);
        if (alpha > 0.0f) {
            UIText(dp_xres/2, y, credits[i], whiteAlpha(alpha), ease(alpha), ALIGN_HCENTER);
        }
        y += itemHeight;
    }

    if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), 200, "Back", ALIGN_BOTTOMRIGHT)) {
        screenManager()->switchScreen(new MenuScreen());
    }

    UIEnd();

    glsl_bind(UIShader_Get());
    ui_draw2d.Flush(UIShader_Get());
}
示例#2
0
void CreditsScreen::render() {
	// TODO: This is kinda ugly, done on every frame...
	char temp[256];
	sprintf(temp, "PPSSPP %s", PPSSPP_GIT_VERSION);
	credits[0] = (const char *)temp;

	UIShader_Prepare();
	UIBegin(UIShader_Get());
	DrawBackground(1.0f);

	const int numItems = ARRAY_SIZE(credits);
	int itemHeight = 36;
	int totalHeight = numItems * itemHeight + dp_yres + 200;
	int y = dp_yres - (frames_ % totalHeight);
	for (int i = 0; i < numItems; i++) {
		float alpha = linearInOut(y+32, 64, dp_yres - 192, 64);
		if (alpha > 0.0f) {
			UIText(dp_xres/2, y, credits[i], whiteAlpha(alpha), ease(alpha), ALIGN_HCENTER);
		}
		y += itemHeight;
	}
	I18NCategory *g = GetI18NCategory("General");

	if (UIButton(GEN_ID, Pos(dp_xres - 10, dp_yres - 10), 200, 0, g->T("Back"), ALIGN_BOTTOMRIGHT)) {
		screenManager()->switchScreen(new MenuScreen());
	}

	UIEnd();
}