Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: interaction with a window (button or anything) while game.interactive = false  (Read 4691 times)

0 Members and 1 Guest are viewing this topic.

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile

What's a good way to create some interactive button on the screen in a window or something that is pressable even when the game isn't interactive.
I tried adding a button to the inventory but it's receiving the pressing event when the game isn't interactive...

any ideas?
Logged

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile

/EDIT: hmm ... I'm wrong.
Logged
... delete the inner sleep ...

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site

You can't do that. If the game is in non-interactive mode, you can't interact with anything. It just doesn't pass the mouse clicks through.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile

dang.
does that include exclusive windows ?
Logged

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile

Hmm ... you can fool around: Make an exclusive transparent window covering the screen. This window then acts as the "glassplane" intercepting every click, that rendering your game "virtually noninteractive" for clicks cannot reach the game objects anymore.

Then, introduce your own method to set the game interactive or noninteractive, that simply activates the glassplane.

You can now have another window containing the button ABOVE the glassplane, so if the glassplane gets active, you can still use the button.

You may have to make sure that other things you want to use in noninteractive mode, such as perhaps dialogs, go above the glassplane es well. It may be a good idea to install the glassplane during game startup and simply activate it when needed, so you can be sure it's above the scene and below most of the other not-ingame windows.

Maybe we can convince mnemonic to add a "stayInteractive"-field to the window defitinions? I could imagine for uses for such gui elements ... like menu buttons accessible during cut-scenes to load and save, for example.
Logged
... delete the inner sleep ...

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site

Yes, sychron's solution would mostly work. There's one difference for the built-in non-interactive state, though. Mouse clicks advance talk lines even if the game is non-interactive. This wouldn't work for the fake nonint mode.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile

Is there any way to advance a line from a script? Then it could be done in a handler on the glass plane.
Logged
... delete the inner sleep ...

SoundGuy

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 196
    • View Profile

Mnemonic is right and the reason the game is interactive is so one can skip dialog lines, the reason i wanted this button that would work in a non interactive mode is so i can have a skip button to skip long segments or cutscenes with multiple talk lines.
i have an "esc" keypress handler that you can escape with, but i also wanted a visual button...

Oded
Logged

sychron

  • Wanderer zwischen den Welten
  • Global Moderator
  • Regular poster
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 223
  • There is no spoon. The enemy gate is down!
    • View Profile

I really would like Mnemonmic to code in a "always interactive" property for gui elements ;-)
Logged
... delete the inner sleep ...
 

Page created in 0.037 seconds with 21 queries.