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 animace.....  (Read 5529 times)

0 Members and 1 Guest are viewing this topic.

..::Cr::D::..

  • Lol:-)
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 6
  • amater:-)
    • View Profile
Sprite animace.....
« on: December 29, 2005, 12:36:34 AM »

Čau.
Mám objekt (sprite) ve scéně a potřebuju, aby když na něj kliknu spustila se sprite animace.
Jakej script mám použít??

dík :D ;D :)
Logged

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: Sprite animace.....
« Reply #1 on: December 29, 2005, 12:42:59 AM »

normálně mu ve SceneEditor přiřaď script a v tomhle scriptu nastav handler

on "LeftClick"
{

}
ve kterym zavolej PlayAnim pro ten sprite.
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

..::Cr::D::..

  • Lol:-)
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 6
  • amater:-)
    • View Profile
Re: Sprite animace.....
« Reply #2 on: December 29, 2005, 05:36:39 PM »

No jo jenže já napíšu

on "LeftClick"
{
    this.PlayAnim(".....\......\xxxx.sprite");
}

A ono to prostě nic neudělá.Ale to "this" tam asi nema bejt co?? ???
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sprite animace.....
« Reply #3 on: December 29, 2005, 06:14:50 PM »

Posle Smrti, pokud jsi v rozpacich, tak radeji nic nepis. Lepsi zadna rada, nez spatna rada.

this.PlayAnim("cesta\soubor.sprite"); je spravne. "this" reprezentuje objekt, ke kteremu je skript prirazen. Cili pokud mas nejakou entitu ve scene, k ni je prirazen tento skript, tak "this" je ona entita.
Cili ten kod je spravne. Proc se nic neprehraje? Duvodu muze byt vic. Budto mas zadanou spatne cestu k tomu spritu, nebo ta tvoje entita neni interaktivni (pak by ignorovala klinuti mysi). Zkontroluj cestu a zkontroluj, jestli u ni mas ve SceneEditu zaskrtnuto "interactive".
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

killer

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 22
    • View Profile
Sprite animace
« Reply #4 on: July 09, 2006, 06:17:52 PM »

Chtěl bych se zeptat na něco ohledně sprite animací.Mam scenu na který chci aby mě v pozadí za určitej čas projelo z prava do leva auto.Tak sem si udělal animaci s tim autem(5 snímků jak se točej kola) a nastavil sem Move by na -5.....animace funguje podle představ.Ale jakmile ji umístím do scény tak se auto rozjede a zmízí pryč ze scény a už se neukáže.Neví někdo jak to vyřešit aby se znova ukázalo a rozjelo se??
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Sprite animace.....
« Reply #5 on: July 11, 2006, 08:45:57 PM »

Moznosti je vic. Nejlepsi by asi bylo, vyresit to skriptem. Ve skriptu te entity (auta) by bylo neco jako:

while(true)
{
  Sleep(5000);
  this.SkipTo(100, 200);
}

Tj. ten skript kazdych pet vterin vrati entitu na pozici 100, 200. Smaozrejme ten cas a pozici by sis upravil podle svych potreb.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.021 seconds with 20 queries.