-1

I have some problem with understanding some code

(function (lib_p, img, cjs) {

var p; // shortcut to reference prototypes

// library properties:
lib_p.properties = {
  width: 364,
  height: 540,
  fps: 20,
  color: "#000000",
  manifest: [
    {src:"img/bot1_l.png", id:"bot1_l"}

  ]
};

// symbols

(lib_p.bot1_l = function() {
  this.initialize(img.bot1_l);
}).prototype = p = new cjs.Bitmap();
p.nominalBounds = new cjs.Rectangle(0,0,116,344);

Where can I read about this? I understand that is createJS, but I can`t figure out what all this mean - especially:

  1. (lib_p, img, cjs),

  2. (lib_p.bot1_l = function() { this.initialize(img.bot1_l); }).prototype = p = new cjs.Bitmap(); p.nominalBounds = new cjs.Rectangle(0,0,116,344);

william.eyidi
  • 2,315
  • 4
  • 27
  • 39
Malfar
  • 9
  • 2

1 Answers1

2
  1. That is how you define arguments for a function
  2. That instantiates an instance of cjs.Rectangle, assigns it to the variable p, creates a function, assigns the value of p to the prototype property of the new function, then assigns the new function to the bot1_l property of whatever object lib_p points to.
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335