Closed XanderXevious closed 11 years ago
Hey - I'm having trouble reproing this, could I hassle you for a few more details?
This is what I'm doing to try and repro
var grassLayer:Sprite = new Sprite();
addChild(grassLayer);
for ( var i:int = 0; i < 10; i++ )
{
var image:Image = new Image(leavesTexture);
image.x = Math.random() * stage.stageWidth;
image.y = Math.random() * stage.stageHeight;
grassLayer.addChild(image);
}
I'm inserting this at various points around the 'Fill_Stroke_Example', and each layer is still rendering correctly.
Which starling display object are you using to render the grass tufts with?
Hmmm bizarre... I'm using an image the same as you are in your repro. The only difference is that I'm getting it from a texture atlas.
for ( var y:int = 0; y < Constants.GameHeight * 2; )
{
for ( var x:int = 0; x < Constants.GameWidth * 2; )
{
var tile:Image = new Image(Game.assets.getTexture("grass"));
tile.x = x;
tile.y = y;
grassLayer.addChild(tile);
x += tile.width;
}
y += tile.height;
}
Ok, it turns out when I had downloaded the repository github had somehow given me version 1 instead of the latest, which explains a lot of other issues I was having. It's all working fine now!.
Good to hear!
I'm getting a weird issue with the Fill and Stroke objects. When used in combination with other starling sprites some of the other sprites will stop rendering.
As an example I have this code, which is based on the Fill_Stroke example:
What I find is that the sprites in the grass layer won't draw, but the mountain and tree will. If I remove the mountain.addChild(landStroke) line the grass draws correctly. I also tried doing landStroke.visible = false, and this causes the grass to draw. If I move the mountain after the tree, then the tree will not draw but the grass will.
It seems that the only hack I've found is to add another image just before the mountain layer so that it gets ignored instead of the ones I want.