Hi,
I have been having difficulties rendering updated canvas onto the texture.
I am basically drawing video/camera feed onto the canvas and then want to render canvas as a Sprite. After looking into #435 #430 I still have not achieved any success.
code :
function init(){
base = new PIXI.BaseTexture( canvas ); //that's the html canvas
texture = PIXI.Texture.fromCanvas(base);
sprite = new PIXI.Sprite( texture );
}
function update(){
PIXI.texturesToUpdate.push(base);
}
Thanks for any advice!
hi there! in the latest dev version you should be able to try setting the baseTextures _dirty property.
base._dirty[0] = true;
let me know if this works for ya!
Doesn't work.
sprite.baseTexture._dirty[0] = true works for me
@GoodBoyDigital Are you sure? People should be using the sprite.texture.update() methods, not the old dirty flags I'm pretty sure...actually, I'm almost positive (since I wrote it lol)...
Edit: Realized that the comment Mat made was a long time ago :P latest dev is now v3, which you should use the texture update method!!
sprite.texture.update(), after load texture lels me!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
@GoodBoyDigital Are you sure? People should be using the
sprite.texture.update()methods, not the old dirty flags I'm pretty sure...actually, I'm almost positive (since I wrote it lol)...Edit: Realized that the comment Mat made was a long time ago :P latest dev is now v3, which you should use the texture update method!!