【重要】サービス終了のお知らせ

Discussions

Qenchant.jsの複数のスプライト表示

初めて質問させて頂きます

現在、enchant.jsでマウスを追尾してその周囲をスプライトが回るパーティクルを作っているのですが複数のスプライトを描画しようとしても一番最後に描画したスプライトに上書きされてしまいます。

どなたか原因がわかる方ご教授お願いします

Sample Code

AAnswer to: enchant.jsの複数のスプライト表示

yamachan360

こんな感じでしょうか。

1) イベントをもらう先を this に変更することで、5回呼び出されるように変更
2) ステータスを格納するオブジェクトへのポインタをパーティクルで保持

と最小限(?)の変更をしてみました。

各種ステータスもSpriteのサブクラスに管理させるようにすれば、コードが短くなってスッキリするとおもいます。

luckin403

返事が遅れてしまい申し訳ないです

なるほどそういうことだったのですね・・・
リスナーに関するthis対する理解が足りなかったですね
どうもありがとうございます!

umar411

Get best Quality Saffron Shilajit, And Other Kashmiri Store items at Kashmiri Saffron
With Free shipping all Over india With an Affordable Price In the Market.
Check Out Best quality dry Fruits Have Good quality Dry fruits Mix And Check the Quality of saffronreview.info
Get Top QUality Vapes,Vape Pen Vape Mods And Other e Cigrattte Item online In India With an Affordable Price vape shop online


Check the Men's Best Hair Style and hair Cuts in Usa With top Trends in the Hair Cutting marketing fields feel The New The Look By Visiting Mens Hairstyles

This was Such A Good Post if You can Check Out best i am Sure you will love it
kesar price
I am Very Impressed To See Your Website Just Check out The major effects and benefits of Walnuts

Kashmir
This was Such A Good Post and Want To Travel To Kashmir Then if You can Check Out best i am Sure you will love it
best saffron brand in india
High in proteins and fats, yet, low in calories Eggs form one of the best diets to lose-lose
weight. weightloss foods
am You are From India and want to Visit Kashmir Like gulmarg,Phalagam and Srinagar and You Just need good Packages Then I recommend Go Tokashmir packages india
with Great love and You Can Try Check saffronreview.info
I am You are From India and want to Visit Kashmir Like gulmarg,Phalagam and Srinagar and You Just need good Packages Then I recommend Go Tosaffron for Pregnancy
Get High Quality and Cheap Dedicated Hosting with CLoud Technology On Hero Clouds

Post a question

You can post JavaScript, HTML, CSS related questions with attached reference to actual codes and get the answers likewise.

Ask a question

  • 1. Click the ‘Post a question’ above

  • 2. Enter question details, reference code, and click ‘Add question’ button

  • 3. Question will be paired with the code on display

Add an answer

  • 1. Choose a question

  • 2. Enter answer details, attach the reference code and click ‘add answer’ button

  • 3. Your answer will accompanied with attached code

Tag