Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Subtitles  (Read 2643 times)

0 Members and 1 Guest are viewing this topic.

dhammikamanojn

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 1
    • View Profile
Subtitles
« on: July 07, 2013, 07:07:54 AM »

Hi
I am a newer of this forum and I just started to use wintermute engine and I now developing a game with several scenes.. The player can jump to scene to scene.. I want add "Welcome to Peradeniya Park" for my first scene bottom and player jump to other scene and re visit the first the title "Welcome to peradeniya" want be appear.. I tried to do this several times but I cannot do.. Please send me to code and where it want to put.
thanks
Dhammika
Logged

dongo

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 29
    • View Profile
Re: Subtitles
« Reply #1 on: July 07, 2013, 05:24:21 PM »

First, you must create a new window with a static field where you like to appear the subtitle. See this--->http://res.dead-code.org/doku.php/wmebook:ch12

Second in the scene_init.script of the scene where you like to put the subtitle, call the window, and get the static field. Then set the text of the field with your subtitle.


the code in scene_init.script its something like this:

Game.Interactive=false;
var subtitlewindow = Game.LoadWindow("path and name of the window");
var subtitle = subtitlewindow.GetControl("name of static control of window");
subtitle.Text="Welcome to Peradeniya Park";
subtitlewindow.Visible=true;
Sleep(5000); //time that the window its visible
subtitlewindow.Visible=false;
Game.UnloadObject("subtitlewindow"); // destroy the window from memory ;)
Game.Interactive=true;

this is the basic for this. you put this code in all scenes changing the text of the static control from the subtitle window.

note: you can create a function type showSubtitle(String text); and you can call this function in all scenes_inits. But this is more advanced, read the wme book to learn this.

 
« Last Edit: July 07, 2013, 08:54:37 PM by dongo »
Logged
 

Page created in 0.042 seconds with 19 queries.