Create Python base class for UIDrawables, and derive Python UI types from it #71
Labels
No Label
Alpha Release Requirement
Bugfix
Demo Target
Documentation
Major Feature
Minor Feature
priority:tier1-active
priority:tier2-foundation
priority:tier3-future
Refactoring & Cleanup
system:animation
system:documentation
system:grid
system:input
system:performance
system:python-binding
system:rendering
system:ui-hierarchy
Tiny Feature
workflow:blocked
workflow:needs-benchmark
workflow:needs-documentation
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: john/McRogueFace#71
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
It just makes good sense to mirror the type hierarchy in both Python and C++.
if
.tp_baseof each UIDrawable type points to amcrfpy.Drawableclass, then I wouldn't have to do this:which is also fragile to new UIDrawable derived classes.
Probably the new base class should be
mcrfpy._Drawable, an abstract base class which Python code can't derive from. But I can also define a separatemcrfpy.Drawableclass, which derives from the base class, CAN be subclassed, and has a C++ implementation (asUserDrawableor something) to implement the interface by calling Python code.It would be a good opportunity to test the performance of using a Python rendering function... ...but Python doesn't have draw functions yet, so user render will have to wait.
An additional possibility is making UICollection derive from
mcrfpy._Drawable, and allowing users to subclass that - they could define any__init__they want, manage the collection internally withself.append,self.remove, etc. This would be a great way to keep all render functions in C++ while making it easier to encapsulate behavior requiring multiple UI widgets, like text boxes with captions, dialogue with a sprite that changes or moves, etc.