mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
PPGe: Left align messages in dialogs.
It was previously left aligned, but the TextDrawer was being told to center. These are meant to just center the enclosing box of text, not the individual lines within. Makes Final Fantasy 3 look a lot better.
This commit is contained in:
parent
2d4e45d229
commit
4f586f9567
7 changed files with 94 additions and 97 deletions
|
@ -217,13 +217,13 @@ void PSPDialog::DisplayButtons(int flags, const char *caption)
|
||||||
const char *text = useCaption ? safeCaption : di->T("Enter");
|
const char *text = useCaption ? safeCaption : di->T("Enter");
|
||||||
PPGeDrawImage(okButtonImg, x2, 258, 11.5f, 11.5f, 0, CalcFadedColor(0x80000000));
|
PPGeDrawImage(okButtonImg, x2, 258, 11.5f, 11.5f, 0, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawImage(okButtonImg, x2, 256, 11.5f, 11.5f, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(okButtonImg, x2, 256, 11.5f, 11.5f, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(text, x2 + 15.5f, 254, PPGE_ALIGN_LEFT, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(text, x2 + 15.5f, 254, PPGeAlign::BOX_LEFT, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(text, x2 + 14.5f, 252, PPGE_ALIGN_LEFT, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(text, x2 + 14.5f, 252, PPGeAlign::BOX_LEFT, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
if (flags & DS_BUTTON_CANCEL) {
|
if (flags & DS_BUTTON_CANCEL) {
|
||||||
const char *text = useCaption ? safeCaption : di->T("Back");
|
const char *text = useCaption ? safeCaption : di->T("Back");
|
||||||
PPGeDrawText(text, x1 + 15.5f, 254, PPGE_ALIGN_LEFT, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(text, x1 + 15.5f, 254, PPGeAlign::BOX_LEFT, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(text, x1 + 14.5f, 252, PPGE_ALIGN_LEFT, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(text, x1 + 14.5f, 252, PPGeAlign::BOX_LEFT, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawImage(cancelButtonImg, x1, 258, 11.5f, 11.5f, 0, CalcFadedColor(0x80000000));
|
PPGeDrawImage(cancelButtonImg, x1, 258, 11.5f, 11.5f, 0, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawImage(cancelButtonImg, x1, 256, 11.5f, 11.5f, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(cancelButtonImg, x1, 256, 11.5f, 11.5f, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
|
@ -178,10 +178,10 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK)
|
||||||
h2 += h + 5.0f;
|
h2 += h + 5.0f;
|
||||||
y = 135.0f - h;
|
y = 135.0f - h;
|
||||||
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x6DCFCFCF));
|
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x6DCFCFCF));
|
||||||
PPGeDrawText(di->T("Yes"), 204.0f, y2 + 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(di->T("Yes"), 204.0f, y2 + 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(di->T("Yes"), 203.0f, y2 - 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
|
PPGeDrawText(di->T("Yes"), 203.0f, y2 - 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
|
||||||
PPGeDrawText(di->T("No"), 273.0f, y2 + 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(di->T("No"), 273.0f, y2 + 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(di->T("No"), 272.0f, y2 - 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(noColor));
|
PPGeDrawText(di->T("No"), 272.0f, y2 - 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(noColor));
|
||||||
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
|
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
|
||||||
yesnoChoice = 1;
|
yesnoChoice = 1;
|
||||||
}
|
}
|
||||||
|
@ -201,13 +201,13 @@ void PSPMsgDialog::DisplayMessage(std::string text, bool hasYesNo, bool hasOK)
|
||||||
h2 += h + 5.0f;
|
h2 += h + 5.0f;
|
||||||
y = 135.0f - h;
|
y = 135.0f - h;
|
||||||
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x6DCFCFCF));
|
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x6DCFCFCF));
|
||||||
PPGeDrawText(di->T("OK"), 240.0f, y2 + 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(di->T("OK"), 240.0f, y2 + 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(di->T("OK"), 239.0f, y2 - 1.0f, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("OK"), 239.0f, y2 - 1.0f, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
||||||
ey = y2 + 25.0f;
|
ey = y2 + 25.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
PPGeDrawTextWrapped(text.c_str(), 241.0f, y+2, WRAP_WIDTH, 0, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawTextWrapped(text.c_str(), 241.0f, y+2, WRAP_WIDTH, 0, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawTextWrapped(text.c_str(), 240.0f, y, WRAP_WIDTH, 0, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawTextWrapped(text.c_str(), 240.0f, y, WRAP_WIDTH, 0, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
||||||
sy = 125.0f - h2;
|
sy = 125.0f - h2;
|
||||||
PPGeDrawRect(40.0f, sy, 440.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawRect(40.0f, sy, 440.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawRect(40.0f, ey, 440.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawRect(40.0f, ey, 440.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
|
@ -68,7 +68,7 @@ void PSPNetconfDialog::DrawBanner() {
|
||||||
// TODO: Draw a hexagon icon
|
// TODO: Draw a hexagon icon
|
||||||
PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
|
||||||
auto di = GetI18NCategory("Dialog");
|
auto di = GetI18NCategory("Dialog");
|
||||||
PPGeDrawText(di->T("Network Connection"), 30, 11, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Network Connection"), 30, 11, PPGeAlign::BOX_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
int PSPNetconfDialog::Update(int animSpeed) {
|
int PSPNetconfDialog::Update(int animSpeed) {
|
||||||
|
@ -88,9 +88,9 @@ int PSPNetconfDialog::Update(int animSpeed) {
|
||||||
StartDraw();
|
StartDraw();
|
||||||
DrawBanner();
|
DrawBanner();
|
||||||
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x63636363));
|
PPGeDrawRect(0, 0, 480, 272, CalcFadedColor(0x63636363));
|
||||||
PPGeDrawTextWrapped(err->T("PPSSPPDoesNotSupportInternet", "PPSSPP currently does not support connecting to the Internet for DLC, PSN, or game updates."), 241, 132, WRAP_WIDTH, 0, PPGE_ALIGN_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawTextWrapped(err->T("PPSSPPDoesNotSupportInternet", "PPSSPP currently does not support connecting to the Internet for DLC, PSN, or game updates."), 241, 132, WRAP_WIDTH, 0, PPGeAlign::BOX_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawImage(confirmBtnImage, 195, 250, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(confirmBtnImage, 195, 250, 20, 20, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(di->T("OK"), 225, 252, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("OK"), 225, 252, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
||||||
if (IsButtonPressed(confirmBtn)) {
|
if (IsButtonPressed(confirmBtn)) {
|
||||||
StartFade(false);
|
StartFade(false);
|
||||||
|
|
|
@ -766,7 +766,7 @@ void PSPOskDialog::RenderKeyboard()
|
||||||
float previewLeftSide = (480.0f - (12.0f * drawLimit)) / 2.0f;
|
float previewLeftSide = (480.0f - (12.0f * drawLimit)) / 2.0f;
|
||||||
float title = (480.0f - (0.5f * drawLimit)) / 2.0f;
|
float title = (480.0f - (0.5f * drawLimit)) / 2.0f;
|
||||||
|
|
||||||
PPGeDrawText(oskDesc.c_str(), title , 20, PPGE_ALIGN_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(oskDesc.c_str(), title , 20, PPGeAlign::BOX_CENTER, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
||||||
std::u16string result;
|
std::u16string result;
|
||||||
|
|
||||||
|
@ -781,7 +781,7 @@ void PSPOskDialog::RenderKeyboard()
|
||||||
{
|
{
|
||||||
temp[0] = result[drawIndex];
|
temp[0] = result[drawIndex];
|
||||||
ConvertUCS2ToUTF8(buffer, temp);
|
ConvertUCS2ToUTF8(buffer, temp);
|
||||||
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGE_ALIGN_HCENTER, 0.5f, color);
|
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGeAlign::BOX_HCENTER, 0.5f, color);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -798,21 +798,21 @@ void PSPOskDialog::RenderKeyboard()
|
||||||
|
|
||||||
ConvertUCS2ToUTF8(buffer, temp);
|
ConvertUCS2ToUTF8(buffer, temp);
|
||||||
|
|
||||||
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGE_ALIGN_HCENTER, 0.5f, color);
|
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGeAlign::BOX_HCENTER, 0.5f, color);
|
||||||
|
|
||||||
// Also draw the underline for the same reason.
|
// Also draw the underline for the same reason.
|
||||||
color = CalcFadedColor(0xFFFFFFFF);
|
color = CalcFadedColor(0xFFFFFFFF);
|
||||||
PPGeDrawText("_", previewLeftSide + (i * characterWidth), 40.0f, PPGE_ALIGN_HCENTER, 0.5f, color);
|
PPGeDrawText("_", previewLeftSide + (i * characterWidth), 40.0f, PPGeAlign::BOX_HCENTER, 0.5f, color);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ConvertUCS2ToUTF8(buffer, temp);
|
ConvertUCS2ToUTF8(buffer, temp);
|
||||||
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGE_ALIGN_HCENTER, 0.5f, color);
|
PPGeDrawText(buffer.c_str(), previewLeftSide + (i * characterWidth), 40.0f, PPGeAlign::BOX_HCENTER, 0.5f, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PPGeDrawText("_", previewLeftSide + (i * characterWidth), 40.0f, PPGE_ALIGN_HCENTER, 0.5f, color);
|
PPGeDrawText("_", previewLeftSide + (i * characterWidth), 40.0f, PPGeAlign::BOX_HCENTER, 0.5f, color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -828,10 +828,10 @@ void PSPOskDialog::RenderKeyboard()
|
||||||
temp[0] = oskKeys[currentKeyboard][row][col];
|
temp[0] = oskKeys[currentKeyboard][row][col];
|
||||||
|
|
||||||
ConvertUCS2ToUTF8(buffer, temp);
|
ConvertUCS2ToUTF8(buffer, temp);
|
||||||
PPGeDrawText(buffer.c_str(), keyboardLeftSide + (25.0f * col) + characterWidth / 2.0, 70.0f + (25.0f * row), PPGE_ALIGN_HCENTER, 0.6f, color);
|
PPGeDrawText(buffer.c_str(), keyboardLeftSide + (25.0f * col) + characterWidth / 2.0, 70.0f + (25.0f * row), PPGeAlign::BOX_HCENTER, 0.6f, color);
|
||||||
|
|
||||||
if (selectedRow == row && col == selectedCol)
|
if (selectedRow == row && col == selectedCol)
|
||||||
PPGeDrawText("_", keyboardLeftSide + (25.0f * col) + characterWidth / 2.0, 70.0f + (25.0f * row), PPGE_ALIGN_HCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText("_", keyboardLeftSide + (25.0f * col) + characterWidth / 2.0, 70.0f + (25.0f * row), PPGeAlign::BOX_HCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -945,7 +945,7 @@ int PSPOskDialog::Update(int animSpeed) {
|
||||||
auto di = GetI18NCategory("Dialog");
|
auto di = GetI18NCategory("Dialog");
|
||||||
|
|
||||||
PPGeDrawImage(ImageID("I_SQUARE"), 365, 222, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(ImageID("I_SQUARE"), 365, 222, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(di->T("Space"), 390, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Space"), 390, 222, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
||||||
if (g_Config.iButtonPreference != PSP_SYSTEMPARAM_BUTTON_CIRCLE) {
|
if (g_Config.iButtonPreference != PSP_SYSTEMPARAM_BUTTON_CIRCLE) {
|
||||||
PPGeDrawImage(ImageID("I_CROSS"), 45, 222, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(ImageID("I_CROSS"), 45, 222, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
@ -955,11 +955,11 @@ int PSPOskDialog::Update(int animSpeed) {
|
||||||
PPGeDrawImage(ImageID("I_CROSS"), 45, 247, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(ImageID("I_CROSS"), 45, 247, 16, 16, 0, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
PPGeDrawText(di->T("Select"), 75, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Select"), 75, 222, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(di->T("Delete"), 75, 247, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Delete"), 75, 247, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
||||||
PPGeDrawText("Start", 135, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText("Start", 135, 220, PPGeAlign::BOX_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(di->T("Finish"), 185, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Finish"), 185, 222, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
||||||
auto lookupLangName = [&](int direction) {
|
auto lookupLangName = [&](int direction) {
|
||||||
// First, find the valid one...
|
// First, find the valid one...
|
||||||
|
@ -983,20 +983,20 @@ int PSPOskDialog::Update(int animSpeed) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (OskKeyboardNames[currentKeyboardLanguage] != "ko_KR" && IsKeyboardShiftValid(oskParams->fields[0].inputtype, currentKeyboardLanguage, currentKeyboard)) {
|
if (OskKeyboardNames[currentKeyboardLanguage] != "ko_KR" && IsKeyboardShiftValid(oskParams->fields[0].inputtype, currentKeyboardLanguage, currentKeyboard)) {
|
||||||
PPGeDrawText("Select", 135, 245, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText("Select", 135, 245, PPGeAlign::BOX_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(di->T("Shift"), 185, 247, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("Shift"), 185, 247, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *prevLang = lookupLangName(-1);
|
const char *prevLang = lookupLangName(-1);
|
||||||
if (prevLang) {
|
if (prevLang) {
|
||||||
PPGeDrawText("L", 235, 220, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText("L", 235, 220, PPGeAlign::BOX_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(prevLang, 255, 222, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(prevLang, 255, 222, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *nextLang = lookupLangName(1);
|
const char *nextLang = lookupLangName(1);
|
||||||
if (nextLang) {
|
if (nextLang) {
|
||||||
PPGeDrawText("R", 235, 245, PPGE_ALIGN_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText("R", 235, 245, PPGeAlign::BOX_LEFT, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(nextLang, 255, 247, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(nextLang, 255, 247, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsButtonPressed(CTRL_UP) || IsButtonHeld(CTRL_UP, upBtnFramesHeld, framesHeldThreshold, framesHeldRepeatRate)) {
|
if (IsButtonPressed(CTRL_UP) || IsButtonHeld(CTRL_UP, upBtnFramesHeld, framesHeldThreshold, framesHeldRepeatRate)) {
|
||||||
|
|
|
@ -300,7 +300,7 @@ void PSPSaveDialog::DisplayBanner(int which)
|
||||||
}
|
}
|
||||||
// TODO: Draw a hexagon icon
|
// TODO: Draw a hexagon icon
|
||||||
PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawImage(10, 6, 12.0f, 12.0f, 1, 10, 1, 10, 10, 10, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(title, 30, 11, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(title, 30, 11, PPGeAlign::BOX_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSPSaveDialog::DisplaySaveList(bool canMove) {
|
void PSPSaveDialog::DisplaySaveList(bool canMove) {
|
||||||
|
@ -395,7 +395,7 @@ void PSPSaveDialog::DisplaySaveDataInfo1()
|
||||||
std::lock_guard<std::mutex> guard(paramLock);
|
std::lock_guard<std::mutex> guard(paramLock);
|
||||||
if (param.GetFileInfo(currentSelectedSave).size == 0) {
|
if (param.GetFileInfo(currentSelectedSave).size == 0) {
|
||||||
auto di = GetI18NCategory("Dialog");
|
auto di = GetI18NCategory("Dialog");
|
||||||
PPGeDrawText(di->T("NEW DATA"), 180, 136, PPGE_ALIGN_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(di->T("NEW DATA"), 180, 136, PPGeAlign::BOX_VCENTER, 0.6f, CalcFadedColor(0xFFFFFFFF));
|
||||||
} else {
|
} else {
|
||||||
char title[512];
|
char title[512];
|
||||||
char time[512];
|
char time[512];
|
||||||
|
@ -452,14 +452,14 @@ void PSPSaveDialog::DisplaySaveDataInfo1()
|
||||||
std::string saveTitleTxt = saveTitle;
|
std::string saveTitleTxt = saveTitle;
|
||||||
std::string saveDetailTxt = saveDetail;
|
std::string saveDetailTxt = saveDetail;
|
||||||
|
|
||||||
PPGeDrawText(titleTxt.c_str(), 181, 138, PPGE_ALIGN_BOTTOM, 0.6f, CalcFadedColor(0x80000000));
|
PPGeDrawText(titleTxt.c_str(), 181, 138, PPGeAlign::BOX_BOTTOM, 0.6f, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(titleTxt.c_str(), 180, 136, PPGE_ALIGN_BOTTOM, 0.6f, CalcFadedColor(0xFFC0C0C0));
|
PPGeDrawText(titleTxt.c_str(), 180, 136, PPGeAlign::BOX_BOTTOM, 0.6f, CalcFadedColor(0xFFC0C0C0));
|
||||||
PPGeDrawText(timeTxt.c_str(), 181, 139, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
PPGeDrawText(timeTxt.c_str(), 181, 139, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(timeTxt.c_str(), 180, 137, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(timeTxt.c_str(), 180, 137, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawText(saveTitleTxt.c_str(), 176, 162, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(0x80000000));
|
PPGeDrawText(saveTitleTxt.c_str(), 176, 162, PPGeAlign::BOX_LEFT, 0.55f, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(saveTitleTxt.c_str(), 175, 159, PPGE_ALIGN_LEFT, 0.55f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(saveTitleTxt.c_str(), 175, 159, PPGeAlign::BOX_LEFT, 0.55f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawTextWrapped(saveDetailTxt.c_str(), 176, 183, 480 - 175, 250 - 183, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
PPGeDrawTextWrapped(saveDetailTxt.c_str(), 176, 183, 480 - 175, 250 - 183, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawTextWrapped(saveDetailTxt.c_str(), 175, 181, 480 - 175, 250 - 181, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawTextWrapped(saveDetailTxt.c_str(), 175, 181, 480 - 175, 250 - 181, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -526,8 +526,8 @@ void PSPSaveDialog::DisplaySaveDataInfo2(bool showNewData) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string saveinfoTxt = StringFromFormat("%.128s\n%s %s\n%lld KB", save_title, date, hour_time, sizeK);
|
std::string saveinfoTxt = StringFromFormat("%.128s\n%s %s\n%lld KB", save_title, date, hour_time, sizeK);
|
||||||
PPGeDrawText(saveinfoTxt.c_str(), 9, 202, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
PPGeDrawText(saveinfoTxt.c_str(), 9, 202, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(saveinfoTxt.c_str(), 8, 200, PPGE_ALIGN_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawText(saveinfoTxt.c_str(), 8, 200, PPGeAlign::BOX_LEFT, 0.5f, CalcFadedColor(0xFFFFFFFF));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
||||||
|
@ -561,10 +561,10 @@ void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
||||||
h2 += h + 4.0f;
|
h2 += h + 4.0f;
|
||||||
y = 132.0f - h;
|
y = 132.0f - h;
|
||||||
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x40C0C0C0));
|
PPGeDrawRect(x - w, y2 - h, x + w, y2 + h, CalcFadedColor(0x40C0C0C0));
|
||||||
PPGeDrawText(di->T("Yes"), 303.0f, y2+2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(di->T("Yes"), 303.0f, y2+2, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(di->T("Yes"), 302.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
|
PPGeDrawText(di->T("Yes"), 302.0f, y2, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(yesColor));
|
||||||
PPGeDrawText(di->T("No"), 367.0f, y2+2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawText(di->T("No"), 367.0f, y2+2, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawText(di->T("No"), 366.0f, y2, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(noColor));
|
PPGeDrawText(di->T("No"), 366.0f, y2, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(noColor));
|
||||||
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
|
if (IsButtonPressed(CTRL_LEFT) && yesnoChoice == 0) {
|
||||||
yesnoChoice = 1;
|
yesnoChoice = 1;
|
||||||
}
|
}
|
||||||
|
@ -572,8 +572,8 @@ void PSPSaveDialog::DisplayMessage(std::string text, bool hasYesNo)
|
||||||
yesnoChoice = 0;
|
yesnoChoice = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PPGeDrawTextWrapped(text.c_str(), 335.0f, y+2, WRAP_WIDTH, 0, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
PPGeDrawTextWrapped(text.c_str(), 335.0f, y+2, WRAP_WIDTH, 0, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0x80000000));
|
||||||
PPGeDrawTextWrapped(text.c_str(), 334.0f, y, WRAP_WIDTH, 0, PPGE_ALIGN_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawTextWrapped(text.c_str(), 334.0f, y, WRAP_WIDTH, 0, PPGeAlign::BOX_CENTER, FONT_SCALE, CalcFadedColor(0xFFFFFFFF));
|
||||||
float sy = 122.0f - h2, ey = 150.0f + h2;
|
float sy = 122.0f - h2, ey = 150.0f + h2;
|
||||||
PPGeDrawRect(202.0f, sy, 466.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawRect(202.0f, sy, 466.0f, sy + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
||||||
PPGeDrawRect(202.0f, ey, 466.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
PPGeDrawRect(202.0f, ey, 466.0f, ey + 1.0f, CalcFadedColor(0xFFFFFFFF));
|
||||||
|
|
|
@ -125,7 +125,7 @@ struct PPGeTextDrawerImage {
|
||||||
std::map<PPGeTextDrawerCacheKey, PPGeTextDrawerImage> textDrawerImages;
|
std::map<PPGeTextDrawerCacheKey, PPGeTextDrawerImage> textDrawerImages;
|
||||||
|
|
||||||
// Overwrite the current text lines buffer so it can be drawn later.
|
// Overwrite the current text lines buffer so it can be drawn later.
|
||||||
void PPGePrepareText(const char *text, float x, float y, int align, float scale, float lineHeightScale,
|
void PPGePrepareText(const char *text, float x, float y, PPGeAlign align, float scale, float lineHeightScale,
|
||||||
int WrapType = PPGE_LINE_NONE, int wrapWidth = 0);
|
int WrapType = PPGE_LINE_NONE, int wrapWidth = 0);
|
||||||
|
|
||||||
// These functions must be called between PPGeBegin and PPGeEnd.
|
// These functions must be called between PPGeBegin and PPGeEnd.
|
||||||
|
@ -455,7 +455,7 @@ static const AtlasChar *PPGeGetChar(const AtlasFont &atlasfont, unsigned int cva
|
||||||
|
|
||||||
// Break a single text string into mutiple lines.
|
// Break a single text string into mutiple lines.
|
||||||
static AtlasTextMetrics BreakLines(const char *text, const AtlasFont &atlasfont, float x, float y,
|
static AtlasTextMetrics BreakLines(const char *text, const AtlasFont &atlasfont, float x, float y,
|
||||||
int align, float scale, float lineHeightScale, int wrapType, float wrapWidth, bool dryRun)
|
PPGeAlign align, float scale, float lineHeightScale, int wrapType, float wrapWidth, bool dryRun)
|
||||||
{
|
{
|
||||||
y += atlasfont.ascend * scale;
|
y += atlasfont.ascend * scale;
|
||||||
float sx = x, sy = y;
|
float sx = x, sy = y;
|
||||||
|
@ -665,26 +665,22 @@ static AtlasTextMetrics BreakLines(const char *text, const AtlasFont &atlasfont,
|
||||||
|
|
||||||
const float w = maxw;
|
const float w = maxw;
|
||||||
const float h = (float)numLines * lineHeight;
|
const float h = (float)numLines * lineHeight;
|
||||||
if (align)
|
if (align & PPGeAlign::ANY) {
|
||||||
{
|
if (!dryRun) {
|
||||||
if (!dryRun)
|
for (auto i = char_lines.begin(); i != char_lines.end(); ++i) {
|
||||||
{
|
for (auto j = i->begin(); j != i->end(); ++j) {
|
||||||
for (auto i = char_lines.begin(); i != char_lines.end(); ++i)
|
if (align & PPGeAlign::BOX_HCENTER) j->x -= w / 2.0f;
|
||||||
{
|
else if (align & PPGeAlign::BOX_RIGHT) j->x -= w;
|
||||||
for (auto j = i->begin(); j != i->end(); ++j)
|
|
||||||
{
|
|
||||||
if (align & PPGE_ALIGN_HCENTER) j->x -= w / 2.0f;
|
|
||||||
else if (align & PPGE_ALIGN_RIGHT) j->x -= w;
|
|
||||||
|
|
||||||
if (align & PPGE_ALIGN_VCENTER) j->y -= h / 2.0f;
|
if (align & PPGeAlign::BOX_VCENTER) j->y -= h / 2.0f;
|
||||||
else if (align & PPGE_ALIGN_BOTTOM) j->y -= h;
|
else if (align & PPGeAlign::BOX_BOTTOM) j->y -= h;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (align & PPGE_ALIGN_HCENTER) sx -= w / 2.0f;
|
if (align & PPGeAlign::BOX_HCENTER) sx -= w / 2.0f;
|
||||||
else if (align & PPGE_ALIGN_RIGHT) sx -= w;
|
else if (align & PPGeAlign::BOX_RIGHT) sx -= w;
|
||||||
if (align & PPGE_ALIGN_VCENTER) sy -= h / 2.0f;
|
if (align & PPGeAlign::BOX_VCENTER) sy -= h / 2.0f;
|
||||||
else if (align & PPGE_ALIGN_BOTTOM) sy -= h;
|
else if (align & PPGeAlign::BOX_BOTTOM) sy -= h;
|
||||||
}
|
}
|
||||||
|
|
||||||
AtlasTextMetrics metrics = { sx, sy, w, lineHeight, scale, numLines };
|
AtlasTextMetrics metrics = { sx, sy, w, lineHeight, scale, numLines };
|
||||||
|
@ -734,12 +730,12 @@ void PPGeMeasureText(float *w, float *h, const char *text, float scale, int Wrap
|
||||||
}
|
}
|
||||||
|
|
||||||
const AtlasFont &atlasfont = g_ppge_atlas.fonts[0];
|
const AtlasFont &atlasfont = g_ppge_atlas.fonts[0];
|
||||||
AtlasTextMetrics metrics = BreakLines(text, atlasfont, 0, 0, 0, scale, scale, WrapType, wrapWidth, true);
|
AtlasTextMetrics metrics = BreakLines(text, atlasfont, 0, 0, PPGeAlign::BOX_TOP, scale, scale, WrapType, wrapWidth, true);
|
||||||
if (w) *w = metrics.maxWidth;
|
if (w) *w = metrics.maxWidth;
|
||||||
if (h) *h = metrics.lineHeight * metrics.numLines;
|
if (h) *h = metrics.lineHeight * metrics.numLines;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPGePrepareText(const char *text, float x, float y, int align, float scale, float lineHeightScale, int WrapType, int wrapWidth)
|
void PPGePrepareText(const char *text, float x, float y, PPGeAlign align, float scale, float lineHeightScale, int WrapType, int wrapWidth)
|
||||||
{
|
{
|
||||||
const AtlasFont &atlasfont = g_ppge_atlas.fonts[0];
|
const AtlasFont &atlasfont = g_ppge_atlas.fonts[0];
|
||||||
if (!g_ppge_atlas.IsMetadataLoaded() || g_ppge_atlas.num_fonts < 1) {
|
if (!g_ppge_atlas.IsMetadataLoaded() || g_ppge_atlas.num_fonts < 1) {
|
||||||
|
@ -794,8 +790,8 @@ int GetPow2(int x) {
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static PPGeTextDrawerImage PPGeGetTextImage(const char *text, int align, float scale, float maxWidth, bool wrap) {
|
static PPGeTextDrawerImage PPGeGetTextImage(const char *text, PPGeAlign align, float scale, float maxWidth, bool wrap) {
|
||||||
int tdalign = (align & PPGE_ALIGN_HCENTER) ? ALIGN_HCENTER : 0;
|
int tdalign = 0;
|
||||||
tdalign |= FLAG_ELLIPSIZE_TEXT;
|
tdalign |= FLAG_ELLIPSIZE_TEXT;
|
||||||
if (wrap) {
|
if (wrap) {
|
||||||
tdalign |= FLAG_WRAP_TEXT;
|
tdalign |= FLAG_WRAP_TEXT;
|
||||||
|
@ -847,7 +843,7 @@ static PPGeTextDrawerImage PPGeGetTextImage(const char *text, int align, float s
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void PPGeDrawTextImage(PPGeTextDrawerImage im, float x, float y, int align, float scale, u32 color) {
|
static void PPGeDrawTextImage(PPGeTextDrawerImage im, float x, float y, PPGeAlign align, float scale, u32 color) {
|
||||||
int bufw = ((im.entry.bmWidth + 31) / 32) * 32;
|
int bufw = ((im.entry.bmWidth + 31) / 32) * 32;
|
||||||
int wp2 = GetPow2(im.entry.bmWidth);
|
int wp2 = GetPow2(im.entry.bmWidth);
|
||||||
int hp2 = GetPow2(im.entry.bmHeight);
|
int hp2 = GetPow2(im.entry.bmHeight);
|
||||||
|
@ -859,13 +855,13 @@ static void PPGeDrawTextImage(PPGeTextDrawerImage im, float x, float y, int alig
|
||||||
float w = im.entry.width * scale;
|
float w = im.entry.width * scale;
|
||||||
float h = im.entry.height * scale;
|
float h = im.entry.height * scale;
|
||||||
|
|
||||||
if (align & PPGE_ALIGN_HCENTER)
|
if (align & PPGeAlign::BOX_HCENTER)
|
||||||
x -= w / 2.0f;
|
x -= w / 2.0f;
|
||||||
else if (align & PPGE_ALIGN_RIGHT)
|
else if (align & PPGeAlign::BOX_RIGHT)
|
||||||
x -= w;
|
x -= w;
|
||||||
if (align & PPGE_ALIGN_VCENTER)
|
if (align & PPGeAlign::BOX_VCENTER)
|
||||||
y -= h / 2.0f;
|
y -= h / 2.0f;
|
||||||
else if (align & PPGE_ALIGN_BOTTOM)
|
else if (align & PPGeAlign::BOX_BOTTOM)
|
||||||
y -= h;
|
y -= h;
|
||||||
|
|
||||||
BeginVertexData();
|
BeginVertexData();
|
||||||
|
@ -878,7 +874,7 @@ static void PPGeDrawTextImage(PPGeTextDrawerImage im, float x, float y, int alig
|
||||||
PPGeSetDefaultTexture();
|
PPGeSetDefaultTexture();
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPGeDrawText(const char *text, float x, float y, int align, float scale, u32 color) {
|
void PPGeDrawText(const char *text, float x, float y, PPGeAlign align, float scale, u32 color) {
|
||||||
if (HasTextDrawer()) {
|
if (HasTextDrawer()) {
|
||||||
PPGeTextDrawerImage im = PPGeGetTextImage(text, align, scale, 480.0f - x, false);
|
PPGeTextDrawerImage im = PPGeGetTextImage(text, align, scale, 480.0f - x, false);
|
||||||
PPGeDrawTextImage(im, x, y, align, scale, color);
|
PPGeDrawTextImage(im, x, y, align, scale, color);
|
||||||
|
@ -912,7 +908,7 @@ static std::string CropLinesToCount(const std::string &s, int numLines) {
|
||||||
return s.substr(0, len);
|
return s.substr(0, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PPGeDrawTextWrapped(const char *text, float x, float y, float wrapWidth, float wrapHeight, int align, float scale, u32 color) {
|
void PPGeDrawTextWrapped(const char *text, float x, float y, float wrapWidth, float wrapHeight, PPGeAlign align, float scale, u32 color) {
|
||||||
std::string s = text;
|
std::string s = text;
|
||||||
if (wrapHeight != 0.0f) {
|
if (wrapHeight != 0.0f) {
|
||||||
s = StripTrailingWhite(s);
|
s = StripTrailingWhite(s);
|
||||||
|
@ -924,7 +920,7 @@ void PPGeDrawTextWrapped(const char *text, float x, float y, float wrapWidth, fl
|
||||||
if (HasTextDrawer()) {
|
if (HasTextDrawer()) {
|
||||||
float actualWidth, actualHeight;
|
float actualWidth, actualHeight;
|
||||||
Bounds b(0, 0, wrapWidth <= 0 ? 480.0f - x : wrapWidth, wrapHeight);
|
Bounds b(0, 0, wrapWidth <= 0 ? 480.0f - x : wrapWidth, wrapHeight);
|
||||||
int tdalign = (align & PPGE_ALIGN_HCENTER) ? ALIGN_HCENTER : 0;
|
int tdalign = 0;
|
||||||
textDrawer->SetFontScale(scale, scale);
|
textDrawer->SetFontScale(scale, scale);
|
||||||
textDrawer->MeasureStringRect(s.c_str(), s.size(), b, &actualWidth, &actualHeight, tdalign | FLAG_WRAP_TEXT);
|
textDrawer->MeasureStringRect(s.c_str(), s.size(), b, &actualWidth, &actualHeight, tdalign | FLAG_WRAP_TEXT);
|
||||||
if (wrapHeight != 0.0f && actualHeight > wrapHeight) {
|
if (wrapHeight != 0.0f && actualHeight > wrapHeight) {
|
||||||
|
|
|
@ -45,21 +45,22 @@ void __PPGeShutdown();
|
||||||
void PPGeBegin();
|
void PPGeBegin();
|
||||||
void PPGeEnd();
|
void PPGeEnd();
|
||||||
|
|
||||||
enum {
|
enum class PPGeAlign {
|
||||||
PPGE_ALIGN_LEFT = 0,
|
BOX_LEFT = 0x00,
|
||||||
PPGE_ALIGN_RIGHT = 16,
|
BOX_RIGHT = 0x01,
|
||||||
PPGE_ALIGN_TOP = 0,
|
BOX_HCENTER = 0x02,
|
||||||
PPGE_ALIGN_BOTTOM = 1,
|
|
||||||
PPGE_ALIGN_HCENTER = 4,
|
|
||||||
PPGE_ALIGN_VCENTER = 8,
|
|
||||||
PPGE_ALIGN_VBASELINE = 32, // text only, possibly not yet working
|
|
||||||
|
|
||||||
PPGE_ALIGN_CENTER = PPGE_ALIGN_HCENTER | PPGE_ALIGN_VCENTER,
|
BOX_TOP = 0x00,
|
||||||
PPGE_ALIGN_TOPLEFT = PPGE_ALIGN_TOP | PPGE_ALIGN_LEFT,
|
BOX_BOTTOM = 0x10,
|
||||||
PPGE_ALIGN_TOPRIGHT = PPGE_ALIGN_TOP | PPGE_ALIGN_RIGHT,
|
BOX_VCENTER = 0x20,
|
||||||
PPGE_ALIGN_BOTTOMLEFT = PPGE_ALIGN_BOTTOM | PPGE_ALIGN_LEFT,
|
|
||||||
PPGE_ALIGN_BOTTOMRIGHT = PPGE_ALIGN_BOTTOM | PPGE_ALIGN_RIGHT,
|
BOX_CENTER = 0x22,
|
||||||
|
|
||||||
|
ANY = 0xFF,
|
||||||
};
|
};
|
||||||
|
inline bool operator &(const PPGeAlign &lhs, const PPGeAlign &rhs) {
|
||||||
|
return ((int)lhs & (int)rhs) != 0;
|
||||||
|
}
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PPGE_LINE_NONE = 0,
|
PPGE_LINE_NONE = 0,
|
||||||
|
@ -73,8 +74,8 @@ void PPGeMeasureText(float *w, float *h, const char *text, float scale, int Wrap
|
||||||
|
|
||||||
// Draws some text using the one font we have.
|
// Draws some text using the one font we have.
|
||||||
// Clears the text buffer when done.
|
// Clears the text buffer when done.
|
||||||
void PPGeDrawText(const char *text, float x, float y, int align, float scale = 1.0f, u32 color = 0xFFFFFFFF);
|
void PPGeDrawText(const char *text, float x, float y, PPGeAlign align, float scale = 1.0f, u32 color = 0xFFFFFFFF);
|
||||||
void PPGeDrawTextWrapped(const char *text, float x, float y, float wrapWidth, float wrapHeight, int align, float scale = 1.0f, u32 color = 0xFFFFFFFF);
|
void PPGeDrawTextWrapped(const char *text, float x, float y, float wrapWidth, float wrapHeight, PPGeAlign align, float scale = 1.0f, u32 color = 0xFFFFFFFF);
|
||||||
|
|
||||||
// Draws a "4-patch" for button-like things that can be resized.
|
// Draws a "4-patch" for button-like things that can be resized.
|
||||||
void PPGeDraw4Patch(ImageID atlasImage, float x, float y, float w, float h, u32 color = 0xFFFFFFFF);
|
void PPGeDraw4Patch(ImageID atlasImage, float x, float y, float w, float h, u32 color = 0xFFFFFFFF);
|
||||||
|
|
Loading…
Add table
Reference in a new issue