If i create a list of sprites and draw them on scene – everything is ok, but when i try to make list of spriteGroups and draw them – there is only black screen.
private Queue<SpriteGroup> linesToDraw;
...
//when user touch the screen we add sprites to our collection
if (pSceneTouchEvent.getAction() == MotionEvent.ACTION_MOVE)
{
linesToDraw.add(DrawHelper.getBrushLine(xStart, yStart, xEnd, yEnd, 5f,mBitmapTextureAtlas, mFaceTextureRegion, getVertexBufferObjectManager()));
}
...
//here we try to draw sprites
while (linesToDraw.size() > 0)
//this code is reachable
linesToDraw.poll().onDraw(pGLState, mCamera);
...
public static SpriteGroup getBrushLine(float xStart, float yStart,float xEnd, float yEnd, float size,BitmapTextureAtlas atlas, ITextureRegion mFaceTextureRegion, VertexBufferObjectManager manager)
{
SpriteGroup result = new SpriteGroup(atlas, 40, manager);
for (int i = 0; i < count ; i++)
{
Sprite part =new Sprite((float)(xStart + i * sLength * cos), (float)(yStart + i * sLength * sin), mFaceTextureRegion, manager);
result.attachChild(part);
}
return result;
}
...
When i use single SpriteGroup and put ArrayList into it everything is fine and i can see sprites on the scene, but List of SpriteGroup doesn’t work. Maybe smth wrong with creating the SpriteGroup with the same Texture and TextureRegion ?
When i use single spritegroup everything was fine, and in case of list of spriteGroups i need to make children visible by myself =)
in getBrushLine:
result.setChilndrenVisible(true)