Browse Source

Docs: Rectangle.

Mr.doob 13 years ago
parent
commit
27fd7d3217
2 changed files with 35 additions and 8 deletions
  1. 33 6
      docs/api/core/Rectangle.html
  2. 2 2
      docs/index.html

+ 33 - 6
docs/api/core/Rectangle.html

@@ -1,6 +1,6 @@
 <h1>[name]</h1>
 
-<div class="desc">Represents a 2D rectangle.</div>
+<div class="desc">2D rectangle. Used by [page:CanvasRenderer] for 2D clipping.</div>
 
 
 <h2>Constructor</h2>
@@ -8,18 +8,45 @@
 <h3>[name]()</h3>
 
 
-<h2>Properties</h2>
+<h2>Methods</h2>
 
-<h3>.[page:Vector3 todo]</h3>
+<h3>.getX() [page:Float]</h3>
 
+<h3>.getY() [page:Float]</h3>
 
-<h2>Methods</h2>
+<h3>.getWidth() [page:Float]</h3>
+
+<h3>.getHeight() [page:Float]</h3>
+
+<h3>.getLeft() [page:Float]</h3>
+
+<h3>.getTop() [page:Float]</h3>
+
+<h3>.getRight() [page:Float]</h3>
+
+<h3>.getBottom() [page:Float]</h3>
+
+<h3>.set( [page:Float left], [page:Float top], [page:Float right], [page:Float bottom] )</h3>
 
-<h3>.todo( [page:Vector3 todo] )</h3>
+<h3>.addPoint( [page:Float x], [page:Float y] )</h3>
+
+<h3>.add3Points( [page:Float x1], [page:Float y1], [page:Float x2], [page:Float y2], [page:Float x3], [page:Float y3] )</h3>
+
+<h3>.addRectangle( [page:Rectangle r] )</h3>
+
+<h3>.inflate( [page:Float v] )</h3>
+
+<h3>.minSelf( [page:Rectangle r] )</h3>
+
+<h3>.intersects( [page:Rectangle r] ) [page:Boolean]</h3>
 <div>
-todo — todo<br />
+Adapted from [link:http://gamemath.com/2011/09/detecting-whether-two-boxes-overlap/].
 </div>
 
+<h3>.empty()</h3>
+
+<h3>.isEmpty() [page:Boolean]</h3>
+
 
 <h2>Source</h2>
 

+ 2 - 2
docs/index.html

@@ -352,8 +352,8 @@
 						text = text.replace(/\[path\]/gi, path);
 						text = text.replace(/\[page:(\w+)\]/gi, "<a href=\"javascript:goTo('$1')\" title=\"$1\">$1</a>" ); // [page:name]
 						text = text.replace(/\[page:(\w+) ([\w|\.]+)\]/gi, "<a href=\"javascript:goTo('$1')\" title=\"$1\">$2</a>" ); // [page:name title]
-						text = text.replace(/\[link:([\w|\:|\/|\.]+)\]/gi, "<a href=\"$1\" target=\"_blank\">$1</a>" ); // [link:url]
-						text = text.replace(/\[link:([\w|\:|\/|\.]+) ([\w|\/|\.]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
+						text = text.replace(/\[link:([\w|\:|\/|\.|\-]+)\]/gi, "<a href=\"$1\" target=\"_blank\">$1</a>" ); // [link:url]
+						text = text.replace(/\[link:([\w|\:|\/|\.|\-]+) ([\w|\/|\.|\-]+)\]/gi, "<a href=\"$1\"  target=\"_blank\">$2</a>" ); // [link:url title]
 						text = text.replace(/\*([\w|\ |\-|\/]+)\*/gi, "<strong>$1</strong>" ); // *
 
 						viewer.innerHTML = '<br>' + text + '<br><br>';