mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Add createtextboxreal() and createtextboxflipme()
createtextboxreal() is the same as createtextbox(), but with a flipme parameter added to create text boxes that have their flipme attribute set to true. createtextbox() just calls createtextboxreal() with flipme set to false, and createtextboxflipme() just calls createtextboxreal() with flipme set to true; this is because I do not want to use C++ function overloading.
This commit is contained in:
parent
1a9f2d9342
commit
c7cc2f4adc
2 changed files with 57 additions and 3 deletions
|
@ -1282,8 +1282,15 @@ void Graphics::textboxadjust(void)
|
|||
}
|
||||
|
||||
|
||||
void Graphics::createtextbox( std::string t, int xp, int yp, int r, int g, int b)
|
||||
{
|
||||
void Graphics::createtextboxreal(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b,
|
||||
bool flipme
|
||||
) {
|
||||
m = textbox.size();
|
||||
|
||||
if(m<20)
|
||||
|
@ -1295,11 +1302,34 @@ void Graphics::createtextbox( std::string t, int xp, int yp, int r, int g, int b
|
|||
if (xp == -1) text.xp = 160 - (((length / 2) + 1) * 8);
|
||||
text.yp = yp;
|
||||
text.initcol(r, g, b);
|
||||
text.flipme = flipme;
|
||||
text.resize();
|
||||
textbox.push_back(text);
|
||||
}
|
||||
}
|
||||
|
||||
void Graphics::createtextbox(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b
|
||||
) {
|
||||
createtextboxreal(t, xp, yp, r, g, b, false);
|
||||
}
|
||||
|
||||
void Graphics::createtextboxflipme(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b
|
||||
) {
|
||||
createtextboxreal(t, xp, yp, r, g, b, true);
|
||||
}
|
||||
|
||||
void Graphics::drawfade(void)
|
||||
{
|
||||
int usethisamount = lerp(oldfadeamount, fadeamount);
|
||||
|
|
|
@ -51,7 +51,31 @@ public:
|
|||
|
||||
void setwarprect(int a, int b, int c, int d);
|
||||
|
||||
void createtextbox(std::string t, int xp, int yp, int r, int g, int b);
|
||||
void createtextboxreal(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b,
|
||||
bool flipme
|
||||
);
|
||||
void createtextbox(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b
|
||||
);
|
||||
void createtextboxflipme(
|
||||
std::string t,
|
||||
int xp,
|
||||
int yp,
|
||||
int r,
|
||||
int g,
|
||||
int b
|
||||
);
|
||||
|
||||
void textboxcenterx(void);
|
||||
|
||||
|
|
Loading…
Reference in a new issue