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: How to reset animation on a window??  (Read 5073 times)

0 Members and 1 Guest are viewing this topic.

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
How to reset animation on a window??
« on: January 03, 2006, 04:01:08 PM »

Hi all,
        I have an issue with a window that uses a sprite that is animated.

The issue is that when I make the window visible for the first time using WINDOW.Visible = true; it plays the animation no problem but when I turn off the window - WINDOW.Visible= false; and then in a later scene turn it on again using WINDOW.Visible= true; the window appears but with no animation as if the animation has alreay played and all I am doing is turning it on and off.


Has anyone got any ideas how I can RESET this after the window animates and is turned off. So When I make it visible again it goes through the frames of the sprite and animates like the initial time.


Many thanks

 


Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to reset animation on a window??
« Reply #1 on: January 03, 2006, 04:27:10 PM »

Something like this should do the trick:

var Img = Window.GetImage();
Img.Reset();
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to reset animation on a window??
« Reply #2 on: January 03, 2006, 06:18:27 PM »

You said above you were calling: WINDOW.Visible = true; So I suppose you have a vvariable called WINDOW in your script. So simply use the same variable for the GetImage() call.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #3 on: January 03, 2006, 06:22:44 PM »

yes I understand, thanks, do I have to put the path for the sprite for the window in the brackets.

Eg

TOPBORDER.GetImage("sprites/path");
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #4 on: January 03, 2006, 08:03:37 PM »

I cannot get this to work, I keep getting Call to undefined method RESET ignored.


I have a window defined and called TOPBORDER

I am scripting it like this: -

var TB = TOPBORDER.GetImage();
TB.Reset();

But I still get the error.


Any ideas, examples of a script would help hugely.

Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to reset animation on a window??
« Reply #5 on: January 03, 2006, 08:21:03 PM »

Erm, sorry, it should be GetImageObject. GetImage returns the filename of the assigned sprite, while GetImageObject returns a reference to the sprite itself.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #6 on: January 03, 2006, 08:34:37 PM »

AHA!! hahahahahaha great works well now.

Also while I am online I still have the issue with my animated menu.
I listed it last year and you said it will need an update. Is the update still in the pipeline??

The issue is when I click my right mouse button , my menu appears (animated sprite) but mu cursor (which is inactive) can still activate parts of the menu while it is being animated.

I want it so if the cursor is inactive no part of the menu can be selected by the player.
If this is not possible , is it possible to put the cursor (inactive at the time) in the bottom right corner of the screen until the menu has finished animating, and then is made visible -Game.Interactive = true;
and the player can then move it over the menu and select an option.


Again many thanks for your help and Happy New Year to you and all on the forum.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to reset animation on a window??
« Reply #7 on: January 04, 2006, 10:01:27 PM »

It surely would be possible to trap the mouse pointer into some area, with code like this:

while(some_condition)
{
  if(Game.MouseX < 700) Game.MouseX = 700;
  if(Game.MouseX > 700) Game.MouseX = 700;

  if(Game.MouseY < 500) Game.MouseY = 500;
  if(Game.MouseY > 500) Game.MouseY = 500;

  Sleep(100);
}

The question is when to call such script and how to end it. That would depend on the architecture of your code.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #8 on: January 05, 2006, 12:44:08 PM »

ok, I am using the demo scripts for the MENU but as I said it animates into the screen, sort of fade in with some FX.

Would I put this code in the Game.script after the Right Click code??

Would be very beneficial to the look of the menu as it would not be disturbed by the pointer selecting buttons on it (also animated)

You can see the issue, the buttons animate before the menu properly is shown - Looks very messy

I will await your thoughts Mnemonic as this is crucial to the Interface IMO.

Again many thanks for the support.
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #9 on: January 09, 2006, 10:36:49 PM »

I tried the Game.Mouse code in my Game.script.

It did what I thought it would do and that is it put the mouse in the corner of the screen whle the menu animation ran.

But if the player moves the mouse the pointer can still interfear with the animation of the menu.


Surely when the Game.Interactive = false; is called it should mean just that, that no interaction is able??

Can this be changed or modified??

A future mod maybe??
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: How to reset animation on a window??
« Reply #10 on: January 10, 2006, 03:20:50 PM »

The controls shouldn't react if the game is in non-interactive mode. I'll fix that.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

SBOVIS

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 404
  • FORGET REALITY SURRENDER TO YOUR DARKEST DREAMS
    • View Profile
    • LIMBO of the LOST
Re: How to reset animation on a window??
« Reply #11 on: January 10, 2006, 03:45:56 PM »

Many thanks
Logged
kind Regards
Steve Bovis
MAJESTIC STUDIOS
 

Page created in 0.022 seconds with 20 queries.