Hi,
I've been wanting to write a piece of text in the game to describe an object, and bring it up on an overlay at the bottom-centre of the screen. Something like this:

I've been searching, but still can't find how to do it. Also I've been having problems with overlays... which basically means I don't know how to use them
Here's my code for the mouse graphic - it updates to an 'active cursor' when we're over something we want to look at/talk to/interact with/etc:
Code: ags
I'm assuming that after each MouseMode check, I put the decription in after every "newGraphic = ACTIVE_ICON" line:
Code: ags
Is this correct? Should I do something simple like this?
What is the correct Overlay code?
I've been wanting to write a piece of text in the game to describe an object, and bring it up on an overlay at the bottom-centre of the screen. Something like this:

I've been searching, but still can't find how to do it. Also I've been having problems with overlays... which basically means I don't know how to use them

Here's my code for the mouse graphic - it updates to an 'active cursor' when we're over something we want to look at/talk to/interact with/etc:
function UpdateMouseGraphic ()
{
int newGraphic;
int lt = GetLocationType(mouse.x, mouse.y);
if (mouse.Mode==eModeUseinv) return;
if (mouse.Mode==eModeWalkto) {
newGraphic=3; //stand still
if (gInventory.Visible==true) {
} else if (GetWalkableAreaAt(mouse.x, mouse.y) !=0) {
newGraphic=2054; //walking
}
}
else if (mouse.Mode==eModeLookat) { //LOOKAT
newGraphic=105; //eye close
Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (gInventory.Visible==true && inve!=null) {
if (inve.IsInteractionAvailable(eModeLookat)) {
newGraphic=2056; //eye open
}
//looking at hotspot
} else {
if (lt == eLocationHotspot) {
if (hs != hotspot[0]) {
if (hs.GetProperty("hidden")==false) {
if(hs.IsInteractionAvailable(eModeLookat)) {
newGraphic=2056; //eye open
}
}
}
}
//looking at object
else if (lt == eLocationObject && ob.IsInteractionAvailable(eModeLookat) && ob.Visible == true) {
newGraphic=2056; //eye open
}
}
}
else if (mouse.Mode==eModeInteract) { //INTERACTION
newGraphic = 2; //interact off
Hotspot *hs = Hotspot.GetAtScreenXY(mouse.x, mouse.y);
Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
//interacting with inventory item
if (gInventory.Visible==true && inve!=null) {
if (inve.IsInteractionAvailable(eModeLookat)) {
newGraphic=286;
}
} else {
//interacting with hotspot
if (hs != hotspot[0]) {
if (hs.GetProperty("hidden")==false) {
if (hs.IsInteractionAvailable(eModeInteract)) {
newGraphic=286;
}
}
}
else if (lt == eLocationObject) {
if (ob.Visible==true) {
if (ob.IsInteractionAvailable(eModeInteract)) {
newGraphic=286;
}
}
}
}
}
else if (mouse.Mode==eModeTalkto) { //TALKTO
newGraphic = 2058; //talk off
Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
Object *ob = Object.GetAtScreenXY(mouse.x, mouse.y);
InventoryItem *inve = InventoryItem.GetAtScreenXY(mouse.x, mouse.y);
if (gInventory.Visible==true && inve!=null) {
} else {
if (lt == eLocationCharacter) {
if (ch != null) {
if (player.ID != ch.ID) {
newGraphic = 213; //talk on
}
}
}
else if (lt == eLocationObject && ob.Visible && ob.IsInteractionAvailable(eModeTalkto)) {
newGraphic=213;
}
}
}
if (newGraphic != mouse.GetModeGraphic(mouse.Mode)) {
mouse.ChangeModeGraphic(mouse.Mode, newGraphic);
}
}
I'm assuming that after each MouseMode check, I put the decription in after every "newGraphic = ACTIVE_ICON" line:
...
if (mouse.Mode==eModeTalkto) { //TALKTO
newGraphic = 2058; //talk off
Character *ch = Character.GetAtScreenXY(mouse.x, mouse.y);
if (lt == eLocationCharacter) {
if (ch != null) {
if (player.ID != ch.ID) {
newGraphic = 213; //talk on
Overlay "this is a "+character.Description;
}
}
}
...
Is this correct? Should I do something simple like this?
What is the correct Overlay code?