GithubHelp home page GithubHelp logo

Comments (5)

omatoro avatar omatoro commented on July 23, 2024

訂正です。

"私の感覚的にはpop後のシーンが取得できるのかと思っていましたが、この動作は仕様でしょうか。"
この部分は間違いです。
pop後のシーンが取得できた方が都合が良いから、という理由です。
以下のようなサンプルを作る際に、都合が良かったのでissueとして上げました。

http://jsdo.it/omatoro/kk9c/edit

from tmlib.js.

daishihmr avatar daishihmr commented on July 23, 2024

横槍失礼します。

Array(というか一般的なスタック)のpush/popと同じふるまいなので、感覚的には現状で合ってると思いますよ。
もし、ご要望の機能(シーンスタック上のトップを捨てた後に新しくトップになったシーンを返す)が実装されるのであれば、popScene以外の名前をつけるのが良いかと思います。

from tmlib.js.

omatoro avatar omatoro commented on July 23, 2024

回答頂きありがとうございます。
popSceneを行う処理は、ほとんどはPauseシーンなどpushしたシーン内にて行う上(thisで取得できる)、
popScene後はシーンが削除されるため、取得できてもあまり意味がないのかなと感じました。
削除時に実行したい処理があれば、シーンクラスにてexitイベントに記述すれば良いとも思いますし。

そのため、直感とは反するものの、実装しても問題ないのかなと感じた次第です。
daishihmr様がおっしゃる通りだとも思いますので、是非ご一考ください。

from tmlib.js.

phi-jp avatar phi-jp commented on July 23, 2024

omatoro san 質問ありがとうございます.
daishi san 回答ありがとうございます.

daishi さんの言うとおり, popScene の振る舞いを変えるのはイケてない気がします.
popScene 直後に currentScene でアクセスすればおそらくやりたいことはやれるかと思います.

from tmlib.js.

omatoro avatar omatoro commented on July 23, 2024

popScene直後に、app.currentSceneで同様の動作ができることを確認しました。
daishihmr様、phi1618様 ありがとうございました。

from tmlib.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.