Refactor: remove "s" prefix from "sRender" method ( -> "render") Closes #44

This commit is contained in:
John McCardle 2024-04-20 14:16:14 -04:00
parent a465a9861d
commit c2de9b08d6
7 changed files with 14 additions and 9 deletions

View File

@ -59,7 +59,7 @@ void GameEngine::run()
if (!paused)
{
}
currentScene()->sRender();
currentScene()->render();
currentFrame++;
frameTime = clock.restart().asSeconds();
fps = 1 / frameTime;

View File

@ -59,7 +59,7 @@ void PyScene::doAction(std::string name, std::string type)
}
}
void PyScene::sRender()
void PyScene::render()
{
game->getWindow().clear();

View File

@ -11,7 +11,7 @@ public:
PyScene(GameEngine*);
void update() override final;
void doAction(std::string, std::string) override final;
void sRender() override final;
void render() override final;
void do_mouse_input(std::string, std::string);
};

View File

@ -31,7 +31,7 @@ public:
//Scene();
Scene(GameEngine*);
virtual void update() = 0;
virtual void sRender() = 0;
virtual void render() = 0;
virtual void doAction(std::string, std::string) = 0;
bool hasAction(std::string);
bool hasAction(int);

View File

@ -154,7 +154,7 @@ void UITestScene::doAction(std::string name, std::string type)
*/
}
void UITestScene::sRender()
void UITestScene::render()
{
game->getWindow().clear();
game->getWindow().draw(text);

View File

@ -18,5 +18,5 @@ public:
UITestScene(GameEngine*);
void update() override final;
void doAction(std::string, std::string) override final;
void sRender() override final;
void render() override final;
};

View File

@ -14,18 +14,23 @@ ui = mcrfpy.sceneUI("pytest")
# Frame
f = mcrfpy.Frame(25, 19, 462, 346, fill_color=(255, 92, 92))
print("Frame alive")
# fill (LinkedColor / Color): f.fill_color
# outline (LinkedColor / Color): f.outline_color
# pos (LinkedVector / Vector): f.pos
# size (LinkedVector / Vector): f.size
# Caption
c = mcrfpy.Caption(512+25, 19, "Hi.", font)
print("Caption attempt w/ fill_color:")
#c = mcrfpy.Caption(512+25, 19, "Hi.", font)
#c = mcrfpy.Caption(512+25, 19, "Hi.", font, fill_color=(255, 128, 128))
c = mcrfpy.Caption(512+25, 19, "Hi.", font, fill_color=mcrfpy.Color(255, 128, 128), outline_color=(128, 255, 128))
print("Caption alive")
# fill (LinkedColor / Color): c.fill_color
#color_val = c.fill_color
print(c.fill_color)
print("Set a fill color")
c.fill_color = (255, 255, 255)
#print("Set a fill color")
#c.fill_color = (255, 255, 255)
print("Lol, did it segfault?")
# outline (LinkedColor / Color): c.outline_color
# font (Font): c.font