2
\$\begingroup\$

In my game when I pause the game, I'd like to display three options (Resume, Restart and Menu) so I did this after calling mEngine.stop():

Sprite resume = new Sprite(CAMERA_WIDTH/2, CAMERA_HEIGHT/2, RM.resume, vertex){
            @Override
            public boolean onAreaTouched(TouchEvent event, float pTouchAreaLocalX, float pTouchAreaLocalY) {
                if(event.isActionDown()){
                    this.setScale(1.1f);
                    Log.i("Click","Click");

                }

                return super.onAreaTouched(event, pTouchAreaLocalX, pTouchAreaLocalY);
            }
        };

But the Log "Click" never display. So I tried to do this with the Engine active and the Log displays correctly.

How can I stop my game (Modifier, Physics, Score) without using the mEngine.stop() method ?

\$\endgroup\$
5
  • 1
    \$\begingroup\$ Doesn't the engine gather input? Pausing it would pause input polling too, no? \$\endgroup\$
    – House
    Commented Aug 18, 2013 at 5:28
  • \$\begingroup\$ Yes.. But so how I can stop the game (Modifier, Score, Physics) without using this method ? \$\endgroup\$ Commented Aug 18, 2013 at 5:30
  • \$\begingroup\$ Maybe that's the question you should ask, instead of "Why?". \$\endgroup\$
    – House
    Commented Aug 18, 2013 at 5:44
  • 1
    \$\begingroup\$ It's fine for you now Mister ? \$\endgroup\$ Commented Aug 18, 2013 at 5:49
  • 3
    \$\begingroup\$ Just call me Byte, thanks. Mister Byte was my father. \$\endgroup\$
    – House
    Commented Aug 18, 2013 at 7:02

1 Answer 1

2
\$\begingroup\$

You can use public void setIgnoreUpdate(final boolean pIgnoreUpdate); method from the Entity class. The whole Scene is an entity and you attach all objects to it, so if you call scene.setIgnoreUpdate(true) all attached children will stop updating. Of course, you can selectively call this method only on Entities that you wish to pause. onTouch events should still work.

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .