Jump to content

How to know, when pixi-legacy is active?


Alexander Farber
 Share

Recommended Posts

Good evening,

I have a word game which work pretty well with -

<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>

<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/pixi.min.js"></script>

<script type="text/javascript" src="//cdn.jsdelivr.net/npm/[email protected]/dist/pixi-legacy.min.js"></script>

Recently though I have decided to improve the graphics with duplicating the sizes of the letter tiles and the game board:

var settings = (function () {
    var _quality = (Math.max(screen.width, screen.height) > 1024 ? 2 : 1);


var board = (function () {

    var WIDTH  = 1020 * settings.getQuality();
    var HEIGHT = 1020 * settings.getQuality();
    var CELL   = 60 * settings.getQuality();

For the most users this has worked well, but some our complaining about introduced sluggishness.
For example users of the Russian "Yandex browser".

So I would like to add the condition when setting _quality: if the browser does not support WebGL and the pixi-legacy has become active (admittedly I don't really understand how pixi legacy works) OR the screen is <= 1024 - then set the factor to 1.

Thank you
Alex
image.png.b93e20debb55a12a29a8eca663cfba2b.png
 

 

Link to comment
Share on other sites

Там где-то в недрах лерновой модульности есть грёбаный autodetect

https://github.com/pixijs/pixi.js/blob/efad52f8e24513b7566b2e2b743d8e07580b911b/packages/canvas/canvas-renderer/src/Renderer.ts

Делай то же самое у себя вместо него, и добавь что надо в options.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...