Evora's tile editor

On my side, the graphical object also registers itself to a stack of clickable things. I haven’t gone very far yet making my editor though.

[CODE] function addClickable(clickable){
clickables.push(clickable);
}

function mouseMove(e){
if(hovering != -1)
checkMouseOff = hovering;
hovering = -1;
for(var i = 0; i < clickables.length; i++){
if(inBounds(clickables[i].x,clickables[i].y,
clickables[i].width,
clickables[i].height,
e.clientX,e.clientY)){
clickables[i].hover();
hovering = i;
}
}//break; else -> ?
if(hovering == -1 && checkMouseOff != -1){
clickables[checkMouseOff].normal(checkMouseOff);
checkMouseOff = -1;
}
if(hovering != -1){
mouseHover(hovering);
}
}

function mouseDown(e){
// e.preventDefault();
if(hovering != -1){
clickDown = true;
clickables[hovering].click(hovering);
}
}
[/CODE]

and

[CODE]function Button(x, y, which){
this.x = x;
this.y = y;
this.width = buttonSize[0];
this.height = buttonSize[1];
this.sWidth = this.width;
this.sHeight = this.height;
this.sx = 0;
this.garbage = false;
this.needsRedraw = false;
this.atlas = menuButtons;
renderStack.addToStack(this); //?
Mouse.addClickable(this);

[…](a switch determining which button is which)

Button.prototype.normal = function(id){
this.sx = 0;
console.log(“normal”);
Drawable.drawLocal(id);
}

Button.prototype.hover = function(id){
this.sx = 24;
console.log(“hover”);
Drawable.drawLocal(id);
}

Button.prototype.click = function(id){
this.sx = 48;
console.log(“click”);
Drawable.drawLocal(id);
}
[/CODE]

The fuck is this?

Have something better in mind?

Spooon is just random af.

Spooon dont know what code looks like

which


which?which?which?which?which?which?

Hahahahaha
I was generous on the Hs that day. Probably had the word whether in mind.

lol nope ok