Wintermute Engine > Technical forum

Change description text location

(1/1)

Chaos:
Hiya!  :) I need to change the text that appears everytime you use an item on another. (That little piece of text that says "Use xxxx on xxx" ... I was wondering if there's a way to change the Y cordinate and make this text appear much lower on the screen.  ???

NAItReIN:
Hello  :)


--- Quote ---I was wondering if there's a way to change the Y cordinate and make this text appear much lower on the screen
--- End quote ---

Of course, there is a way how to manipulate with text possition when you want to use one item with another. Please, open game_loop.script.


--- Code: WME Script ---#include "scripts\base.inc" global WinCaption;global WinMenu; // infinite loopwhile(true){   // save the active object for later  var ActObj = Game.ActiveObject;   // handle the standard foating caption  if(Game.Interactive && ActObj!=null)  {    if (Game.SelectedItem==null)    {      WinCaption.X = Game.MouseX;      WinCaption.Y = Game.MouseY + 20;      WinCaption.TextAlign = TAL_LEFT;      WinCaption.Text = ActObj.Caption;       // keep the caption on screen      WinCaption.SizeToFit();      if(WinCaption.X + WinCaption.Width > Game.ScreenWidth) WinCaption.X = Game.ScreenWidth - WinCaption.Width;      if(WinCaption.Y + WinCaption.Height > Game.ScreenHeight) WinCaption.Y = Game.ScreenHeight - WinCaption.Height;    }    // handle the caption when you want to use an object with another    // this is what you need so you can try changing X or Y coordinates by  yourself    else {      var Item = Game.SelectedItem;       WinCaption.X = 0;      WinCaption.Y = 580;      WinCaption.Width = Game.ScreenWidth;      WinCaption.TextAlign = TAL_CENTER;      WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;    }    WinCaption.Visible = true;    WinCaption.Focus();  }  else WinCaption.Visible = false;   // go to sleep for 20 miliseconds to allow the engine to perform other tasks  Sleep(20);} 
Let´s have a closer look on this piece of code:

--- Code: WME Script ---// handle the caption when you want to use an object with another    // this is what you need so you can try changing X or Y coordinates by  yourself    else {      var Item = Game.SelectedItem;       WinCaption.X = 0;      // change this value      WinCaption.Y = 580;       WinCaption.Width = Game.ScreenWidth;      WinCaption.TextAlign = TAL_CENTER;      WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;    }    WinCaption.Visible = true;    WinCaption.Focus();  }

Chaos:
Thanks a lot!... It finally works!!!   :D I think I finally found exactly that ít is actually located on the game_loop.script.
--- Code: ---// handle the caption when you want to use an object with another
    else {
      var Item = Game.SelectedItem;

      WinCaption.X = 0;
      WinCaption.Y = 820;
      WinCaption.Width = Game.ScreenWidth;
      WinCaption.TextAlign = TAL_CENTER;
      WinCaption.Text = "Use " + Item.Caption + " with " + ActObj.Caption;
    }
    WinCaption.Visible
--- End code ---
(I´ve just changed the value of WinCaption.Y = to exactly what I needed)  The thing is I´ve been looking after it for many months (checking many scripts like game or game-loop but sadly I couldn´t found it until now. ) Thanks again.

Navigation

[0] Message Index

Go to full version