java: added ESC button
There is a small bug with it, if in game button seems to be unresponsive.
This commit is contained in:
parent
2ad621568c
commit
756a5bbadb
|
@ -131,6 +131,21 @@ public class ETLActivity extends SDLActivity implements JoyStickListener
|
||||||
|
|
||||||
mLayout.addView(btn2, lp);
|
mLayout.addView(btn2, lp);
|
||||||
|
|
||||||
|
Button esc_btn = new Button(getApplicationContext());
|
||||||
|
esc_btn.setText("ESC");
|
||||||
|
esc_btn.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
SDLActivity.onNativeKeyDown(111);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
RelativeLayout.LayoutParams lp2 = new RelativeLayout.LayoutParams(100, 95);
|
||||||
|
|
||||||
|
lp2.addRule(RelativeLayout.RIGHT_OF, btn.getId());
|
||||||
|
|
||||||
|
mLayout.addView(esc_btn, lp2);
|
||||||
|
|
||||||
JoyStick joyStick = new JoyStick(getApplicationContext());
|
JoyStick joyStick = new JoyStick(getApplicationContext());
|
||||||
|
|
||||||
joyStick.setListener(this);
|
joyStick.setListener(this);
|
||||||
|
|
Loading…
Reference in New Issue