Ok, I'll try, but don't blame me if you don't catch everything... my english does not help at all...
Now, the code for showing the bottom text is located in it's appropriate button of the right-hold menu . The "Take something" text routine is located in a script called "take.script" attached to the "take" action button of the right-hold menu.
Here's the code that it has:
global WinCaption;
global MenuObject;
////////////////////////////////////////////////////////////////////////////////
on "MouseEntry"
{
var ObjCapt = new String(MenuObject.Caption); //save the name of the object
WinCaption.X = 0; //place the caption at the left side of the screen
WinCaption.Y = 580; //and at the bottom
WinCaption.Width = Game.ScreenWidth; //and make it fill it all the way to the right
WinCaption.TextAlign = TAL_CENTER; //now align the text ot the centre.
if (MenuObject.hand!=null) //if the object has a special properity for the
//"hand" action (for example, use, pull, shake...)
{
WinCaption.Text = Game.ExpandString(MenuObject.mano) + " " + ObjCapt.ToLowerCase(); //use it
//and attach the name of the object in lowercase
//to it. This will show something like
//MenuObject.Hand->"Pull lever"<-ObjCapt in lowercase
}
else //if it only needs the default action (Pick up)
{
WinCaption.Text = Game.ExpandString("/ACTDEF0002/Take") + " " + ObjCapt.ToLowerCase();
//use it.
}
WinCaption.Visible = true; //the caption text is finished, show the caption.
}
////////////////////////////////////////////////////////////////////////////////
on "MouseLeave"
{
WinCaption.Visible = false; //when the mouse exits the button, hide the caption.
}
The code is smillar for "Talk to" and "Look".
I added some initiallitation code to the right-hold menu script that activates everytime it shows in the screen, not only when it loads. When you press the right mouse button over an interactive zone, the game.script, besides other things, sends an "open" event to the menu.script, so it does this:
on "open"
{
WinCaption.Visible = false;
WinCaption.SetFont("fonts\bottomtext.font");
}
It Just changes the font and hide the floating caption, because we're going to use it for the bottom text, there's no need of load a new object and waste memory.
But there's still a problem: the game_daemon script is truying to do wird thing with the caption all the time if the mouse is not over an interactive region because of this code:
// handle the standard foating caption
if(Game.Interactive && ActObj!=null)//<-here's a problem...
{
if (Game.SelectedItem==null)
{
...
}
// handle the caption when you want to use an object with another
else {
...
}
...
}
else WinCaption.Visible = false; //<-here too
So, just by changing that for
//upper problem
if(Game.Interactive && ActObj!=null && !WinMenu.Visible)
{
//bottom problem
}
else if(!WinMenu.Visible) WinCaption.Visible = false;
We solve that, and now the text appears in the screen when the cursor is over a right-hold menu button, and disappears when it leaves it, just by using events, with no loop required, so there's no slowdown!!
Of course you must add a WinCaption.SetFont("whatever"); thing to the game_daemon.script in the floating caption management section if you want to use different fonts for the down text and the floating caption text.
I hope that you got it all! If something is not clear, post it and I'll try to explain that part better...
P.S. BTW, I have not found a way of using events for the "use object with object" text, so I keept it like the demo project, it uses a loop, so the game slowdows quite a lot... this can be partially fixed by splitting the game_daemon.script and using a longer sleep time for it, a lot more than 20ms... If anyone finds a methot of doing that with events, please tell me!!
P.S.2 This is not *exactly* the code I have, it's a simplified version, because in my game there's some more things that need to be checked and performed, but I think that this simplified version is easier to understand, easier to explain, and more general, thus, more useful for everyone.