libraries/EaselJS_docs/classes/Rectangle.html (view raw)
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="utf-8">
5 <link rel="stylesheet" href="../assets/css/yui-cssgrids-min.css">
6 <link rel="stylesheet" href="../assets/vendor/prettify/prettify-min.css">
7 <link rel="stylesheet" href="../assets/css/main.css" id="site_styles">
8 <link rel="shortcut icon" type="image/x-icon" href="../assets/favicon.ico">
9 <script src="../assets/js/yui-source.js"></script>
10 <title>EaselJS v1.0.0 API Documentation : Rectangle</title>
11</head>
12<body class="yui3-skin-sam">
13
14<div id="doc">
15 <div id="hd" class="yui3-g header">
16 <div class="yui3-u-3-4">
17
18 <h1><a href="http://www.createjs.com/easeljs"><img src="../assets/docs-icon-EaselJS.png" title="EaselJS"></a></h1>
19
20 </div>
21 <div class="version">
22 <em>API Documentation for: 1.0.0</em>
23 </div>
24 </div>
25 <div id="bd" class="yui3-g">
26
27 <div class="yui3-u-1-4">
28 <div id="docs-sidebar" class="sidebar apidocs">
29 <div id="api-list">
30 <h2 class="off-left">APIs</h2>
31 <div id="api-tabview" class="tabview">
32 <ul class="tabs">
33 <li><a href="#api-classes">Classes</a></li>
34 </ul>
35
36 <div id="api-tabview-filter">
37 <input type="search" id="api-filter" placeholder="Type to filter APIs">
38 </div>
39
40 <div id="api-tabview-panel">
41 <ul id="api-classes" class="apis classes">
42
43 <li><a href="../classes/AlphaMapFilter.html">AlphaMapFilter</a></li>
44
45 <li><a href="../classes/AlphaMaskFilter.html">AlphaMaskFilter</a></li>
46
47 <li><a href="../classes/Bitmap.html">Bitmap</a></li>
48
49 <li><a href="../classes/BitmapCache.html">BitmapCache</a></li>
50
51 <li><a href="../classes/BitmapText.html">BitmapText</a></li>
52
53 <li><a href="../classes/BlurFilter.html">BlurFilter</a></li>
54
55 <li><a href="../classes/ButtonHelper.html">ButtonHelper</a></li>
56
57 <li><a href="../classes/ColorFilter.html">ColorFilter</a></li>
58
59 <li><a href="../classes/ColorMatrix.html">ColorMatrix</a></li>
60
61 <li><a href="../classes/ColorMatrixFilter.html">ColorMatrixFilter</a></li>
62
63 <li><a href="../classes/Container.html">Container</a></li>
64
65 <li><a href="../classes/DisplayObject.html">DisplayObject</a></li>
66
67 <li><a href="../classes/DisplayProps.html">DisplayProps</a></li>
68
69 <li><a href="../classes/DOMElement.html">DOMElement</a></li>
70
71 <li><a href="../classes/EaselJS.html">EaselJS</a></li>
72
73 <li><a href="../classes/Event.html">Event</a></li>
74
75 <li><a href="../classes/EventDispatcher.html">EventDispatcher</a></li>
76
77 <li><a href="../classes/Filter.html">Filter</a></li>
78
79 <li><a href="../classes/Graphics.html">Graphics</a></li>
80
81 <li><a href="../classes/Graphics.Arc.html">Graphics.Arc</a></li>
82
83 <li><a href="../classes/Graphics.ArcTo.html">Graphics.ArcTo</a></li>
84
85 <li><a href="../classes/Graphics.BeginPath.html">Graphics.BeginPath</a></li>
86
87 <li><a href="../classes/Graphics.BezierCurveTo.html">Graphics.BezierCurveTo</a></li>
88
89 <li><a href="../classes/Graphics.Circle.html">Graphics.Circle</a></li>
90
91 <li><a href="../classes/Graphics.ClosePath.html">Graphics.ClosePath</a></li>
92
93 <li><a href="../classes/Graphics.Ellipse.html">Graphics.Ellipse</a></li>
94
95 <li><a href="../classes/Graphics.Fill.html">Graphics.Fill</a></li>
96
97 <li><a href="../classes/Graphics.LineTo.html">Graphics.LineTo</a></li>
98
99 <li><a href="../classes/Graphics.MoveTo.html">Graphics.MoveTo</a></li>
100
101 <li><a href="../classes/Graphics.PolyStar.html">Graphics.PolyStar</a></li>
102
103 <li><a href="../classes/Graphics.QuadraticCurveTo.html">Graphics.QuadraticCurveTo</a></li>
104
105 <li><a href="../classes/Graphics.Rect.html">Graphics.Rect</a></li>
106
107 <li><a href="../classes/Graphics.RoundRect.html">Graphics.RoundRect</a></li>
108
109 <li><a href="../classes/Graphics.Stroke.html">Graphics.Stroke</a></li>
110
111 <li><a href="../classes/Graphics.StrokeDash.html">Graphics.StrokeDash</a></li>
112
113 <li><a href="../classes/Graphics.StrokeStyle.html">Graphics.StrokeStyle</a></li>
114
115 <li><a href="../classes/Matrix2D.html">Matrix2D</a></li>
116
117 <li><a href="../classes/MouseEvent.html">MouseEvent</a></li>
118
119 <li><a href="../classes/MovieClip.html">MovieClip</a></li>
120
121 <li><a href="../classes/MovieClipPlugin.html">MovieClipPlugin</a></li>
122
123 <li><a href="../classes/Point.html">Point</a></li>
124
125 <li><a href="../classes/Rectangle.html">Rectangle</a></li>
126
127 <li><a href="../classes/Shadow.html">Shadow</a></li>
128
129 <li><a href="../classes/Shape.html">Shape</a></li>
130
131 <li><a href="../classes/Sprite.html">Sprite</a></li>
132
133 <li><a href="../classes/SpriteSheet.html">SpriteSheet</a></li>
134
135 <li><a href="../classes/SpriteSheetBuilder.html">SpriteSheetBuilder</a></li>
136
137 <li><a href="../classes/SpriteSheetUtils.html">SpriteSheetUtils</a></li>
138
139 <li><a href="../classes/Stage.html">Stage</a></li>
140
141 <li><a href="../classes/StageGL.html">StageGL</a></li>
142
143 <li><a href="../classes/Text.html">Text</a></li>
144
145 <li><a href="../classes/Ticker.html">Ticker</a></li>
146
147 <li><a href="../classes/Touch.html">Touch</a></li>
148
149 <li><a href="../classes/UID.html">UID</a></li>
150
151 <li><a href="../classes/Utility Methods.html">Utility Methods</a></li>
152
153 <li><a href="../classes/VideoBuffer.html">VideoBuffer</a></li>
154
155 <li><a href="../classes/WebGLInspector.html">WebGLInspector</a></li>
156
157 </ul>
158
159 <ul id="api-modules" class="apis modules">
160
161 <li><a href="../modules/CreateJS.html">CreateJS</a></li>
162
163 <li><a href="../modules/EaselJS.html">EaselJS</a></li>
164
165 </ul>
166 </div>
167 </div>
168</div>
169
170 </div>
171 </div>
172 <div class="yui3-u-3-4">
173 <div id="api-options">
174 Show:
175 <label for="api-show-inherited">
176 <input type="checkbox" id="api-show-inherited" checked>
177 Inherited
178 </label>
179
180 <label for="api-show-protected">
181 <input type="checkbox" id="api-show-protected">
182 Protected
183 </label>
184
185 <label for="api-show-private">
186 <input type="checkbox" id="api-show-private">
187 Private
188 </label>
189 <label for="api-show-deprecated">
190 <input type="checkbox" id="api-show-deprecated">
191 Deprecated
192 </label>
193
194 </div>
195 <div class="apidocs">
196 <div id="docs-main">
197 <div class="content">
198 <h1>Rectangle Class</h1>
199<div class="box meta">
200
201
202
203
204
205 <div class="foundat">
206 Defined in: <a href="../files/easeljs_geom_Rectangle.js.html#l41"><code>Rectangle:41</code></a>
207 </div>
208
209
210
211
212 Module: <a href="../modules/EaselJS.html">EaselJS</a>
213
214
215
216
217</div>
218
219
220
221<div class="box intro">
222 <p>Represents a rectangle as defined by the points (x, y) and (x+width, y+height).</p>
223<h4>Example</h4>
224
225<pre class="code prettyprint"><code> var rect = new createjs.Rectangle(0, 0, 100, 100);</code></pre>
226
227</div>
228
229
230 <div class="constructor">
231 <h2>Constructor</h2>
232 <div id="method_Rectangle" class="method item">
233 <h3 class="name"><code>Rectangle</code></h3>
234
235
236 <div class="args">
237 <span class="paren">(</span><ul class="args-list inline commas">
238
239 <li class="arg">
240
241 <code class="optional">[x=0]</code>
242
243 </li>
244
245 <li class="arg">
246
247 <code class="optional">[y=0]</code>
248
249 </li>
250
251 <li class="arg">
252
253 <code class="optional">[width=0]</code>
254
255 </li>
256
257 <li class="arg">
258
259 <code class="optional">[height=0]</code>
260
261 </li>
262
263 </ul><span class="paren">)</span>
264 </div>
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281 <div class="meta">
282
283
284
285 <p>
286
287 Defined in
288
289
290
291
292 <a href="../files/easeljs_geom_Rectangle.js.html#l41"><code>Rectangle:41</code></a>
293
294 </p>
295
296
297
298
299
300 </div>
301
302 <div class="description">
303
304 </div>
305
306
307 <div class="params">
308 <h4>Parameters:</h4>
309
310 <ul class="params-list">
311
312 <li class="param">
313
314 <code class="param-name optional">[x=0]</code>
315 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
316 <span class="flag optional" title="This parameter is optional.">optional</span>
317
318
319
320
321 <div class="param-description">
322 <p>X position.</p>
323
324 </div>
325
326
327 </li>
328
329 <li class="param">
330
331 <code class="param-name optional">[y=0]</code>
332 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
333 <span class="flag optional" title="This parameter is optional.">optional</span>
334
335
336
337
338 <div class="param-description">
339 <p>Y position.</p>
340
341 </div>
342
343
344 </li>
345
346 <li class="param">
347
348 <code class="param-name optional">[width=0]</code>
349 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
350 <span class="flag optional" title="This parameter is optional.">optional</span>
351
352
353
354
355 <div class="param-description">
356 <p>The width of the Rectangle.</p>
357
358 </div>
359
360
361 </li>
362
363 <li class="param">
364
365 <code class="param-name optional">[height=0]</code>
366 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
367 <span class="flag optional" title="This parameter is optional.">optional</span>
368
369
370
371
372 <div class="param-description">
373 <p>The height of the Rectangle.</p>
374
375 </div>
376
377
378 </li>
379
380 </ul>
381 </div>
382
383
384
385
386
387</div>
388
389 </div>
390
391
392<div id="classdocs" class="tabview">
393 <ul class="api-class-tabs">
394 <li class="api-class-tab index"><a href="#index">Index</a></li>
395
396
397 <li class="api-class-tab methods"><a href="#methods">Methods</a></li>
398
399
400 <li class="api-class-tab properties"><a href="#properties">Properties</a></li>
401
402
403
404 </ul>
405
406 <div>
407 <div id="index" class="api-class-tabpanel index">
408 <h2 class="off-left">Item Index</h2>
409
410
411 <div class="index-section methods">
412 <h3>Methods</h3>
413
414 <ul class="index-list methods">
415
416 <li class="index-item method">
417 <a href="#method_clone">clone</a>
418
419
420
421 </li>
422
423 <li class="index-item method">
424 <a href="#method_contains">contains</a>
425
426
427
428 </li>
429
430 <li class="index-item method">
431 <a href="#method_copy">copy</a>
432
433
434
435 </li>
436
437 <li class="index-item method">
438 <a href="#method_extend">extend</a>
439
440
441
442 </li>
443
444 <li class="index-item method">
445 <a href="#method_intersection">intersection</a>
446
447
448
449 </li>
450
451 <li class="index-item method">
452 <a href="#method_intersects">intersects</a>
453
454
455
456 </li>
457
458 <li class="index-item method">
459 <a href="#method_isEmpty">isEmpty</a>
460
461
462
463 </li>
464
465 <li class="index-item method">
466 <a href="#method_pad">pad</a>
467
468
469
470 </li>
471
472 <li class="index-item method">
473 <a href="#method_setValues">setValues</a>
474
475
476
477 </li>
478
479 <li class="index-item method">
480 <a href="#method_toString">toString</a>
481
482
483
484 </li>
485
486 <li class="index-item method">
487 <a href="#method_union">union</a>
488
489
490
491 </li>
492
493 </ul>
494 </div>
495
496
497
498 <div class="index-section properties">
499 <h3>Properties</h3>
500
501 <ul class="index-list properties">
502
503 <li class="index-item property">
504 <a href="#property_height">height</a>
505
506
507
508 </li>
509
510 <li class="index-item property">
511 <a href="#property_width">width</a>
512
513
514
515 </li>
516
517 <li class="index-item property">
518 <a href="#property_x">x</a>
519
520
521
522 </li>
523
524 <li class="index-item property">
525 <a href="#property_y">y</a>
526
527
528
529 </li>
530
531 </ul>
532 </div>
533
534
535
536
537
538 </div>
539
540
541 <div id="methods" class="api-class-tabpanel">
542 <h2 class="off-left">Methods</h2>
543
544
545 <div id="method_clone" class="method item">
546 <h3 class="name"><code>clone</code></h3>
547
548
549 <span class="paren">()</span>
550
551
552
553 <span class="returns-inline">
554 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
555 </span>
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570 <div class="meta">
571
572
573
574 <p>
575
576 Defined in
577
578
579
580
581 <a href="../files/easeljs_geom_Rectangle.js.html#l216"><code>clone:216</code></a>
582
583 </p>
584
585
586
587
588
589 </div>
590
591 <div class="description">
592 <p>Returns a clone of the Rectangle instance.</p>
593
594 </div>
595
596
597
598
599 <div class="returns">
600 <h4>Returns:</h4>
601
602 <div class="returns-description">
603
604
605 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
606
607 <p>a clone of the Rectangle instance.</p>
608
609
610 </div>
611 </div>
612
613
614
615</div>
616
617
618 <div id="method_contains" class="method item">
619 <h3 class="name"><code>contains</code></h3>
620
621
622 <div class="args">
623 <span class="paren">(</span><ul class="args-list inline commas">
624
625 <li class="arg">
626
627 <code>x</code>
628
629 </li>
630
631 <li class="arg">
632
633 <code>y</code>
634
635 </li>
636
637 <li class="arg">
638
639 <code class="optional">[width=0]</code>
640
641 </li>
642
643 <li class="arg">
644
645 <code class="optional">[height=0]</code>
646
647 </li>
648
649 </ul><span class="paren">)</span>
650 </div>
651
652
653
654 <span class="returns-inline">
655 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
656 </span>
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671 <div class="meta">
672
673
674
675 <p>
676
677 Defined in
678
679
680
681
682 <a href="../files/easeljs_geom_Rectangle.js.html#l156"><code>contains:156</code></a>
683
684 </p>
685
686
687
688
689
690 </div>
691
692 <div class="description">
693 <p>Returns true if this rectangle fully encloses the described point or rectangle.</p>
694
695 </div>
696
697
698 <div class="params">
699 <h4>Parameters:</h4>
700
701 <ul class="params-list">
702
703 <li class="param">
704
705 <code class="param-name">x</code>
706 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
707
708
709
710
711 <div class="param-description">
712 <p>X position of the point or rectangle.</p>
713
714 </div>
715
716
717 </li>
718
719 <li class="param">
720
721 <code class="param-name">y</code>
722 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
723
724
725
726
727 <div class="param-description">
728 <p>Y position of the point or rectangle.</p>
729
730 </div>
731
732
733 </li>
734
735 <li class="param">
736
737 <code class="param-name optional">[width=0]</code>
738 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
739 <span class="flag optional" title="This parameter is optional.">optional</span>
740
741
742
743
744 <div class="param-description">
745 <p>The width of the rectangle.</p>
746
747 </div>
748
749
750 </li>
751
752 <li class="param">
753
754 <code class="param-name optional">[height=0]</code>
755 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
756 <span class="flag optional" title="This parameter is optional.">optional</span>
757
758
759
760
761 <div class="param-description">
762 <p>The height of the rectangle.</p>
763
764 </div>
765
766
767 </li>
768
769 </ul>
770 </div>
771
772
773
774 <div class="returns">
775 <h4>Returns:</h4>
776
777 <div class="returns-description">
778
779
780 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
781
782 <p>True if the described point or rectangle is contained within this rectangle.</p>
783
784
785 </div>
786 </div>
787
788
789
790</div>
791
792
793 <div id="method_copy" class="method item">
794 <h3 class="name"><code>copy</code></h3>
795
796
797 <div class="args">
798 <span class="paren">(</span><ul class="args-list inline commas">
799
800 <li class="arg">
801
802 <code>rectangle</code>
803
804 </li>
805
806 </ul><span class="paren">)</span>
807 </div>
808
809
810
811 <span class="returns-inline">
812 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
813 </span>
814
815
816
817
818
819
820
821
822
823
824
825 <span class="flag chainable">chainable</span>
826
827
828
829
830 <div class="meta">
831
832
833
834 <p>
835
836 Defined in
837
838
839
840
841 <a href="../files/easeljs_geom_Rectangle.js.html#l145"><code>copy:145</code></a>
842
843 </p>
844
845
846
847
848
849 </div>
850
851 <div class="description">
852 <p>Copies all properties from the specified rectangle to this rectangle.</p>
853
854 </div>
855
856
857 <div class="params">
858 <h4>Parameters:</h4>
859
860 <ul class="params-list">
861
862 <li class="param">
863
864 <code class="param-name">rectangle</code>
865 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
866
867
868
869
870 <div class="param-description">
871 <p>The rectangle to copy properties from.</p>
872
873 </div>
874
875
876 </li>
877
878 </ul>
879 </div>
880
881
882
883 <div class="returns">
884 <h4>Returns:</h4>
885
886 <div class="returns-description">
887
888
889 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
890
891 <p>This rectangle. Useful for chaining method calls.</p>
892
893
894 </div>
895 </div>
896
897
898
899</div>
900
901
902 <div id="method_extend" class="method item">
903 <h3 class="name"><code>extend</code></h3>
904
905
906 <div class="args">
907 <span class="paren">(</span><ul class="args-list inline commas">
908
909 <li class="arg">
910
911 <code>x</code>
912
913 </li>
914
915 <li class="arg">
916
917 <code>y</code>
918
919 </li>
920
921 <li class="arg">
922
923 <code class="optional">[width=0]</code>
924
925 </li>
926
927 <li class="arg">
928
929 <code class="optional">[height=0]</code>
930
931 </li>
932
933 </ul><span class="paren">)</span>
934 </div>
935
936
937
938 <span class="returns-inline">
939 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
940 </span>
941
942
943
944
945
946
947
948
949
950
951
952 <span class="flag chainable">chainable</span>
953
954
955
956
957 <div class="meta">
958
959
960
961 <p>
962
963 Defined in
964
965
966
967
968 <a href="../files/easeljs_geom_Rectangle.js.html#l107"><code>extend:107</code></a>
969
970 </p>
971
972
973
974
975
976 </div>
977
978 <div class="description">
979 <p>Extends the rectangle's bounds to include the described point or rectangle.</p>
980
981 </div>
982
983
984 <div class="params">
985 <h4>Parameters:</h4>
986
987 <ul class="params-list">
988
989 <li class="param">
990
991 <code class="param-name">x</code>
992 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
993
994
995
996
997 <div class="param-description">
998 <p>X position of the point or rectangle.</p>
999
1000 </div>
1001
1002
1003 </li>
1004
1005 <li class="param">
1006
1007 <code class="param-name">y</code>
1008 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1009
1010
1011
1012
1013 <div class="param-description">
1014 <p>Y position of the point or rectangle.</p>
1015
1016 </div>
1017
1018
1019 </li>
1020
1021 <li class="param">
1022
1023 <code class="param-name optional">[width=0]</code>
1024 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1025 <span class="flag optional" title="This parameter is optional.">optional</span>
1026
1027
1028
1029
1030 <div class="param-description">
1031 <p>The width of the rectangle.</p>
1032
1033 </div>
1034
1035
1036 </li>
1037
1038 <li class="param">
1039
1040 <code class="param-name optional">[height=0]</code>
1041 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1042 <span class="flag optional" title="This parameter is optional.">optional</span>
1043
1044
1045
1046
1047 <div class="param-description">
1048 <p>The height of the rectangle.</p>
1049
1050 </div>
1051
1052
1053 </li>
1054
1055 </ul>
1056 </div>
1057
1058
1059
1060 <div class="returns">
1061 <h4>Returns:</h4>
1062
1063 <div class="returns-description">
1064
1065
1066 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1067
1068 <p>This instance. Useful for chaining method calls.</p>
1069
1070
1071 </div>
1072 </div>
1073
1074
1075
1076</div>
1077
1078
1079 <div id="method_intersection" class="method item">
1080 <h3 class="name"><code>intersection</code></h3>
1081
1082
1083 <div class="args">
1084 <span class="paren">(</span><ul class="args-list inline commas">
1085
1086 <li class="arg">
1087
1088 <code>rect</code>
1089
1090 </li>
1091
1092 </ul><span class="paren">)</span>
1093 </div>
1094
1095
1096
1097 <span class="returns-inline">
1098 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1099 </span>
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114 <div class="meta">
1115
1116
1117
1118 <p>
1119
1120 Defined in
1121
1122
1123
1124
1125 <a href="../files/easeljs_geom_Rectangle.js.html#l181"><code>intersection:181</code></a>
1126
1127 </p>
1128
1129
1130
1131
1132
1133 </div>
1134
1135 <div class="description">
1136 <p>Returns a new rectangle which describes the intersection (overlap) of this rectangle and the specified rectangle,
1137or null if they do not intersect.</p>
1138
1139 </div>
1140
1141
1142 <div class="params">
1143 <h4>Parameters:</h4>
1144
1145 <ul class="params-list">
1146
1147 <li class="param">
1148
1149 <code class="param-name">rect</code>
1150 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1151
1152
1153
1154
1155 <div class="param-description">
1156 <p>The rectangle to calculate an intersection with.</p>
1157
1158 </div>
1159
1160
1161 </li>
1162
1163 </ul>
1164 </div>
1165
1166
1167
1168 <div class="returns">
1169 <h4>Returns:</h4>
1170
1171 <div class="returns-description">
1172
1173
1174 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1175
1176 <p>A new rectangle describing the intersection or null.</p>
1177
1178
1179 </div>
1180 </div>
1181
1182
1183
1184</div>
1185
1186
1187 <div id="method_intersects" class="method item">
1188 <h3 class="name"><code>intersects</code></h3>
1189
1190
1191 <div class="args">
1192 <span class="paren">(</span><ul class="args-list inline commas">
1193
1194 <li class="arg">
1195
1196 <code>rect</code>
1197
1198 </li>
1199
1200 </ul><span class="paren">)</span>
1201 </div>
1202
1203
1204
1205 <span class="returns-inline">
1206 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1207 </span>
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222 <div class="meta">
1223
1224
1225
1226 <p>
1227
1228 Defined in
1229
1230
1231
1232
1233 <a href="../files/easeljs_geom_Rectangle.js.html#l197"><code>intersects:197</code></a>
1234
1235 </p>
1236
1237
1238
1239
1240
1241 </div>
1242
1243 <div class="description">
1244 <p>Returns true if the specified rectangle intersects (has any overlap) with this rectangle.</p>
1245
1246 </div>
1247
1248
1249 <div class="params">
1250 <h4>Parameters:</h4>
1251
1252 <ul class="params-list">
1253
1254 <li class="param">
1255
1256 <code class="param-name">rect</code>
1257 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1258
1259
1260
1261
1262 <div class="param-description">
1263 <p>The rectangle to compare.</p>
1264
1265 </div>
1266
1267
1268 </li>
1269
1270 </ul>
1271 </div>
1272
1273
1274
1275 <div class="returns">
1276 <h4>Returns:</h4>
1277
1278 <div class="returns-description">
1279
1280
1281 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
1282
1283 <p>True if the rectangles intersect.</p>
1284
1285
1286 </div>
1287 </div>
1288
1289
1290
1291</div>
1292
1293
1294 <div id="method_isEmpty" class="method item">
1295 <h3 class="name"><code>isEmpty</code></h3>
1296
1297
1298 <span class="paren">()</span>
1299
1300
1301
1302 <span class="returns-inline">
1303 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>
1304 </span>
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319 <div class="meta">
1320
1321
1322
1323 <p>
1324
1325 Defined in
1326
1327
1328
1329
1330 <a href="../files/easeljs_geom_Rectangle.js.html#l207"><code>isEmpty:207</code></a>
1331
1332 </p>
1333
1334
1335
1336
1337
1338 </div>
1339
1340 <div class="description">
1341 <p>Returns true if the width or height are equal or less than 0.</p>
1342
1343 </div>
1344
1345
1346
1347
1348 <div class="returns">
1349 <h4>Returns:</h4>
1350
1351 <div class="returns-description">
1352
1353
1354 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Boolean" class="crosslink external" target="_blank">Boolean</a></span>:
1355
1356 <p>True if the rectangle is empty.</p>
1357
1358
1359 </div>
1360 </div>
1361
1362
1363
1364</div>
1365
1366
1367 <div id="method_pad" class="method item">
1368 <h3 class="name"><code>pad</code></h3>
1369
1370
1371 <div class="args">
1372 <span class="paren">(</span><ul class="args-list inline commas">
1373
1374 <li class="arg">
1375
1376 <code>top</code>
1377
1378 </li>
1379
1380 <li class="arg">
1381
1382 <code>left</code>
1383
1384 </li>
1385
1386 <li class="arg">
1387
1388 <code>bottom</code>
1389
1390 </li>
1391
1392 <li class="arg">
1393
1394 <code>right</code>
1395
1396 </li>
1397
1398 </ul><span class="paren">)</span>
1399 </div>
1400
1401
1402
1403 <span class="returns-inline">
1404 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1405 </span>
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417 <span class="flag chainable">chainable</span>
1418
1419
1420
1421
1422 <div class="meta">
1423
1424
1425
1426 <p>
1427
1428 Defined in
1429
1430
1431
1432
1433 <a href="../files/easeljs_geom_Rectangle.js.html#l127"><code>pad:127</code></a>
1434
1435 </p>
1436
1437
1438
1439
1440
1441 </div>
1442
1443 <div class="description">
1444 <p>Adds the specified padding to the rectangle's bounds.</p>
1445
1446 </div>
1447
1448
1449 <div class="params">
1450 <h4>Parameters:</h4>
1451
1452 <ul class="params-list">
1453
1454 <li class="param">
1455
1456 <code class="param-name">top</code>
1457 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1458
1459
1460
1461
1462 <div class="param-description">
1463
1464 </div>
1465
1466
1467 </li>
1468
1469 <li class="param">
1470
1471 <code class="param-name">left</code>
1472 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1473
1474
1475
1476
1477 <div class="param-description">
1478
1479 </div>
1480
1481
1482 </li>
1483
1484 <li class="param">
1485
1486 <code class="param-name">bottom</code>
1487 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1488
1489
1490
1491
1492 <div class="param-description">
1493
1494 </div>
1495
1496
1497 </li>
1498
1499 <li class="param">
1500
1501 <code class="param-name">right</code>
1502 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1503
1504
1505
1506
1507 <div class="param-description">
1508
1509 </div>
1510
1511
1512 </li>
1513
1514 </ul>
1515 </div>
1516
1517
1518
1519 <div class="returns">
1520 <h4>Returns:</h4>
1521
1522 <div class="returns-description">
1523
1524
1525 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1526
1527 <p>This instance. Useful for chaining method calls.</p>
1528
1529
1530 </div>
1531 </div>
1532
1533
1534
1535</div>
1536
1537
1538 <div id="method_setValues" class="method item">
1539 <h3 class="name"><code>setValues</code></h3>
1540
1541
1542 <div class="args">
1543 <span class="paren">(</span><ul class="args-list inline commas">
1544
1545 <li class="arg">
1546
1547 <code class="optional">[x=0]</code>
1548
1549 </li>
1550
1551 <li class="arg">
1552
1553 <code class="optional">[y=0]</code>
1554
1555 </li>
1556
1557 <li class="arg">
1558
1559 <code class="optional">[width=0]</code>
1560
1561 </li>
1562
1563 <li class="arg">
1564
1565 <code class="optional">[height=0]</code>
1566
1567 </li>
1568
1569 </ul><span class="paren">)</span>
1570 </div>
1571
1572
1573
1574 <span class="returns-inline">
1575 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1576 </span>
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588 <span class="flag chainable">chainable</span>
1589
1590
1591
1592
1593 <div class="meta">
1594
1595
1596
1597 <p>
1598
1599 Defined in
1600
1601
1602
1603
1604 <a href="../files/easeljs_geom_Rectangle.js.html#l88"><code>setValues:88</code></a>
1605
1606 </p>
1607
1608
1609
1610
1611
1612 </div>
1613
1614 <div class="description">
1615 <p>Sets the specified values on this instance.</p>
1616
1617 </div>
1618
1619
1620 <div class="params">
1621 <h4>Parameters:</h4>
1622
1623 <ul class="params-list">
1624
1625 <li class="param">
1626
1627 <code class="param-name optional">[x=0]</code>
1628 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1629 <span class="flag optional" title="This parameter is optional.">optional</span>
1630
1631
1632
1633
1634 <div class="param-description">
1635 <p>X position.</p>
1636
1637 </div>
1638
1639
1640 </li>
1641
1642 <li class="param">
1643
1644 <code class="param-name optional">[y=0]</code>
1645 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1646 <span class="flag optional" title="This parameter is optional.">optional</span>
1647
1648
1649
1650
1651 <div class="param-description">
1652 <p>Y position.</p>
1653
1654 </div>
1655
1656
1657 </li>
1658
1659 <li class="param">
1660
1661 <code class="param-name optional">[width=0]</code>
1662 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1663 <span class="flag optional" title="This parameter is optional.">optional</span>
1664
1665
1666
1667
1668 <div class="param-description">
1669 <p>The width of the Rectangle.</p>
1670
1671 </div>
1672
1673
1674 </li>
1675
1676 <li class="param">
1677
1678 <code class="param-name optional">[height=0]</code>
1679 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1680 <span class="flag optional" title="This parameter is optional.">optional</span>
1681
1682
1683
1684
1685 <div class="param-description">
1686 <p>The height of the Rectangle.</p>
1687
1688 </div>
1689
1690
1691 </li>
1692
1693 </ul>
1694 </div>
1695
1696
1697
1698 <div class="returns">
1699 <h4>Returns:</h4>
1700
1701 <div class="returns-description">
1702
1703
1704 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1705
1706 <p>This instance. Useful for chaining method calls.</p>
1707
1708
1709 </div>
1710 </div>
1711
1712
1713
1714</div>
1715
1716
1717 <div id="method_toString" class="method item">
1718 <h3 class="name"><code>toString</code></h3>
1719
1720
1721 <span class="paren">()</span>
1722
1723
1724
1725 <span class="returns-inline">
1726 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>
1727 </span>
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742 <div class="meta">
1743
1744
1745
1746 <p>
1747
1748 Defined in
1749
1750
1751
1752
1753 <a href="../files/easeljs_geom_Rectangle.js.html#l225"><code>toString:225</code></a>
1754
1755 </p>
1756
1757
1758
1759
1760
1761 </div>
1762
1763 <div class="description">
1764 <p>Returns a string representation of this object.</p>
1765
1766 </div>
1767
1768
1769
1770
1771 <div class="returns">
1772 <h4>Returns:</h4>
1773
1774 <div class="returns-description">
1775
1776
1777 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String" class="crosslink external" target="_blank">String</a></span>:
1778
1779 <p>a string representation of the instance.</p>
1780
1781
1782 </div>
1783 </div>
1784
1785
1786
1787</div>
1788
1789
1790 <div id="method_union" class="method item">
1791 <h3 class="name"><code>union</code></h3>
1792
1793
1794 <div class="args">
1795 <span class="paren">(</span><ul class="args-list inline commas">
1796
1797 <li class="arg">
1798
1799 <code>rect</code>
1800
1801 </li>
1802
1803 </ul><span class="paren">)</span>
1804 </div>
1805
1806
1807
1808 <span class="returns-inline">
1809 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1810 </span>
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825 <div class="meta">
1826
1827
1828
1829 <p>
1830
1831 Defined in
1832
1833
1834
1835
1836 <a href="../files/easeljs_geom_Rectangle.js.html#l171"><code>union:171</code></a>
1837
1838 </p>
1839
1840
1841
1842
1843
1844 </div>
1845
1846 <div class="description">
1847 <p>Returns a new rectangle which contains this rectangle and the specified rectangle.</p>
1848
1849 </div>
1850
1851
1852 <div class="params">
1853 <h4>Parameters:</h4>
1854
1855 <ul class="params-list">
1856
1857 <li class="param">
1858
1859 <code class="param-name">rect</code>
1860 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>
1861
1862
1863
1864
1865 <div class="param-description">
1866 <p>The rectangle to calculate a union with.</p>
1867
1868 </div>
1869
1870
1871 </li>
1872
1873 </ul>
1874 </div>
1875
1876
1877
1878 <div class="returns">
1879 <h4>Returns:</h4>
1880
1881 <div class="returns-description">
1882
1883
1884 <span class="type"><a href="../classes/Rectangle.html" class="crosslink">Rectangle</a></span>:
1885
1886 <p>A new rectangle describing the union.</p>
1887
1888
1889 </div>
1890 </div>
1891
1892
1893
1894</div>
1895
1896
1897 </div>
1898
1899
1900
1901 <div id="properties" class="api-class-tabpanel">
1902 <h2 class="off-left">Properties</h2>
1903
1904
1905 <div id="property_height" class="property item">
1906 <h3 class="name"><code>height</code></h3>
1907 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919 <div class="meta">
1920
1921
1922
1923 <p>
1924
1925 Defined in
1926
1927
1928
1929
1930 <a href="../files/easeljs_geom_Rectangle.js.html#l79"><code>height:79</code></a>
1931
1932 </p>
1933
1934
1935
1936
1937 </div>
1938
1939 <div class="description">
1940 <p>Height.</p>
1941
1942 </div>
1943
1944
1945
1946
1947
1948
1949</div>
1950
1951
1952 <div id="property_width" class="property item">
1953 <h3 class="name"><code>width</code></h3>
1954 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966 <div class="meta">
1967
1968
1969
1970 <p>
1971
1972 Defined in
1973
1974
1975
1976
1977 <a href="../files/easeljs_geom_Rectangle.js.html#l73"><code>width:73</code></a>
1978
1979 </p>
1980
1981
1982
1983
1984 </div>
1985
1986 <div class="description">
1987 <p>Width.</p>
1988
1989 </div>
1990
1991
1992
1993
1994
1995
1996</div>
1997
1998
1999 <div id="property_x" class="property item">
2000 <h3 class="name"><code>x</code></h3>
2001 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013 <div class="meta">
2014
2015
2016
2017 <p>
2018
2019 Defined in
2020
2021
2022
2023
2024 <a href="../files/easeljs_geom_Rectangle.js.html#l61"><code>x:61</code></a>
2025
2026 </p>
2027
2028
2029
2030
2031 </div>
2032
2033 <div class="description">
2034 <p>X position.</p>
2035
2036 </div>
2037
2038
2039
2040
2041
2042
2043</div>
2044
2045
2046 <div id="property_y" class="property item">
2047 <h3 class="name"><code>y</code></h3>
2048 <span class="type"><a href="https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Number" class="crosslink external" target="_blank">Number</a></span>
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060 <div class="meta">
2061
2062
2063
2064 <p>
2065
2066 Defined in
2067
2068
2069
2070
2071 <a href="../files/easeljs_geom_Rectangle.js.html#l67"><code>y:67</code></a>
2072
2073 </p>
2074
2075
2076
2077
2078 </div>
2079
2080 <div class="description">
2081 <p>Y position.</p>
2082
2083 </div>
2084
2085
2086
2087
2088
2089
2090</div>
2091
2092
2093 </div>
2094
2095
2096
2097
2098
2099 </div>
2100</div>
2101
2102 </div>
2103 </div>
2104 </div>
2105 </div>
2106 </div>
2107</div>
2108<script src="../assets/vendor/prettify/prettify-min.js"></script>
2109<script>prettyPrint();</script>
2110<script src="../assets/js/yui-prettify.js"></script>
2111<script src="../assets/../api.js"></script>
2112<script src="../assets/js/api-filter.js"></script>
2113<script src="../assets/js/api-list.js"></script>
2114<script src="../assets/js/api-search.js"></script>
2115<script src="../assets/js/apidocs.js"></script>
2116</body>
2117</html>