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

Author Topic: Button Captions not on top  (Read 8908 times)

0 Members and 1 Guest are viewing this topic.

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Button Captions not on top
« on: March 22, 2010, 05:29:20 PM »

I have a scene, that acts as my Main Menu. In this scene I have a window with buttons, these buttons have Mouse Over Captions. Works like a charm.

But only, if I enter that scene first. If I change to that scene from another scene (i.e. "Back to Main Menu"), the Captions for the buttons are UNDER the buttons and thus are mostly occluded by the buttons.

Is there any reason why button captions could be in a lower layer than the buttons themselves?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Button Captions not on top
« Reply #1 on: March 22, 2010, 05:42:10 PM »

Is there any reason why button captions could be in a lower layer than the buttons themselves?
No, not really. Make sure you're not loading the window multiple times.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Button Captions not on top
« Reply #2 on: March 23, 2010, 10:16:17 AM »

It is loaded multiple times, but it is also unloaded properly each time.

I have now found out, that it starts way earlier though.

When I fire up the game, menu.scene is loaded and with it the window (window A) that provides the options (i.e. the buttons with the captions). When I click the exit button, another window (window B) is loaded to confirm the selection. Once window B is loaded, the caption of window A is pushed beneath the window. It doesn't matter, if window B is systemexclusive or not. Although, on a perculiar sidenote, when window B is not systemexclusive, it doesn't show up at all. The caption effect is still present though.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Button Captions not on top
« Reply #3 on: March 23, 2010, 10:28:40 AM »

Can you post a screenshot and the window definition?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Button Captions not on top
« Reply #4 on: March 23, 2010, 10:56:09 AM »

Here's a screenshot http://img190.imageshack.us/img190/4969/captionw.jpg

I don't seem to have a window definition  ???
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Button Captions not on top
« Reply #5 on: March 23, 2010, 12:35:58 PM »

window definition = the contents of the .window file
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Button Captions not on top
« Reply #6 on: March 23, 2010, 02:17:30 PM »

Oh, okay. I thought I was supposed to have a windows.def or something. But how do I post the content of a .windows file? Make a screenshot of it?
Logged

odnorf

  • w00t?
  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 7
  • Offline Offline
  • Gender: Male
  • Posts: 1456
  • Lamp dog!
    • View Profile
Re: Button Captions not on top
« Reply #7 on: March 23, 2010, 02:28:49 PM »

All wme definition files are simple text files. Open the .window file in any text editor and paste it here.
Logged
fl*p

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Button Captions not on top
« Reply #8 on: March 23, 2010, 02:59:46 PM »

See, I did not know that :)

Code: [Select]
; generated by WindowEdit

; $EDITOR_PROJECT_ROOT_DIR$ ..\..\..\

WINDOW
{
  NAME="options"
  CAPTION=""
 
  IMAGE="scenes\NewMenu\pic\gestell_gross.png"
 
  TITLE=""
  TITLE_ALIGN="left"
  TITLE_RECT { 5, 5, 235, 45 }
  DRAG_RECT { 0, 0, 215, 25 }
 
  X=0
  Y=0
  WIDTH=1024
  HEIGHT=150
  DISABLED=FALSE
  VISIBLE=TRUE
  PARENT_NOTIFY=TRUE
  TRANSPARENT=FALSE
  PAUSE_MUSIC=TRUE
  MENU=FALSE
  IN_GAME=FALSE
  CLIP_CONTENTS=FALSE
 
  ALPHA_COLOR { 0, 0, 0 }
  ALPHA=0
 
  SCRIPT="scenes\NewMenu\options.script"
 
  EDITOR_PROPERTY
  {
    NAME="Selected"
    VALUE="False"
  }

  BUTTON
  {
    NAME="minispiele"
    CAPTION="Minispiele"
   
    IMAGE="scenes\NewMenu\pic\minispiele.png"
    IMAGE_HOVER="scenes\NewMenu\pic\minispiele_over.png"
    IMAGE_PRESS="scenes\NewMenu\pic\minispiele_over.png"
    IMAGE_FOCUS="scenes\NewMenu\pic\minispiele_over.png"
   
    TEXT=""
    TEXT_ALIGN="center"
   
    X=203
    Y=34
    WIDTH=135
    HEIGHT=75
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  BUTTON
  {
    NAME="einstellungen"
    CAPTION="Einstellungen"
   
    IMAGE="scenes\NewMenu\pic\einstellungen.png"
    IMAGE_HOVER="scenes\NewMenu\pic\einstellungen_over.png"
    IMAGE_PRESS="scenes\NewMenu\pic\einstellungen_over.png"
    IMAGE_FOCUS="scenes\NewMenu\pic\einstellungen_over.png"
   
    TEXT=""
    TEXT_ALIGN="center"
   
    X=377
    Y=36
    WIDTH=120
    HEIGHT=65
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  BUTTON
  {
    NAME="credits"
    CAPTION="Credits"
   
    IMAGE="scenes\NewMenu\pic\credits.png"
    IMAGE_HOVER="scenes\NewMenu\pic\credits_over.png"
    IMAGE_PRESS="scenes\NewMenu\pic\credits_over.png"
    IMAGE_FOCUS="scenes\NewMenu\pic\credits_over.png"
   
    TEXT=""
    TEXT_ALIGN="center"
   
    X=530
    Y=23
    WIDTH=130
    HEIGHT=75
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="False"
    }

  }
  BUTTON
  {
    NAME="exit"
    CAPTION="Spiel verlassen"
   
    IMAGE="scenes\NewMenu\pic\exit.png"
    IMAGE_HOVER="scenes\NewMenu\pic\exit_over.png"
    IMAGE_PRESS="scenes\NewMenu\pic\exit_over.png"
    IMAGE_FOCUS="scenes\NewMenu\pic\exit_over.png"
   
    TEXT=""
    TEXT_ALIGN="center"
   
    X=698
    Y=26
    WIDTH=115
    HEIGHT=80
    DISABLED=FALSE
    VISIBLE=TRUE
    PARENT_NOTIFY=TRUE
    FOCUSABLE=FALSE
    CENTER_IMAGE=FALSE
    PRESSED=FALSE
    PIXEL_PERFECT=FALSE
   
   
    EDITOR_PROPERTY
    {
      NAME="Selected"
      VALUE="True"
    }

  }
}

Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Button Captions not on top
« Reply #9 on: March 23, 2010, 03:25:39 PM »

Ah, *these* captions. I didn't read your original post carefully enough, I thought you were talking about button labels.

The floating captions are actually also a window (it's entirely scripted in game.script / game_loop.script). So when another window gains focus, it's brought into foreground. That's expected behaviour.
You could move the caption window back to top by calling its .Focus() method, but it will be tricky when combined with other windows running in exclusive mode...
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

theflash

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 34
    • View Profile
Re: Button Captions not on top
« Reply #10 on: March 23, 2010, 06:09:55 PM »

That did the trick.

Thanks, as usual!
Logged

Prote1n

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 45
    • View Profile
Re: Button Captions not on top
« Reply #11 on: August 18, 2010, 02:38:59 PM »

I'm actually facing the same problem

In my Option Window, I'm using some tooltip (caption) when the mouse remains for a while on a button. The caption is displayed properly unless I push the button or click on the Option Window. The Focused window becomes the Option Window and the caption is behind ( normal behaviour)

Then I try to:
Caption.MoveToTop(); and/or Caption.Focus() but the Caption remains behind the Option Window ( wich is an Exclusive one)

Logged

Prote1n

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 45
    • View Profile
Re: Button Captions not on top
« Reply #12 on: August 18, 2010, 03:20:10 PM »

Just found the solution while using a Nested Window in the Option window instead of Loading a new one.
Logged
 

Page created in 0.035 seconds with 24 queries.