Please login or register.

Login with username, password and session length
Advanced search  

News:

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


Author Topic: how to display text on the actor's head?  (Read 3268 times)

0 Members and 1 Guest are viewing this topic.

yaobifeng

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
how to display text on the actor's head?
« on: May 15, 2008, 09:19:06 AM »

i want to display a text for example actor's name on the actor's head,display always when ever the actor is walking,running....,how can i do it?
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: how to display text on the actor's head?
« Reply #1 on: May 15, 2008, 10:25:13 AM »

Make a window similar to caption (see game.script) and then position it in either game_loop.script or in actor.script in an infinite loop.

something like:

while(1)
{
  caption_window.X = this.X;
  caption_window.Y = this.Y - some_value; // to have proper offset
  Sleep(100); 
}
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: how to display text on the actor's head?
« Reply #2 on: May 15, 2008, 11:18:59 AM »

"some_value" being this.Height, ideally.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

yaobifeng

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 24
    • View Profile
Re: how to display text on the actor's head?
« Reply #3 on: May 15, 2008, 03:35:46 PM »

thanks for reply.
There are many actors in my game.how to create caption dynamic in the code?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: how to display text on the actor's head?
« Reply #4 on: May 15, 2008, 09:02:59 PM »

You can dynamically create windows using Game.CreateWindow(). Window objects can in turn dynamically create controls.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.074 seconds with 23 queries.