About time scale and triggers

0 favourites
  • 6 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Sorry to bother with this. I'm having doubts and issues I'm not sure how to resolve. I would like to know (if someone have the time to explain it to me, Ashley ?) how the time scale affects triggers.

    I have a function called on browser resize which creates and position a sprite over the viewport (more on this here) if it's in portrait (just to make sure it's played in landscape) and destroy it otherwise. I'm also setting the time scale to zero so as to pause the game. This brings some issues, because the function never gets called again. Is this how it's supposed to work? Why a mouse trigger works while timescale=0 and an on resize trigger does not? Is it a bug?

    Thanks,

    Juan.

  • The time scale does not affect triggers. It does however affect the 'Wait' action, so 'Wait 0.2 seconds' will never complete when the time scale is 0.

  • The time scale does not affect triggers. It does however affect the 'Wait' action, so 'Wait 0.2 seconds' will never complete when the time scale is 0.

    Great. I knew before I added the wait it was working; between all the tests I got confused...

    But now I don't now how to resolve the fact that in chrome the sprite doesn't position correctly when maximizing or restoring the window. Did you happen to see this other link? You can check with this same example tough. In Firefox works better, in IE the same as Chrome. In an android tablet with Chrome happens the same when rotating the screen.

    PD: Ups, just noticed there's a spelling error in the file name. Should be "posicionado".

  • Sorry for the bump Ashley but I haven't found a workaround for this last bit yet...

  • I'm not clear what you think is wrong with the positioning. What are you expecting to happen?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • It's better explained here I think. The thing is, that it would seem that maximizing or restoring the browser doesn't fire the "On resize" event.

    The example is just a sprite that covers the viewport and adapts to it whenever the size changes (through the "On resize" event). When I change the window size using the maximize or restore buttons this doesn't happen. Am I missing something?

    Eventually, what I'm trying to do is pause a game if it is not in landscape or the aspect ratio is not appropriate.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)