Panel is working and now I can work on the gui interactions parts.
This commit is contained in:
parent
9bc9c9007f
commit
6e848004c4
3 changed files with 4 additions and 1 deletions
1
gui.cpp
1
gui.cpp
|
@ -193,6 +193,7 @@ void GUI::shake() {
|
||||||
int y = Random::uniform<int>(-20,20);
|
int y = Random::uniform<int>(-20,20);
|
||||||
// add x/y back to draw screen
|
// add x/y back to draw screen
|
||||||
$renderer.draw_screen($map_view, x, y);
|
$renderer.draw_screen($map_view, x, y);
|
||||||
|
$renderer.display();
|
||||||
std::this_thread::sleep_for(1ms);
|
std::this_thread::sleep_for(1ms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,13 +110,14 @@ void SFMLRender::render_text(std::wstring &text, float x, float y) {
|
||||||
float width_delta = 0;
|
float width_delta = 0;
|
||||||
float height_delta = 0;
|
float height_delta = 0;
|
||||||
sf::Sprite &sprite = get_text_sprite(last_tile);
|
sf::Sprite &sprite = get_text_sprite(last_tile);
|
||||||
|
const float start_x = x;
|
||||||
|
|
||||||
// make a copy so we don't modify the cached one
|
// make a copy so we don't modify the cached one
|
||||||
$ansi.parse(text, [&](sf::Color bg, sf::Color fg, wchar_t tile) {
|
$ansi.parse(text, [&](sf::Color bg, sf::Color fg, wchar_t tile) {
|
||||||
if(tile == '\n') {
|
if(tile == '\n') {
|
||||||
// don't bother processing newlines, just skip
|
// don't bother processing newlines, just skip
|
||||||
y += $line_spacing;
|
y += $line_spacing;
|
||||||
x = GAME_MAP_POS;
|
x = start_x;
|
||||||
} else if(tile == L'\r') {
|
} else if(tile == L'\r') {
|
||||||
return; // skip these, just windows junk
|
return; // skip these, just windows junk
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -2,6 +2,7 @@ NOTES:
|
||||||
|
|
||||||
|
|
||||||
TODO:
|
TODO:
|
||||||
|
* panels and everything except renderer should use character coodinates
|
||||||
* camera shake broken
|
* camera shake broken
|
||||||
* draw_screen doesn't do x axis offset render
|
* draw_screen doesn't do x axis offset render
|
||||||
* Can std::any be defaulted to a noop in the events?
|
* Can std::any be defaulted to a noop in the events?
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue