Author Topic: Help with Layout.xml  (Read 2841 times)

netsurfr

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Help with Layout.xml
« on: June 21, 2021, 02:55:36 PM »
I would like to "hide" an image when a game starts (ongamestart) but I haven't been able to figure out the code to make that work. This is the section of my existing layout.xml that loads the image so could someone reply w/ what code I need to add so that the image is not visible (alpha=0) while the game is running? Thanks!


<reloadableImage type="topper" mode="Layout" monitor="2" alpha="1" y="1500" x="center" xOrigin="center" yOrigin="center" height="1800" width="1000" layer="1">
<onMenuIdle >           
<set duration="1.0">               
<animate type="alpha" to="1" algorithm="easeinquadratic"/>           
</set>       
</onMenuIdle >
<onMenuScroll >           
<set duration="0.2">               
<animate type="alpha" to="0" algorithm="easeinquadratic"/>
</set>       
</onMenuScroll > 
 </image>

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1534
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: Help with Layout.xml
« Reply #1 on: June 21, 2021, 05:55:07 PM »
http://www.retrofe.nl/wiki/doku.php?id=layouts#general_parameters
Code: [Select]
<onGameEnter >
  <set duration="0.2">
    <animate type="alpha" to="0"/>
  </set>
</onGameEnter >
 

netsurfr

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Help with Layout.xml
« Reply #2 on: June 21, 2021, 11:22:37 PM »
Thanks. Tried that but although it hides the image momentarily it appears back again immediately and it seems to be because the <onMenuIdle> event turns it back on.

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1534
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: Help with Layout.xml
« Reply #3 on: June 23, 2021, 10:06:30 AM »
Do you have any other onGameEnter animations in the layout by chance?

Sent from my SM-G950F using Tapatalk


netsurfr

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Help with Layout.xml
« Reply #4 on: June 23, 2021, 04:39:16 PM »
Yes there are additional instances of onGameEnter & onGameExit in the rest of the layout BUT they are handling images on different monitors so this is the only section of the layout.xml making changes to Monitor 2.

Do you have any other onGameEnter animations in the layout by chance?

Sent from my SM-G950F using Tapatalk

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1534
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: Help with Layout.xml
« Reply #5 on: June 25, 2021, 02:19:31 PM »
That doesn't matter. When the onGameEnter animation is finished, it will continue with idle animations unless the game started, and does so individually for each element on screen. Just match the duration of the animations, and I think you can prevent this from happening. How long do the other onGameEnter animations last?

netsurfr

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Help with Layout.xml
« Reply #6 on: June 26, 2021, 10:43:42 PM »
Thanks Pieter. Just to make sure I understand what you're saying/asking.... I should find the longest onGameEnter animation in the entire layout.xml and make the duration on my new onGameEnter take as long (in my case the longest onGameEnter duration is "1")? If that's what you mean I'll give it a shot!

That doesn't matter. When the onGameEnter animation is finished, it will continue with idle animations unless the game started, and does so individually for each element on screen. Just match the duration of the animations, and I think you can prevent this from happening. How long do the other onGameEnter animations last?

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1534
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: Help with Layout.xml
« Reply #7 on: June 26, 2021, 10:45:50 PM »
Yes, that is correct.

Sent from my SM-G950F using Tapatalk


netsurfr

  • Newbie
  • *
  • Posts: 14
  • Karma: +1/-0
    • View Profile
Re: Help with Layout.xml
« Reply #8 on: June 26, 2021, 11:36:26 PM »
That did it! Just had to adjust the duration so it was longer and now the image stays hidden. Thanks for the help!

Pieter Hulshoff

  • Administrator
  • Hero Member
  • *****
  • Posts: 1534
  • Karma: +46/-14
    • View Profile
    • Towel 42
Re: Help with Layout.xml
« Reply #9 on: June 27, 2021, 12:35:01 AM »
You’re welcome.