oakes / play-clj

A Clojure game library
The Unlicense
940 stars 72 forks source link

set input processor on Stage only once, in :show. #76

Closed floybix closed 9 years ago

floybix commented 9 years ago

This seems to fix the ui button non-responsiveness issue I noted in #75.

Maybe it was some concurrent modification thing on the inputMultiplexer.

oakes commented 9 years ago

Please try the latest commit. It attempts to fix the issue by checking if the screen exists already in the input multiplexer. Your version looked fine but I wanted to minimize the changes to prevent unintentional breakages.

floybix commented 9 years ago

OK, that seems to work as well as my patch. I do still see unresponsiveness sometimes -- if I add the actors to the stage later rather than creating them in the show function perhaps but haven't narrowed it down properly...

floybix commented 9 years ago

I just noticed that, while this commit fixed the ui actors which is great, it did something to on-touch-down. Specifically (at least in my game) it now only fires in the outermost 1 or 2 pixels around the stage. Which suggests that it may be masked by the ui touch down listener - though i haven't looked into it.

oakes commented 9 years ago

Does this problem exist in your change?

On Thu, Mar 12, 2015 at 10:34 AM, Felix Andrews notifications@github.com wrote:

I just noticed that, while this commit fixed the ui actors which is great, it did something to on-touch-down. Specifically (at least in my game) it now only fires in the outermost 1 or 2 pixels around the stage. Which suggests that it may be masked by the ui touch down listener - though i haven't looked into it.

Reply to this email directly or view it on GitHub https://github.com/oakes/play-clj/pull/76#issuecomment-78491177.

floybix commented 9 years ago

Actually, no. But I don't know why.

oakes commented 9 years ago

On second thought, your version seems pretty safe, and doesn't do any unnecessary removals of actors. So, I'll use it instead.