1
0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-06-01 18:43:33 +02:00
VVVVVV/desktop_version/src/BlockV.h
Ally f3786a8e3f
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.
2021-10-13 15:38:51 -07:00

28 lines
468 B
C++

#ifndef BLOCKV_H
#define BLOCKV_H
#include <SDL.h>
#include <string>
class blockclass
{
public:
blockclass(void);
void clear(void);
void rectset(const int xi, const int yi, const int wi, const int hi);
void setblockcolour(const char* col);
public:
//Fundamentals
SDL_Rect rect;
int type;
int trigger;
int xp, yp, wp, hp;
std::string script, prompt;
int r, g, b;
int activity_x, activity_y;
};
#endif /* BLOCKV_H */