Commit 4428ccfa authored by Christian Michael Baum's avatar Christian Michael Baum 🏀
Browse files

Start work on ui tree

parent 97f076ab
#include "uitree.h"
int RegisterClickEvent(
struct CN_UINode *node,
int (*subscriber)(struct CN_ClickEvent event))
{
}
#ifndef CN_UITREE_H_
#define CN_UITREE_H_
#include "../cngine.h"
enum CN_UINodeType {
CN_UINODETYPE_RECT
};
struct CN_ClickEvent
{
int x;
int y;
};
struct CN_UINode {
int childCount;
enum CN_UINodeType nodeType;
int (*subscriber)(struct CN_ClickEvent event);
};
struct CN_UIRectNode {
struct CN_UINode base;
CN_Rect rect;
};
int RegisterClickEvent(
struct CN_UINode *node,
int (*subscriber)(struct CN_ClickEvent event));
#endif
......@@ -22,8 +22,8 @@ void CN_Sparttable_Insert(CN_SpartGrid *grid, CN_Rect bounds, void *existing)
y = bounds.y / grid->cellH;
while(x * grid->cellW < bounds.x+bounds.w) {
while(y * grid->cellH < bounds.y+bounds.h) {
//TODO
// cells[y*w+x] insert cell
/*TODO
// cells[y*w+x] insert cell*/
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment