yozefx / libgdx-users

Automatically exported from code.google.com/p/libgdx-users
0 stars 0 forks source link

TestCollection needs InputMultiplexer instead of InputProcessor #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Running IsoCamTest consumes SPACE bar input from keyboard
without passing it to the TestCollection to handle it.

Perhaps using an InputMultiplexer for TestCollection helps out here.
IsoCamTest() should return FALSE then to indicate that SPACE bar input was not 
handled yet and has to be handled by TestCollection.

See
http://code.google.com/p/libgdx/source/browse/trunk/gdx/src/com/badlogic/gdx/Inp
utMultiplexer.java

Original issue reported on code.google.com by radiok...@gmx.de on 15 Aug 2011 at 4:54

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
yes, i noticed that too...

maybe we could implement that in DemoWrapper, since key events are passed up 
the chain?
so we could have a MultiDemoWrapper extends DemoWrapper and handle spacebar 
there...

or maybe we can just change wherever the input is being sent when a new app 
loads:

Gdx.input.setInputProcessor(this);

that seems to remove/replace the old input processor?

Original comment by dc.pik...@gmail.com on 16 Aug 2011 at 9:00

GoogleCodeExporter commented 8 years ago
Yes.

This way, Nate's comment in forum might come in handy:
http://www.badlogicgames.com/forum/viewtopic.php?f=11&t=1695#p9417

Original comment by radiok...@gmx.de on 16 Aug 2011 at 9:12

GoogleCodeExporter commented 8 years ago
Did not yet find a way to get IsoCamTest's custom IsoCamController connected 
with the InputMultiplexer from TextCollection.

Tried passing the InputMultiplexer to all tests as parameter to the create() 
method so all tests could add themselves to the InputMultiplexer.
This crashes in render() but the line stated there has nothing to do with this 
at all.

Also tried it the other way round: The tests got a new getInputProcessor() 
mehtod that returns this in all cases except for IsoCamTest. For IsoCamTest I 
tried giving it it's own InputProcessor and returning it in the 
getInputProcessor() method. This did not work the way it is intended. I get 
only one out of the two controls set up for it: control the cam *OR* toggle 
tests with keys.

So there is still no luck combining the interaction with IsoCamTest's elements 
on screen and the ',' and '.' keys to toggle test starting from TestCollection.

See demos-3-tier-* packages for latest version on this.

Original comment by radiok...@gmx.de on 18 Aug 2011 at 8:02