Fix Grid to support None/null texture and fix error message bug
- Allow Grid to be created with None as texture parameter - Use default cell dimensions (16x16) when no texture provided - Skip sprite rendering when texture is null, but still render colors - Fix issue #77: Corrected copy/paste error in Grid.at() error messages - Grid now functional for color-only rendering and entity positioning Test created to verify Grid works without texture, showing colored cells. Closes #77
This commit is contained in:
parent
18cfe93a44
commit
1c71d8d4f7
4 changed files with 186 additions and 26 deletions
|
|
@ -21,6 +21,9 @@ class UIGrid: public UIDrawable
|
|||
{
|
||||
private:
|
||||
std::shared_ptr<PyTexture> ptex;
|
||||
// Default cell dimensions when no texture is provided
|
||||
static constexpr int DEFAULT_CELL_WIDTH = 16;
|
||||
static constexpr int DEFAULT_CELL_HEIGHT = 16;
|
||||
public:
|
||||
UIGrid();
|
||||
//UIGrid(int, int, IndexTexture*, float, float, float, float);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue