So the idea is that I want a bar at the bottom of the screen with the inventory in it that appears and disappears off the bottom of the screen whenever the mouse is on it, like in Broken Sword frinstance. What I've got is basically a little script in the repeatedly_execute() function that reads as follows: Code: ags
(For clarification, the game is in 800x600 resolution)
Now this works fine, but seems... I dunno, unnecessarily absurd to me? Is Inelegant the word I'm looking for? Anyway it seems to me (and bear in mind I am an imbecile) that there just has to be a better way than this to accomplish something as simple as this, and I just wanted to ask, is there?
if (mouse.y > 549) {
if (gInv.Y > 549) {
gInv.Visible = true;
gInv.Y-=5;
} else {
gInv.Y = 549;
}
} else {
if (gInv.Y < 599) {
gInv.Y+=5;
} else {
gInv.Y = 599;
gInv.Visible = false;
}
}
(For clarification, the game is in 800x600 resolution)
Now this works fine, but seems... I dunno, unnecessarily absurd to me? Is Inelegant the word I'm looking for? Anyway it seems to me (and bear in mind I am an imbecile) that there just has to be a better way than this to accomplish something as simple as this, and I just wanted to ask, is there?