How to use pixi.js-legacy and verify that it has been activated?
See original GitHub issueHello, this is not a bug report, but just a question on how to use pixi.js-legacy.
I would like to activate it in my word game, because player numbers have dropped after the upgrade to pixi.js v5 and some users complain about the “WebGL unsupported in this browser” error.
In my HTML-file I have added the CDN-link to pixi.js-legacy:
<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi.js@5.2.1/dist/pixi.min.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi.js-legacy@5.2.1/dist/pixi-legacy.min.js"></SCRIPT>
<SCRIPT TYPE="text/javascript" SRC="//cdn.jsdelivr.net/npm/pixi-filters@latest/dist/pixi-filters.js"></SCRIPT>
In my Javascript file I have the following code (without any imports at the top):
jQuery(document).ready(function($) {
var app = new PIXI.Application({
width: BOARD_WIDTH,
height: BOARD_HEIGHT + SmallTile.HEIGHT,
view: document.getElementById('board'),
antialias: true,
backgroundColor: 0xFFFFFF
});
Thank you
Expected Behavior
The game is rendered in all browsers
Current Behavior
The game is not displayed for some users, with console error: WebGL unsupported in this browser
Possible Solution
Use pixi.js-legacy, but unclear how.
Steps to Reproduce
Environment
-
pixi.js
version: 5.2.1 -
OS & Version: Windows 7, 10
-
Running Example:
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to use pixi.js-legacy and verify that it has been activated?
Hello, this is not a bug report, but just a question on how to use pixi.js-legacy. I would like to activate it in...
Read more >PIXI.settings - PixiJS API Documentation
1: Use the pixi.js-legacy package, which includes a Canvas renderer as a fallback in case high performance WebGL is not supported.
Read more >"WebGL unsupported in this browser" when using webpack
My project is running: Typescript 3.4.5, Pixi.js 5.0.2, ... unsupported in this browser, use "pixi.js-legacy" for fallback canvas2d support.
Read more >PIXI.settings - PixiJS: Documentation
1: Use the pixi.js-legacy package, which includes a Canvas renderer as a fallback in case high performance WebGL is not supported.
Read more >pixi.js-legacy - UNPKG
85, * If enabled is true the filter is applied, if false it will not. ... 2692, * option only is available when...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Correct. When dealing with these full pre-builds of pixijs on a cdn, use either the regular version OR the legacy version, but not both
@stla a bit late but hopefully this will help others landing here: you should only have one installed.
pixi.js-legacy
is a superset ofpixi.js
, including both WebGL and Canvas (in practice, installing the legacy one with npm automatically installs the other one, not sure what the minified versions do).