Note that there are some explanatory texts on larger screens.

plurals
  1. POAndengine Sprite no longer visible after switching scenes
    primarykey
    data
    text
    <p>again I have a problem where I think I have tried everything and nothing is working so I am asking you for any ideas :)</p> <p><strong>Here it is:</strong></p> <p>In my AndEngine game I switch scenes. First I have my <em>gameScene</em> where my <em>Sprite</em> is walking around, then I detach the Sprite and switch to <em>another scene</em> [using <code>mEngine.setScene(otherScene)</code>] where he gets attached again. This works like a charm until I switch back to the gameScene. </p> <p>I <em>detach</em> the sprite from that other scene, <em>switch</em> back [again using <code>mEngine.setScene(gameScene)</code>] and after some time (there is a TimerHandler involved) the Sprite gets <em>attached</em> to that gameScene again. <strong>But it is not visible.</strong></p> <p>Here are some things I could think of, why this could fail... but everything checks out so far:</p> <ul> <li>Sprite <strong>attached</strong> to the correct Scene</li> <li>correct <strong>Position</strong> (the same position he came from the first time)</li> <li>correct <strong>Size</strong> of the sprite (32x32 pixels)</li> <li><code>setVisible(true);</code> (doesn't work, with or without)</li> <li><strong>zIndex</strong> (set to the one it had before or set to something higher...)</li> <li>the <strong>Alpha</strong> value like with <code>setAlpha(1f);</code> for full visibility</li> <li>the sprite has it's own <strong>TextureAtlas</strong> (1024x1024) &lt;-- I know, its huge - but it worked before :)</li> <li>I even tried reloading the <strong>texture</strong> (<code>textureAtlas.load()</code>)</li> </ul> <p>nothing worked so far - I double checked each of these settings (by logging it, setting it and logging it again ...)</p> <p>Now I am completely lost. The thing is, that everything works fine so far. The sprite was moving around and I had no problems switching scenes... I even switched a second time back to that other scene and the sprite was there again... but not in the gameScene - not even a black square or something just nothing.</p> <p>Oh and i can track the sprite while he is moving. With the <strong>camera following the sprite</strong> I see that he is doing what he is supposed to do - he is just invisible.</p> <p>Any more ideas? What am I missing here? Did any of you have experienced something similar? Anyway, thanks for taking the time and reading this! </p> <p>best regards </p> <p>Christoph</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload