7DRL 2024 Day 4 updates - UIGrid / mcrfpy.Grid
Massive new set of behaviors: * Move, resize*, zoom, and pan mcrfpy.Grid instances from Python. Note: there's a rendering error with resizing, which will have to wait for after 7DRL. * Add, remove, and create mcrfpy.Entity instances from Python. The fields can be edited to change position and sprite. They can be removed from a grid and/or added to another. the Entity class is closely related to the EntityCollection class, the Python interface to UIGrid's std::vector of UIEntities. * mcrfpy.GridPoint and mcrfyp.GridPointState objects. The GridPoint class allows access to the "physical" parts of a grid. The GridPointState class allows access to an entity's knowledge of it. Grids and Entities have an "at" method that takes a tuple (x,y) and returns one of these objects. __repr__ and many other nice things are notably absent - many TODOs were added to the codebase today. They can get picked up after 7DRL.
This commit is contained in:
parent
08772111de
commit
6de3f0e8cf
4 changed files with 252 additions and 16 deletions
|
|
@ -119,7 +119,8 @@ UITestScene::UITestScene(GameEngine* g) : Scene(g)
|
|||
//UIEntity test:
|
||||
// asdf
|
||||
// TODO - reimplement UISprite style rendering within UIEntity class. Entities don't have a screen pixel position, they have a grid position, and grid sets zoom when rendering them.
|
||||
auto e5a = std::make_shared<UIEntity>(); // default constructor sucks: sprite position + zoom are irrelevant for UIEntity.
|
||||
auto e5a = std::make_shared<UIEntity>(*e5); // this basic constructor sucks: sprite position + zoom are irrelevant for UIEntity.
|
||||
e5a->grid = e5;
|
||||
auto e5as = UISprite(indextex, 85, sf::Vector2f(0, 0), 1.0);
|
||||
e5a->sprite = e5as; // will copy constructor even exist for UISprite...?
|
||||
e5a->position = sf::Vector2f(1, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue