question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Textures updating from a canvas fade out when scaled down

See original GitHub issue

This is a weird one. I need an animating canvas to draw arcs, circles, etc, so I’m using PIXI.Texture.fromCanvas() like this:

var canvasTexture = PIXI.Texture.fromCanvas(canvas);
var sprite = new PIXI.Sprite(canvasTexture);

I then update the texture as I move stuff about on the canvas like this:

canvasTexture.update();

This works, but that sprite now fades as the scale goes down, as far as scale .5, when it disappears. This also happens when it’s inside a scaled container.

Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
themoonratcommented, Mar 16, 2017

By turning off mipmaps on the canvas texture it fixed the problem https://jsfiddle.net/a94ze5tq/16/

0reactions
lock[bot]commented, Feb 24, 2020

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Textures updating from a canvas fade out when scaled down
This works, but that sprite now fades as the scale goes down, as far as scale .5, when it disappears. This also happens...
Read more >
WebGL: fade drawing buffer - Stack Overflow
I've set preserveDrawingBuffer to true . Doing this results in everything drawn on the buffer to be seen all at once, however, I...
Read more >
Fade In/Fade Out behavior in Motion - Apple Support
The Fade In/Fade Out behavior lets you dissolve into and out of any object by ramping the opacity of the object from 0...
Read more >
How to FADE UI in Unity | Unity Fading Tutorial - YouTube
In this Beginner 2021 Unity tutorial I show you who to use CanvasGroup to change the alpha value of UI elements. I will...
Read more >
Optimizing canvas - Web APIs | MDN
While many solutions may exist, a simple first step is to scale the canvas size up and down simultaneously, using its attributes, styling,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found