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: Scrolling Text that would stay under an image  (Read 3301 times)

0 Members and 1 Guest are viewing this topic.

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Scrolling Text that would stay under an image
« on: December 12, 2008, 06:16:36 PM »

I have an image that takes up the upper part of a scene--I'd like to have scrolling text beneath the image that doesn't scroll up over the image.

I used the Credits script in the demo to get the text scrolling nicely over the scene but now I want to restrict it to the bottom, so that none of the text scrolls up over the image.  Any help is appreciated.

Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Scrolling Text that would stay under an image
« Reply #1 on: December 13, 2008, 02:49:29 PM »

You will need to use nested windows. You know, a window can contain another window (easily done in WindowEdit). The inner window will contain the scrolling text, and the outer window will use the "ClipContents" property to only display the inner window where  you want your text to be displayed.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Scrolling Text that would stay under an image
« Reply #2 on: December 13, 2008, 05:20:48 PM »

Thanks, Mnemonic, I will try it.  :  )
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Scrolling Text that would stay under an image
« Reply #3 on: December 13, 2008, 08:26:05 PM »

My first window shows up, but the nested window doesn't. 

The part of the script.init for the scene that references the window and its nested window is this:

var monster = Game.LoadWindow("scenes\Intro\monster.window");
monster.Visible = true;
var mtext = monster.GetControl("mtext");
mtext.Visible = true;

The parent window is monster.window.
The child window is mtext.

I probably will have more problems with this but starting with the most glaring one.  : )  I read somewhere in the forum that the parent should be invisible but not sure if that's right for this purpose.

I don't have any script on either window - I'm putting the script in the scene.init script.

How do you define the variable that refers to the position of Y in the nested window?

« Last Edit: December 13, 2008, 08:47:39 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  

Catacomber

  • Supporter
  • Frequent poster
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Female
  • Posts: 443
  • I love mice.
    • View Profile
    • Catacomber.com
Re: Scrolling Text that would stay under an image
« Reply #4 on: December 14, 2008, 07:35:18 AM »

OK, I've solved this--not completely 100% to my satisfaction--because the text starts scrolling just a little bit under where I'd like it to--but other than that it works perfectly and I have no complaints.

I have a background for the scene that has a goblinish image at the top and black underneath that.

I made a window--monster.window  no script on it--not needed
Within monster.window, I made a nested window mtext
Within mtext nested window I made a static texty

And then in the scene init.script I put--(some of this stuff is just my loading of my hud and setting it invisible so it doesn't show up in this scene. This scene is called Intro.):

#include "scripts\base.inc"

actor.Active = false;
hud = Game.LoadWindow("scenes\kolobok\hud.window");
hud.Visible = false;
InventoryHidden = true;

var monster = Game.LoadWindow("scenes\Intro\monster.window");
monster.Visible = true;
var mtext = monster.GetControl("mtext");
var texty = monster.GetControl("texty");
var CurrY = 0;
 
CurrY = 350;

texty.Text = "A thief has stolen Princess Vasilisa's Book of Spells from her rooms in the palace.  The palace guards pursued the thief as far as the sewers that run underground. However, he was able to elude the guards by erecting a wall of magic that prevented anyone from following him.  No one knows the identity of the thief or why he took the spell book. Your old friend, Agent Kolobok has summoned you to help.  Tzar Yaromir will reward you well for recovering the spell book and capturing the thief. Grab your gear, Hero, it's time to be once more the Hero of Lukomorye.";
while(texty.Y > -CurrY)//does the scrolling stuff
{
  texty.Y = texty.Y - 3;
  Sleep(115);
  }
 
if(texty!=null)
{
  monster.Close();
  Game.UnloadObject(monster);
  }
 
  {
  var gender = Game.LoadWindow("scenes\Intro\gender.window");//I load a window re play as male or female
  gender.Visible = true;
  }


The monster.window has clipped contents set to true and relevant positioning:
x 35
y 450
width 1024
height 568

The mtext window has clipped contents set to true and relevant positioning:
x  35
y 350
width 900
height  368

The texty static has relevant positioning:

x  54
y  350
width  900
height 366

 :D

If there are any flaws that would cause a problem, please let me know.  If there's anything that's not needed, please let me know. Less code = smaller file.  :  )


« Last Edit: December 14, 2008, 04:37:02 PM by Catacomber »
Logged
http://www.catacomber.com/
Code: WME Script
  1. Mnemonic is wonderful.
  2.  
 

Page created in 0.046 seconds with 21 queries.