36 lines
748 B
C++
36 lines
748 B
C++
#include "mini.h"
|
|
|
|
int current_editor = 0;
|
|
|
|
void do_terminal() {
|
|
cls(0);
|
|
pdebug();
|
|
}
|
|
|
|
void do_sprite_editor() {
|
|
cls(14);
|
|
palt(0, false);
|
|
rectfill(0, 0, 160, 7, 2);
|
|
rectfill(0, 115, 160, 119, 2);
|
|
sspr(0, 0, 128, 32, 0, 83);
|
|
sspr(0, 0, 8, 8, 8, 16, 64, 64);
|
|
rect(8, 16, 72, 80, 0);
|
|
spr(17, mouseX(), mouseY());
|
|
if (mouseButton(1) && mouseX()>=8 && mouseY()>=8 && mouseX()<72 && mouseY()<72) {
|
|
sset((mouseX()-8)/8, (mouseY()-16)/8);
|
|
}
|
|
}
|
|
|
|
void loop() {
|
|
if (btnp(KEY_TAB)) {
|
|
current_editor = (++current_editor)%5;
|
|
}
|
|
switch(current_editor) {
|
|
case 0:
|
|
do_terminal();
|
|
break;
|
|
case 1:
|
|
do_sprite_editor();
|
|
break;
|
|
}
|
|
} |