Commit Graph

22 Commits

Author SHA1 Message Date
John McCardle f2eaee95ec (minor) sprite object enabled in collection 2023-10-20 22:23:20 -04:00
John McCardle 494658e5c3 Sprite fixes. Changing sprite_number now changes the visible texture. Repr fixed. 2023-09-15 22:09:29 -04:00
John McCardle 6e820af8c4 mcrfpy.Sprite / PyUISpriteType compiles; too excited to fully test it (todo: modify the macro to get instances into and out of collections) 2023-09-13 23:23:08 -04:00
John McCardle cf485ef327 Refactoring UISprite to play well with Python API and match existing code styles. Default constructor will have to go, which complicates the Python class slightly for mcrfpy.Sprite 2023-09-11 20:30:10 -04:00
John McCardle 3a1432212f UICollection.remove 2023-09-09 10:14:11 -04:00
John McCardle 38b6a3cade UICollection.append, tests are good for Caption and Frame objects created by Python to be drawn by the UITestScene 2023-09-09 08:49:02 -04:00
John McCardle 1bbb0aa5b8 Caption object seems to be instantiable with a Font object now. Can't test actual rendering without a way to add objects to a collection. 2023-09-07 23:10:21 -04:00
John McCardle bec2b3294d Added PyFont/mcrfpy.Font object 2023-09-07 22:25:19 -04:00
John McCardle 9486104377 Converted py_instance to a macro (don't ask me why it doesn't work as a function) and first pass at UICaption functionality. UISprite C++ tests. 2023-09-03 20:40:52 -04:00
John McCardle 5267287b05 checkpoint: found that py_instance causes segfaults when called separately, but the same exact code inside of the _getitem method works fine. I can't explain that. I guess I'll turn it into a macro so the actions are inline and I can move on to finishing the other UI classes. 2023-09-03 12:46:23 -04:00
John McCardle b8af8bc870 UIDrawable to Python object (untested, but compiling) 2023-09-02 20:02:07 -04:00
John McCardle 0ef0a5d506 Switched UIFrame and Scene to store their UIDrawables in shared_ptr to vector, instead of directly to vector. Every object that can be exposed to Python has to be safely shareable so it doesn't become a segfault, and that includes the UIDrawable collections AND the UIDrawable members. So we get the terrifying type for collections of child elements: 'std::shared_ptr<std::vector<std::shared_ptr<UIDrawable>>>'. May I be forgiven for my sins 2023-09-02 14:00:48 -04:00
John McCardle a41d3d4a54 Iterator class fleshed out. Several implementations left to do, but it compiles, and I think every function definition for the PyUICollectionType and PyUICollectionIterType is now in place 2023-09-02 09:22:34 -04:00
John McCardle 6d4bc2989c UICollection work: fixed compilation, still quite a bit of stubs 2023-09-02 04:40:05 -04:00
John McCardle d5a7cbca85 In progress: UICollection. mcrfpydef::PyUICollection_sqmethods needs to be made static or moved somewhere it won't be multiply defined 2023-09-01 23:31:31 -04:00
John McCardle 5d8510747c Color and Frame classes pretty well integrated from the Python perspective now 2023-09-01 18:28:59 -04:00
John McCardle 06052c81c9 PyUIFrame looking not half bad. There seems to be a glitch with the color values. 2023-09-01 12:14:24 -04:00
John McCardle 6fe7b842ef Successful use of a copy-modify-paste template of Python type (UIFrame -> PyUIFrameObject) 2023-08-31 22:32:58 -04:00
John McCardle 50d926fe37 Aug 30/31 updates. Tinkering with shared_ptr. Working towards exposing UI objects to Python UI. Color object updated for shared_ptr structure that will be repeated for the rest of the UI objects. Still a lot of open questions, but committing here to get back on track after a few hours wasted trying to solve this problem too generally via templates. 2023-08-31 13:51:56 -04:00
John McCardle 884a49a63a Switching UIFrame to sf::Color* for outline and fill members. Haven't tested with Python integration, but I wrote the methods to take a crack at it 2023-08-30 14:38:49 -04:00
John McCardle c4d5a497d4 Color container type for Python working. I still need to implement UIFrame using it. 2023-08-28 05:44:26 -04:00
John McCardle ac0ec4bb71 In-work: Python segfaults when adding new objects to module 2023-08-25 21:57:42 -04:00