Bug fix for webGLGraphics
indices not being cleared when clear() called
This commit is contained in:
parent
5ce7074dc1
commit
e46b57b980
17 changed files with 55 additions and 2 deletions
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -80,17 +80,40 @@
|
||||||
|
|
||||||
stage.addChild(graphics);
|
stage.addChild(graphics);
|
||||||
|
|
||||||
|
// lets create moving shape
|
||||||
|
var thing = new PIXI.Graphics();
|
||||||
|
stage.addChild(thing);
|
||||||
|
thing.position.x = 620/2;
|
||||||
|
thing.position.y = 380/2;
|
||||||
|
|
||||||
|
var count = 0;
|
||||||
|
|
||||||
stage.click = stage.tap = function()
|
stage.click = stage.tap = function()
|
||||||
{
|
{
|
||||||
graphics.lineStyle(Math.random() * 30, Math.random() * 0xFFFFFF, 1);
|
graphics.lineStyle(Math.random() * 30, Math.random() * 0xFFFFFF, 1);
|
||||||
graphics.moveTo(Math.random() * 620,Math.random() * 380);
|
graphics.moveTo(Math.random() * 620,Math.random() * 380);
|
||||||
graphics.lineTo(Math.random() * 620,Math.random() * 380);
|
graphics.lineTo(Math.random() * 620,Math.random() * 380);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
requestAnimFrame(animate);
|
requestAnimFrame(animate);
|
||||||
|
|
||||||
function animate() {
|
function animate() {
|
||||||
|
|
||||||
|
thing.clear();
|
||||||
|
|
||||||
|
count += 0.1;
|
||||||
|
|
||||||
|
thing.clear();
|
||||||
|
thing.lineStyle(30, 0xff0000, 1);
|
||||||
|
thing.beginFill(0xffFF00, 0.5);
|
||||||
|
|
||||||
|
thing.moveTo(-120 + Math.sin(count) * 20, -100 + Math.cos(count)* 20);
|
||||||
|
thing.lineTo(120 + Math.cos(count) * 20, -100 + Math.sin(count)* 20);
|
||||||
|
thing.lineTo(120 + Math.sin(count) * 20, 100 + Math.cos(count)* 20);
|
||||||
|
thing.lineTo(-120 + Math.cos(count)* 20, 100 + Math.sin(count)* 20);
|
||||||
|
thing.lineTo(-120 + Math.sin(count) * 20, -100 + Math.cos(count)* 20);
|
||||||
|
|
||||||
|
thing.rotation = count * 0.1;
|
||||||
renderer.render(stage);
|
renderer.render(stage);
|
||||||
requestAnimFrame( animate );
|
requestAnimFrame( animate );
|
||||||
}
|
}
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -2894,6 +2894,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
|
@ -32,6 +32,8 @@ PIXI.WebGLGraphics.renderGraphics = function(graphics, projection)
|
||||||
|
|
||||||
graphics._webGL.lastIndex = 0;
|
graphics._webGL.lastIndex = 0;
|
||||||
graphics._webGL.points = [];
|
graphics._webGL.points = [];
|
||||||
|
graphics._webGL.indices = [];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
PIXI.WebGLGraphics.updateGraphics(graphics);
|
PIXI.WebGLGraphics.updateGraphics(graphics);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue