Python command emulation
This commit is contained in:
parent
a44b8c93e9
commit
763fa201f0
17 changed files with 704 additions and 74 deletions
|
|
@ -21,6 +21,11 @@ void PyScene::update()
|
|||
|
||||
void PyScene::do_mouse_input(std::string button, std::string type)
|
||||
{
|
||||
// In headless mode, mouse input is not available
|
||||
if (game->isHeadless()) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto unscaledmousepos = sf::Mouse::getPosition(game->getWindow());
|
||||
auto mousepos = game->getWindow().mapPixelToCoords(unscaledmousepos);
|
||||
UIDrawable* target;
|
||||
|
|
@ -62,7 +67,7 @@ void PyScene::doAction(std::string name, std::string type)
|
|||
|
||||
void PyScene::render()
|
||||
{
|
||||
game->getWindow().clear();
|
||||
game->getRenderTarget().clear();
|
||||
|
||||
auto vec = *ui_elements;
|
||||
for (auto e: vec)
|
||||
|
|
@ -71,5 +76,5 @@ void PyScene::render()
|
|||
e->render();
|
||||
}
|
||||
|
||||
game->getWindow().display();
|
||||
// Display is handled by GameEngine
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue