- Ja se pot seleccionar actors
This commit is contained in:
@@ -56,9 +56,10 @@ void game::init()
|
|||||||
game::setUpdateTicks(64);
|
game::setUpdateTicks(64);
|
||||||
|
|
||||||
//actor::actor_t *hero = actor::create("HERO", {16,32,8}, {8,8,12}, "test.gif", {0,32,20,32}, {-6,38});
|
//actor::actor_t *hero = actor::create("HERO", {16,32,8}, {8,8,12}, "test.gif", {0,32,20,32}, {-6,38});
|
||||||
actor::actor_t *hero = actor::create("HERO", {16,32,8}, {8,8,12}, "abad.gif", {0,0,20,35}, {-6,32});
|
|
||||||
hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
//actor::actor_t *hero = actor::create("HEROHEROHEROHER", {16,32,8}, {8,8,12}, "abad.gif", {0,0,20,35}, {-6,32});
|
||||||
actor::setDirty(hero, true);
|
//hero->flags = FLAG_HERO | FLAG_PUSHABLE | FLAG_GRAVITY | FLAG_ORIENTABLE | FLAG_ANIMATED;
|
||||||
|
//actor::setDirty(hero, true);
|
||||||
|
|
||||||
restart();
|
restart();
|
||||||
|
|
||||||
@@ -144,15 +145,23 @@ bool game::loop()
|
|||||||
btn("WDOORS:", 330, 200, room_walldoors, 0, 5);
|
btn("WDOORS:", 330, 200, room_walldoors, 0, 5);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
|
draw::color(TEAL);
|
||||||
|
draw::rect(328, 38, 67, 94);
|
||||||
|
const int mx = input::mouseX();
|
||||||
|
const int my = input::mouseY();
|
||||||
|
const bool btnDown = input::mouseBtn(1) || input::mouseBtn(3);
|
||||||
|
|
||||||
int line = 0;
|
int line = 0;
|
||||||
actor::actor_t *act = actor::getFirst();
|
actor::actor_t *act = actor::getFirst();
|
||||||
while (act) {
|
while (act) {
|
||||||
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR) {
|
if ((act->flags&FLAG_NOEDITOR)!=FLAG_NOEDITOR) {
|
||||||
if (act==actor::getSelected()) {
|
if (act==actor::getSelected()) {
|
||||||
draw::color(TEAL);
|
draw::color(TEAL);
|
||||||
draw::fillrect(330, 40+line*8, 50, 8);
|
draw::fillrect(330, 40+line*9, 63, 9);
|
||||||
|
} else if ((mx>=330) && (mx<394) && (my>=40+line*9) && (my<40+9+line*9) && btnDown) {
|
||||||
|
actor::select(act);
|
||||||
}
|
}
|
||||||
draw::print(act->name, 330, 40+line*8, WHITE, BLACK);
|
draw::print(act->name, 332, 42+line*9, WHITE, BLACK);
|
||||||
line++;
|
line++;
|
||||||
}
|
}
|
||||||
act = act->next;
|
act = act->next;
|
||||||
|
|||||||
Reference in New Issue
Block a user