- [WIP] Comence amb el propertygrid
- [NEW] Módul aux - [WIP] Módul tilemap ja mostra el mapa - [FIX] japi/draw: les textures han de vores en NEAREST
This commit is contained in:
45
source/propertygrid.cpp
Normal file
45
source/propertygrid.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "propertygrid.h"
|
||||
#include "japi/draw.h"
|
||||
#include "japi/font.h"
|
||||
#include "japi/input.h"
|
||||
|
||||
namespace propertygrid
|
||||
{
|
||||
int width = 200;
|
||||
int scroll = 0;
|
||||
int line = 0;
|
||||
int element = 0;
|
||||
int max_elements = 0;
|
||||
|
||||
void start()
|
||||
{
|
||||
const SDL_Point win_size = draw::getWindowSize();
|
||||
draw::setClip(win_size.x-propertygrid::width,48,propertygrid::width, win_size.y-48);
|
||||
draw::setColor(0xff181818);
|
||||
draw::fillrect(win_size.x-propertygrid::width,48,propertygrid::width, win_size.y-48);
|
||||
//current[0] = current[1] = current[2] =
|
||||
line = element = 0;
|
||||
|
||||
max_elements = (win_size.y-48) / 24;
|
||||
int mx = input::mouseX();
|
||||
int my = input::mouseY();
|
||||
if (mx>=win_size.x-propertygrid::width && my>=48 && mx<win_size.x && my<draw::getWindowSize().y) {
|
||||
scroll -= input::mouseWheel();
|
||||
if (scroll < 0) scroll = 0;
|
||||
}
|
||||
}
|
||||
|
||||
std::string stringProperty(std::string label, std::string value)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void end()
|
||||
{
|
||||
draw::resetClip();
|
||||
if (element>max_elements && line<max_elements) {
|
||||
scroll -= max_elements-line;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user