feat: Phase 1 - safe constructors and _Drawable foundation
Closes #7 - Make all UI class constructors safe: - Added safe default constructors for UISprite, UIGrid, UIEntity, UICaption - Initialize all members to predictable values - Made Python init functions accept no arguments - Added x,y properties to UIEntity Closes #71 - Create _Drawable Python base class: - Created PyDrawable.h/cpp with base type (not yet inherited by UI types) - Registered in module initialization Closes #87 - Add visible property: - Added bool visible=true to UIDrawable base class - All render methods check visibility before drawing Closes #88 - Add opacity property: - Added float opacity=1.0 to UIDrawable base class - UICaption and UISprite apply opacity to alpha channel Closes #89 - Add get_bounds() method: - Virtual method returns sf::FloatRect(x,y,w,h) - Implemented in Frame, Caption, Sprite, Grid Closes #98 - Add move() and resize() methods: - move(dx,dy) for relative movement - resize(w,h) for absolute sizing - Caption resize is no-op (size controlled by font) 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
a88ce0e259
commit
f1b354e47d
15 changed files with 531 additions and 161 deletions
|
|
@ -34,6 +34,11 @@ public:
|
|||
PyObjectsEnum derived_type() override final;
|
||||
//void setSprite(int);
|
||||
virtual UIDrawable* click_at(sf::Vector2f point) override final;
|
||||
|
||||
// Phase 1 virtual method implementations
|
||||
sf::FloatRect get_bounds() const override;
|
||||
void move(float dx, float dy) override;
|
||||
void resize(float w, float h) override;
|
||||
|
||||
int grid_x, grid_y;
|
||||
//int grid_size; // grid sizes are implied by IndexTexture now
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue