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.

`notMultiplied` for `useContextAlpha` renderer option missing in the docs

See original GitHub issue

‘By accident’ I bumped into an example that turns of pre-multiply from the renderer (transparent: 'notMultiplied'), so I was wondering what else is possible to set the transparent option of the renderer to.

I couldn’t find the option in the docs, so looked in the code. To find out the useContextAlpha seem to do the same thing, so looks like an alias.

useContextAlpha is in fact mentioned in the docs. However it tells us nothing about a 'notMultiplied' value and only tells us to not fiddle around with the setting. image

IMO the 'notMultiplied' option is an important option to know for people understanding the difference between straight and pre-multiplied and should at least be mentioned there in the docs as a possible value to put in there. According to the docs the option accepts only boolean values, but obviously this particular string is accepted too. It might be me, but it looks like this option is ONLY useful to use with the notMultiplied value in it, as when setting useContextAlpha to false it looks like the same thing as setting the backgroundAlpha to 0, which would make the option obsolete IMO. But I didn’t deep dive in the code, so I might be missing something here.

IMO the notMultiplied option should be mentioned in the docs.

  • pixi.js version: 6.2.1

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
bigtimebuddycommented, Nov 19, 2022

Doc changes for v6 are fine! PR still welcome here

1reaction
ryusharcommented, Jan 17, 2022

Pass-through setting for the the canvas’ context alpha property. Passing ‘notMultiplied’ will set the canvas’ context alpha property to true and premultipliedAlpha to false. This is typically not something you need to fiddle with. If you want transparency, use backgroundAlpha.

If this definition is fine then I can make a PR for it

Read more comments on GitHub >

github_iconTop Results From Across the Web

PixiJS API Documentation
useContextAlpha =true] - Pass-through value for canvas' context `alpha` ... sets if the renderer will clear the canvas or; * not before the...
Read more >
PIXI.Renderer
This renderer should be used for browsers that support WebGL. This renderer works by automatically managing WebGLBatchesm, so no need for Sprite Batches...
Read more >
Collapse `tracing` package into `cats.effect` to avoid bloating the FFI ...
`notMultiplied` for `useContextAlpha` renderer option missing in the docs, 2, 2021-12-27, 2022-10-24. (Windows Only Issue) Launching with SMAPI ignores my ...
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