Skip to content

Commit

Permalink
Export document
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Dec 18, 2024
1 parent e3fcd92 commit 3ed7654
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 409 deletions.
3 changes: 3 additions & 0 deletions docs/site/board-miniboard/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10543,6 +10543,7 @@ <h4 id="add-chess">Add chess<a class="headerlink" href="#add-chess" title="Perma
<li>Scroll factor</li>
<li>Mask</li>
</ul>
<p>Bounds and origin will change after adding chess.</p>
<h4 id="remove-chess">Remove chess<a class="headerlink" href="#remove-chess" title="Permanent link">&para;</a></h4>
<ul>
<li>Remove chess object from board
Expand All @@ -10566,6 +10567,7 @@ <h4 id="remove-chess">Remove chess<a class="headerlink" href="#remove-chess" tit
</ul>
</li>
</ul>
<p>Bounds and origin will change after removing chess.</p>
<h3 id="set-origin">Set origin<a class="headerlink" href="#set-origin" title="Permanent link">&para;</a></h3>
<ul>
<li>Set origin tileXY by offset tileXY of all chess.
Expand All @@ -10588,6 +10590,7 @@ <h3 id="set-origin">Set origin<a class="headerlink" href="#set-origin" title="Pe
<div class="highlight"><pre><span></span><code><span class="nx">miniBoard</span><span class="p">.</span><span class="nx">setOrigin</span><span class="p">(</span><span class="s1">&#39;top-left&#39;</span><span class="p">);</span>
</code></pre></div></li>
</ul>
<p>Position of this miniboard will change</p>
<h3 id="get-all-chess">Get all chess<a class="headerlink" href="#get-all-chess" title="Permanent link">&para;</a></h3>
<div class="highlight"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">gameObjects</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">miniBoard</span><span class="p">.</span><span class="nx">getAllChess</span><span class="p">();</span>
<span class="c1">// var out = miniBoard.getAllChess(out);</span>
Expand Down
37 changes: 37 additions & 0 deletions docs/site/board/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9534,6 +9534,13 @@
Grid points
</a>

</li>

<li class="md-nav__item">
<a href="#boundary-points-around-tiles" class="md-nav__link">
Boundary points around tiles
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -10856,6 +10863,13 @@
Grid points
</a>

</li>

<li class="md-nav__item">
<a href="#boundary-points-around-tiles" class="md-nav__link">
Boundary points around tiles
</a>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -10938,6 +10952,7 @@ <h2 id="live-demos">Live demos<a class="headerlink" href="#live-demos" title="Pe
<li><a href="https://codepen.io/rexrainbow/pen/wLYmyw">Triangle to tileXY array</a></li>
<li><a href="https://codepen.io/rexrainbow/pen/LYYJmxE">Ellipse to tileXY array</a></li>
<li><a href="https://codepen.io/rexrainbow/pen/PoeZOGo">Bounds</a></li>
<li><a href="https://codepen.io/rexrainbow/pen/zxOoXPN">Boundary points</a></li>
</ul>
<h2 id="usage">Usage<a class="headerlink" href="#usage" title="Permanent link">&para;</a></h2>
<p><a href="https://github.com/rexrainbow/phaser3-rex-notes/tree/master/examples/board">Sample code</a></p>
Expand Down Expand Up @@ -12107,6 +12122,28 @@ <h3 id="grid-points">Grid points<a class="headerlink" href="#grid-points" title=
<div class="highlight"><pre><span></span><code><span class="nx">graphics</span><span class="p">.</span><span class="nx">strokePoints</span><span class="p">(</span><span class="nx">points</span><span class="p">,</span><span class="w"> </span><span class="kc">true</span><span class="p">);</span>
</code></pre></div></li>
</ul>
<h3 id="boundary-points-around-tiles">Boundary points around tiles<a class="headerlink" href="#boundary-points-around-tiles" title="Permanent link">&para;</a></h3>
<ul>
<li>Get boundary points around tiles
<div class="highlight"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">pointsAarray</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">board</span><span class="p">.</span><span class="nx">getBoundaryPoints</span><span class="p">(</span><span class="nx">tileXYArray</span><span class="p">);</span>
</code></pre></div>
or
<div class="highlight"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">pointsAarray</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">board</span><span class="p">.</span><span class="nx">getBoundaryPoints</span><span class="p">(</span><span class="nx">chessArray</span><span class="p">);</span>
</code></pre></div>
or
<div class="highlight"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">pointsAarray</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">board</span><span class="p">.</span><span class="nx">getBoundaryPoints</span><span class="p">(</span><span class="nx">tileZ</span><span class="p">);</span><span class="w"> </span><span class="c1">// All tiles on tileZ</span>
</code></pre></div>
or
<div class="highlight"><pre><span></span><code><span class="kd">var</span><span class="w"> </span><span class="nx">pointsAarray</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">board</span><span class="p">.</span><span class="nx">getBoundaryPoints</span><span class="p">();</span><span class="w"> </span><span class="c1">// All tileXY position</span>
</code></pre></div></li>
<li>Draw grid polygon on <a href="../graphics/#lines">graphics object</a>
<div class="highlight"><pre><span></span><code><span class="nx">pointsAarray</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span><span class="w"> </span><span class="p">(</span><span class="nx">points</span><span class="p">)</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nx">graphics</span>
<span class="w"> </span><span class="p">.</span><span class="nx">lineStyle</span><span class="p">(</span><span class="nx">lineWidth</span><span class="p">,</span><span class="w"> </span><span class="nx">color</span><span class="p">,</span><span class="w"> </span><span class="nx">alpha</span><span class="p">)</span>
<span class="w"> </span><span class="p">.</span><span class="nx">strokePoints</span><span class="p">(</span><span class="nx">points</span><span class="p">,</span><span class="w"> </span><span class="kc">true</span><span class="p">);</span>
<span class="p">})</span>
</code></pre></div></li>
</ul>
<h3 id="bounds">Bounds<a class="headerlink" href="#bounds" title="Permanent link">&para;</a></h3>
<h4 id="board-bounds">Board bounds<a class="headerlink" href="#board-bounds" title="Permanent link">&para;</a></h4>
<ul>
Expand Down
6 changes: 6 additions & 0 deletions docs/site/gameobject/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10621,6 +10621,12 @@ <h3 id="bounds">Bounds<a class="headerlink" href="#bounds" title="Permanent link
<span class="kd">var</span><span class="w"> </span><span class="nx">output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">gameObject</span><span class="p">.</span><span class="nx">getCenter</span><span class="p">(</span><span class="nx">output</span><span class="p">);</span><span class="w"> </span><span class="c1">// output: {x, y}</span>
<span class="kd">var</span><span class="w"> </span><span class="nx">output</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="nx">gameObject</span><span class="p">.</span><span class="nx">getBounds</span><span class="p">(</span><span class="nx">output</span><span class="p">);</span><span class="w"> </span><span class="c1">// output: {x, y, width, height}</span>
</code></pre></div>
<p>Draw bounds on <a href="../graphics/">graphics</a></p>
<div class="highlight"><pre><span></span><code><span class="c1">// var graphics = scene.add.graphics();</span>
<span class="nx">graphics</span>
<span class="w"> </span><span class="p">.</span><span class="nx">lineStyle</span><span class="p">(</span><span class="nx">lineWidth</span><span class="p">,</span><span class="w"> </span><span class="nx">color</span><span class="p">,</span><span class="w"> </span><span class="nx">alpha</span><span class="p">)</span>
<span class="w"> </span><span class="p">.</span><span class="nx">strokeRectShape</span><span class="p">(</span><span class="nx">gameObject</span><span class="p">.</span><span class="nx">getBounds</span><span class="p">());</span>
</code></pre></div>
<h3 id="origin">Origin<a class="headerlink" href="#origin" title="Permanent link">&para;</a></h3>
<ul>
<li>Get
Expand Down
2 changes: 1 addition & 1 deletion docs/site/search/search_index.json

Large diffs are not rendered by default.

Loading

0 comments on commit 3ed7654

Please sign in to comment.