mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add setactivityposition(x,y), add new textbox color transparent (#847)
* Add `setactivityposition(x,y)`, add new textbox color `transparent` This commit adds a new internal command as a part of the visual activity zone changes I've been making. This one allows the user to reposition the activity zone to anywhere on the screen. In addition, this commit adds the textbox color `transparent`, which just sets r, g and b to 0. rgb(0, 0, 0) normally creates the color black, however in VVVVVV textboxes, it makes the background of them invisible, and makes the text the off-white color which the game uses elsewhere. * add new variables to hardreset * Fix unwanted text centering; offset position by 16, 4 It makes sense for `setactivityposition(0, 0)` to place the activity zone in the default position, so the x has been offset by 16, and the y has been offset by 4. Text was being automatically centered, meaning any activity zone which wasn't centered had misplaced text. This has been fixed by calculating the center manually, and offsetting it by the passed value.
This commit is contained in:
@@ -1985,8 +1985,17 @@ void gamerender(void)
|
||||
game.activity_lastprompt.c_str()
|
||||
);
|
||||
|
||||
graphics.drawtextbox(16, 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha);
|
||||
graphics.Print(5, 12, final_string, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha, true);
|
||||
int centered_x = ((160 ) - ((graphics.len(final_string)) / 2));
|
||||
|
||||
if (game.activity_r == 0 && game.activity_g == 0 && game.activity_b == 0)
|
||||
{
|
||||
graphics.bprint(centered_x + game.activity_x, game.activity_y + 12, final_string, 196*act_alpha, 196*act_alpha, (255 - help.glow)*act_alpha);
|
||||
}
|
||||
else
|
||||
{
|
||||
graphics.drawtextbox(game.activity_x + 16, game.activity_y + 4, 36, 3, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha);
|
||||
graphics.Print(centered_x + game.activity_x, game.activity_y + 12, final_string, game.activity_r*act_alpha, game.activity_g*act_alpha, game.activity_b*act_alpha);
|
||||
}
|
||||
}
|
||||
|
||||
if (obj.trophytext > 0 || obj.oldtrophytext > 0)
|
||||
|
||||
Reference in New Issue
Block a user