Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Pages: [1] 2  All

Author Topic: Subtitles+Captions position  (Read 9021 times)

0 Members and 1 Guest are viewing this topic.

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Subtitles+Captions position
« on: March 16, 2006, 09:23:50 PM »

Hi all!

How can I make the speech subtitles to appear in the bottom of the screen rather than above the speakers' heads?

Thanx!
« Last Edit: March 18, 2006, 01:48:07 PM by vadbag »
Logged
WME rocks!!!

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Subtitles position
« Reply #1 on: March 16, 2006, 09:27:54 PM »

Check out the following actor properties:

actor.SubtitlesPosX
actor.SubtitlesPosY
actor.SubtitlesWidth
actor.SubtitlesPosXCenter
actor.SubtitlesPosRelative

Documentation is your friend, you'll find it under actor object. :) In case anything is still unclear,
let us know. ;)
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #2 on: March 16, 2006, 10:51:23 PM »

Thank you!
I put this in game.script:
Code: [Select]
actor.SubtitlesPosX = 400;
actor.SubtitlesPosY = 550;
actor.SubtitlesPosXCenter = true;
But the subtitles are displayed to the right of screen center.  ???
Perhaps, I should use actor.SubtitlesPosRelative;, but what are the options for it?

Thanx!
Logged
WME rocks!!!

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #3 on: March 16, 2006, 11:02:57 PM »

I think, I found what it is. "True" and "False" isn't it? However, my caption names and the subtitles are shown in slightly different X positions, although the X coordinates are the same.
Logged
WME rocks!!!

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Subtitles position
« Reply #4 on: March 17, 2006, 09:15:50 AM »

And did you specify SubtitlesWidth?

Because the subtitles width defines the area in which the subtitles will be centered. So
if you want the full center in let's say 1024x768, you should put 1024 as a SubtitlesWidth
parameter.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #5 on: March 17, 2006, 04:19:26 PM »

I measured the position of both - the subtitles and the caption - and found out that it is actually the problem with the caption, since the subtitles are exactly in the middle. The caption is slightly moved to the right from screen centre.

Here is caption code:
Code: [Select]
  // handle the standard foating caption
  if(Game.Interactive && ActObj!=null)
  {
    if (Game.SelectedItem==null)
    {
      WinCaption.X = 400;
      WinCaption.Y = 550;
      WinCaption.TextAlign = TAL_CENTER;
      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;
  }

Any idea what it might be?

Thanx!
Logged
WME rocks!!!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Subtitles position
« Reply #6 on: March 17, 2006, 04:45:04 PM »

Errr, I don't understand what you're trying to achieve. If you want the caption to be always centered on screen, just... set it so.

WinCaption.X = 0;
WinCaption.Width = Game.ScreenWidth;
WinCaption.TextAlign = TAL_CENTER;

That's all you need to do, really.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #7 on: March 17, 2006, 09:05:15 PM »

 :o  Now the caption is on the left (X=0).

What I meant in my question was: I've got X coordinate = 400 for both - subtitles and captions (game resolution 800X600), but when I run the game, the caption is in different position from subtitles. The subtitles are exactly in the middle of the screen, but the captions aren't, despite the fact that x coordinate is the same for both.  :( What I want is to understand what I did wrong with the caption parameters.

Thanx
Logged
WME rocks!!!

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Subtitles position
« Reply #8 on: March 17, 2006, 10:42:01 PM »

:o Now the caption is on the left (X=0).
I'm pretty sure the caption will be centered if you use the code I posted above ;) But anyway, perhaps your problem is, that the speech subtitles coorditaes specify the *center* of the subtitle, unless you set the SubtitlesPosXCenter attribute to false.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #9 on: March 17, 2006, 11:35:51 PM »

Yes, it is actor.SubtitlesPosXCenter = true; Do you think that this is the reason?
How can I do the same with the caption?

And still, the caption is on the left, :'( since X=0, where 0 is the left border of the screen.
Here is this piece of code:
Code: [Select]
  // handle the standard foating caption
  if(Game.Interactive && ActObj!=null)
  {
    if (Game.SelectedItem==null)
    {
      WinCaption.X = 0;
      WinCaption.Y = 550;
      WinCaption.Width = Game.ScreenWidth;
      WinCaption.TextAlign = TAL_CENTER;
      WinCaption.Text = ActObj.Caption;
Logged
WME rocks!!!

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Subtitles position
« Reply #10 on: March 18, 2006, 09:46:04 AM »

Hmmm, just an idea. Don't you have

WinCaption.SizeToFit();

somewhere after that specified code?

Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #11 on: March 18, 2006, 12:57:02 PM »

Yes, I do. Here is the full code at the moment:
Code: [Select]
// handle the standard foating caption
  if(Game.Interactive && ActObj!=null)
  {
    if (Game.SelectedItem==null)
    {
      WinCaption.X = 400;
      WinCaption.Y = 550;
      WinCaption.TextAlign = TAL_CENTER;
      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;
  }

Why?  ???
Logged
WME rocks!!!

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Subtitles position
« Reply #12 on: March 18, 2006, 01:08:51 PM »

Comment SizeToFit line out. It's the reason why it doesn't work. Idea of the caption  centered on the screen is to create an area wide as the screen and center the text in this area. But SizeToFit resizes
this area only to the size of the actual text so that's why you experience your problems.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles position
« Reply #13 on: March 18, 2006, 01:39:45 PM »

I tried to get rid of the SizeToFit, and the captions completely disappeared from the screen!  :o
Hmmm...

Any idea what to do?
Logged
WME rocks!!!

vadbag

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 65
    • View Profile
Re: Subtitles+Captions position
« Reply #14 on: March 19, 2006, 12:31:14 PM »

Quote
vadbag:I tried to get rid of the SizeToFit, and the captions completely disappeared from the screen!  Shocked
Hmmm...

Any idea what to do?

Guys? Where are you?
Logged
WME rocks!!!
Pages: [1] 2  All
 

Page created in 0.042 seconds with 23 queries.