Jump to content

Constants in PIXI (capitalized variables)


Hachi
 Share

Recommended Posts

Just to quote goodboydigitals blog: " PIXI.GC_MODES.DEFAULT = PIXI.GC_MODES.AUTO; " (http://www.goodboydigital.com/pixi-js-v4/).

Is this convention ok in PIXI code, to change variables that are (in principle) marked as "constants"?

I have already one convention of changing scale modes DEFAULT to something else, so that it works in all the situation with pixelation strategy. But I wouldn't want to do that as I regard that as a bad move (without yet coming up with a better way). In normal javascript coding standards, you wouldn't change variable that is capitalized to anything else, as de-facto it is treated as constant. So:
1) Is it ok to change those "constants" (any of them)? Or are they subject to be changed with the assumption that they should be and are treated as constants?
2) Why are they capitalized if they are also "supposed" to be changeable? So why not leave default as normal and others as capitalized?

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...