Alexander Farber Posted January 30, 2021 Share Posted January 30, 2021 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 Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 30, 2021 Share Posted January 30, 2021 Там где-то в недрах лерновой модульности есть грёбаный autodetect https://github.com/pixijs/pixi.js/blob/efad52f8e24513b7566b2e2b743d8e07580b911b/packages/canvas/canvas-renderer/src/Renderer.ts Делай то же самое у себя вместо него, и добавь что надо в options. Quote Link to comment Share on other sites More sharing options...
Alexander Farber Posted January 31, 2021 Author Share Posted January 31, 2021 I am not sure if that is what you meant, Ivan, but I have found this solution: var _quality = (Math.max(screen.width, screen.height) > 1024 && PIXI.utils.isWebGLSupported() ? 2 : 1); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.