Pixi.js: PIXI.settings.SCALE_MODE not working

Created on 27 Jan 2017  路  13Comments  路  Source: pixijs/pixi.js

I set PIXI.settings.SCALE_MODE = PIXI.SCALE_MODES.NEAREST; and it does not work.

Doing PIXI.SCALE_MODES.DEFAULT = PIXI.SCALE_MODES.NEAREST; does not work in the latest version either, even though it prints the deprecation message.

馃捑 v4.x (Legacy)

Most helpful comment

@bigtimebuddy, ah, apologies for the incorrect usage of cacheAsBitmap in the example.

Thank you!

All 13 comments

However, it works if I disable cacheAsBitmap on the container but this really kills performance.

Hey @DubiousDillan, would it be possible for you to create a fiddle or bin that reproduces this issue? It would help us a lot. Thanks.

@bigtimebuddy, okay, I've made a simple JSFiddle but it seems even more broken. When I uncomment the container.cacheAsBitmap = true; line, the console has an error and nothing renders.

Link: https://jsfiddle.net/4jpfqa10/

It works before transfer methods in version 4.2.1, pls fix.
https://jsfiddle.net/f8190mjq/
2017-01-30 9 49 39

I updated your fiddle to the latest (v4.3.4) and it seems to work: https://jsfiddle.net/1j4vkzn5/3/

@bigtimebuddy, until you uncomment container.cacheAsBitmap = true; and run it.

I have a couple of pieces of information for you that should help:

  • First, it's important that cacheAsBitmap not be applied to the root object that is rendered. See this example
  • Second, there seems to be a bug with RenderTexture respecting the default scale mode. Will work on a PR for this today, and it should be in our next 4.4 release. The work around is to not scale the container you're cacheAsBitmap but instead scale the children. Not ideal, but works (also reflected in that test).

@bigtimebuddy, ah, apologies for the incorrect usage of cacheAsBitmap in the example.

Thank you!

@bigtimebuddy, is this uploaded to NPM now? How would I go about installing the version with the fix? Thanks!

We are waiting on a proper 4.4 release, which might be a week or more. You can use the latest dev release if you want check out the FAQ section of the Wiki for links to the latest dev.

@bigtimebuddy ah, I've had a look and the only thing in the Wiki is a link to a "compiled" version of PIXI. I'm using it with NPM though and compiling the project using Browserify. How would I go about getting the dev version for NPM?

I've tried to download the dev branch as a zip file and npm install it but even then it's using some sort of strange format. I.e. import * from X etc.

Because we don't checkin our build files, you will need to build Pixi locally. If you have already npm installed from the dev branch simply go into node_modules and run "npm install && npm run lib" then try to rebuild your project.

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

readygosports picture readygosports  路  3Comments

gaccob picture gaccob  路  3Comments

YuryKuvetski picture YuryKuvetski  路  3Comments

gigamesh picture gigamesh  路  3Comments

sntiagomoreno picture sntiagomoreno  路  3Comments