Please login or register.

Login with username, password and session length
Advanced search  


This forum provides RSS feed. To query recent posts use this url. More...

Author Topic: displaying text function and effects  (Read 2087 times)

0 Members and 1 Guest are viewing this topic.


  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 51
    • View Profile
displaying text function and effects
« on: December 28, 2005, 10:15:37 PM »


Happy holidays to everyone!

I have a question about scripting in WM. It's very very easy, but since i'm not very good at it i have to ask :D
How can i display text on-screen? I don't mean mesages windows. Simple text. Is tehre a function for this? I'm really not very good at programming, so please help. I know a method: making an entity with an invisible sprite, and having it talk for the scenes in wich i want text displayed on-screen. But is there a function that can display it directly?

Also i want to know if it is possible to make a transition effect, for screen changes. I want when the screen changes, first the current screen will have a sepia effect, and then the next screen (wich also has the sepia effect) appears and after 1 second the sepia effect disappears and the screen is coloured. Is there a function for sepia effect over screens? Or can anyone tell me how to write such a function?

Thanx in advance,
Untitled project status: production


  • Supporter
  • Addicted to WME forum
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 528
  • Fear me! I'm evil!
    • View Profile
    • Order of Dagon
Re: displaying text function and effects
« Reply #1 on: December 28, 2005, 11:42:04 PM »

You can make transition-effects with the scene.FadeOut and Scene.FadeIn-commands, you'll only have to find out the right RGB-values for the sepia-tone.

For talking the invisible entity is a good method, I don't know if there is a direct talk-command?


  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: displaying text function and effects
« Reply #2 on: December 29, 2005, 09:49:31 AM »

AFAIK Talk must be always linked to something so hidden entity is really the best way to do this while talking but the drawback is that
your text stays on only for the time until the line is talked. Otherwise you can use the window approach.

First you have to create some minimalistic window like this:

Code: [Select]
    TEXT = ""
    NAME = "test"
    FONT = "some_desired.font"
    X = 0
    Y = 0
    WIDTH = 400
    HEIGHT = 200

Then you can operate it like this:

Code: [Select]
  global TextWindow = Game.LoadWindow("your_new.window");
  var TextTest = creditwin.GetWidget("test"); //This is the name as defined in the Window above
//Now we will display some centered text
  TextTest.Y = 378; //Vertical Position of the window
  TextTest.Text = "Hello world";
  TextTest.SizeToFit(); //Resize the window so it will be as big as the text.
  TextTest.X = ScreenWidth / 2 - (TextTest.Width / 2); //Substitute your own resolution ScreenWidth here

Almost identical code is AFAIK in the WME demo so you can see it there in action. Also note that it's untested but should work
without any problems.
« Last Edit: December 29, 2005, 09:59:10 AM by metamorphium »
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Page created in 0.333 seconds with 23 queries.