Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: sprite at different speeds ...  (Read 4464 times)

0 Members and 1 Guest are viewing this topic.

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
sprite at different speeds ...
« on: February 28, 2006, 04:47:55 PM »

is it possible to add an entry in the sprite editor that every frame has the same delay. ??
i have some water animations in some scenes that have up to 20 layers.

then i want to change this "special delay" from within my scene. so the animation is not looking so clean, because its evertime the same ...
or even better maybe a random delay (10,15) so every animation is unique in its timeframe ....


greets
stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: sprite at different speeds ...
« Reply #1 on: February 28, 2006, 08:09:17 PM »

There is a "Copy to all frames" button right beside the delay field, which copies the same delay to all frames.

To change delays at runtime you can use a script. Sprites and their frames are fully scriptable, so you can make a loop which traverses all the frames and changes their delays.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: sprite at different speeds ...
« Reply #2 on: March 01, 2006, 10:44:08 AM »

thanks for answering so fast.
okay, blind me. i havent recognized the button for copying to all frames .....
so i will try to script it ...

greets stucki

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: sprite at different speeds ...
« Reply #3 on: March 03, 2006, 04:49:21 PM »

sorry to bother you again.
Can you please give me an example how to script every sprite frame sleep period individually ..
does it override the delay time that is set in the sprite editor ??

Greets
Stucki

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: sprite at different speeds ...
« Reply #4 on: March 03, 2006, 05:06:22 PM »

Code: [Select]
var Sprite = SomeEntity.GetSpriteObject();
for(var i=0; i<Sprite.NumFrames; i=i+1)
{
  var Frame = Sprite.GetFrame(i);
  Frame.Delay = Random(100, 500);
}
Yes, it overrides the delays set in SpriteEdit.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Stucki

  • Frequent poster
  • ****
  • Karma: 0
  • Offline Offline
  • Posts: 325
  • I'm a llama!
    • View Profile
    • Schach-Welten
Re: sprite at different speeds ...
« Reply #5 on: March 04, 2006, 03:02:15 PM »

as always ...
thank you very much. Now i should get it working ...

Greets
stucki
 O0
 

Page created in 0.019 seconds with 20 queries.