pat Posted May 6, 2014 Share Posted May 6, 2014 Hello all, Please, I am a newbie, so excuse my question.I am looking at the code of Pixi, because I want to understand how works this code.in Stage.js, I do not understand thatthis.worldTransform or this.dirty are private ??? Thanks a lotPIXI.Stage = function(backgroundColor){ PIXI.DisplayObjectContainer.call( this ); /** * [read-only] Current transform of the object based on world (parent) factors * * @property worldTransform * @type Mat3 * @readOnly * @private */ this.worldTransform = new PIXI.Matrix(); /** * Whether or not the stage is interactive * * @property interactive * @type Boolean */ this.interactive = true; /** * The interaction manage for this stage, manages all interactive activity on the stage * * @property interactive * @type InteractionManager */ this.interactionManager = new PIXI.InteractionManager(this); /** * Whether the stage is dirty and needs to have interactions updated * * @property dirty * @type Boolean * @private */ this.dirty = true; //the stage is its own stage this.stage = this; //optimize hit detection a bit this.stage.hitArea = new PIXI.Rectangle(0,0,100000, 100000); this.setBackgroundColor(backgroundColor);}; Quote Link to comment Share on other sites More sharing options...
xerver Posted May 7, 2014 Share Posted May 7, 2014 They are private because we mark them as such in the documentation, not that we use any language feature to enforce it. Javascript doesn't have the idea of public/protected/private; there are ways to "hide" properties from non-class methods but we do not employ any of those in Pixi.js When you see @private, or @readOnly they are hints for the documentation; not hard enforced states. It just tells the user that they exists, but you probably shouldn't use them without knowing exactly what you are doing. Quote Link to comment Share on other sites More sharing options...
pat Posted May 7, 2014 Author Share Posted May 7, 2014 Thanks a lot for the answer 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.