1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 10:09:43 +01:00

Add Graphics::bigbprint()

It's just like bigprint() except it duplicates some of the calculations
because I didn't want to make a bigprintoff() function which would
duplicate even more code. I'm beginning to think these text printing
functions are completely horrible to work with...
This commit is contained in:
Misa 2021-03-19 14:26:59 -07:00
parent 827b3e430b
commit f7173027ce
2 changed files with 23 additions and 0 deletions

View file

@ -541,6 +541,28 @@ void Graphics::bigprint( int _x, int _y, std::string _s, int r, int g, int b, b
} }
} }
void Graphics::bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen, int sc)
{
if (!notextoutline)
{
bigprint(x, y - sc, s, 0, 0, 0, cen, sc);
if (cen)
{
int x_cen = VVV_max(160 - (len(s) / 2) * sc, 0);
bigprint(x_cen - sc, y, s, 0, 0, 0, false, sc);
bigprint(x_cen + sc, y, s, 0, 0, 0, false, sc);
}
else
{
bigprint(x - sc, y, s, 0, 0, 0, cen, sc);
bigprint(x + sc, y, s, 0, 0, 0, cen, sc);
}
bigprint(x, y + sc, s, 0, 0, 0, cen, sc);
}
bigprint(x, y, s, r, g, b, cen, sc);
}
int Graphics::len(std::string t) int Graphics::len(std::string t)
{ {
int bfontpos = 0; int bfontpos = 0;

View file

@ -144,6 +144,7 @@ public:
int len(std::string t); int len(std::string t);
void bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen = false, int sc = 2 ); void bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen = false, int sc = 2 );
void bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen = false, int sc = 2);
void drawspritesetcol(int x, int y, int t, int c); void drawspritesetcol(int x, int y, int t, int c);