Skip to content

Commit

Permalink
Update description
Browse files Browse the repository at this point in the history
  • Loading branch information
rexrainbow committed Aug 23, 2023
1 parent b12b0e7 commit 762485c
Show file tree
Hide file tree
Showing 5 changed files with 74 additions and 9 deletions.
20 changes: 18 additions & 2 deletions docs/docs/containerlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ scene.tweens.add(tweenConfig);
container.sendChildToBack(gameObject);
```

### Layer
### Render layer

A containerLite can have a [layer](layer.md).
Current children and new children will draw on this layer, instead of display list of scene.
Expand Down Expand Up @@ -607,7 +607,7 @@ Current children and new children will draw on this layer, instead of display li

### Shader effects

Apply post-fx pipeline on [layer of containerLite](containerlite.md#layer).
Apply post-fx pipeline on [layer of containerLite](containerlite.md#render-layer).

### Snapshot

Expand Down Expand Up @@ -692,6 +692,22 @@ This method also will reset all local state of children.
```
- `layer` : [Layer](layer.md) game object.

#### Remove from container

- Remove from [built-in container](container.md)
```javascript
containerLite.removeFromContainer(p3Container);
```
or
```javascript
p3Container.remove(containerLite);
```
- `p3Container` : [Container](container.md) game object.
- Remove from [Layer](layer.md)
```javascript
container.removeFromLayer(layer);
```
- `layer` : [Layer](layer.md) game object.

### Other properties

Expand Down
56 changes: 50 additions & 6 deletions docs/site/containerlite/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2758,8 +2758,8 @@
</li>

<li class="md-nav__item">
<a href="#layer" class="md-nav__link">
Layer
<a href="#render-layer" class="md-nav__link">
Render layer
</a>

</li>
Expand Down Expand Up @@ -2811,6 +2811,19 @@
Add to container
</a>

<nav class="md-nav" aria-label="Add to container">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#remove-from-container" class="md-nav__link">
Remove from container
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -9950,8 +9963,8 @@
</li>

<li class="md-nav__item">
<a href="#layer" class="md-nav__link">
Layer
<a href="#render-layer" class="md-nav__link">
Render layer
</a>

</li>
Expand Down Expand Up @@ -10003,6 +10016,19 @@
Add to container
</a>

<nav class="md-nav" aria-label="Add to container">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#remove-from-container" class="md-nav__link">
Remove from container
</a>

</li>

</ul>
</nav>

</li>

<li class="md-nav__item">
Expand Down Expand Up @@ -10518,7 +10544,7 @@ <h3 id="depth">Depth<a class="headerlink" href="#depth" title="Permanent link">&
<div class="highlight"><pre><span></span><code><span class="nx">container</span><span class="p">.</span><span class="nx">sendChildToBack</span><span class="p">(</span><span class="nx">gameObject</span><span class="p">);</span>
</code></pre></div></li>
</ul>
<h3 id="layer">Layer<a class="headerlink" href="#layer" title="Permanent link">&para;</a></h3>
<h3 id="render-layer">Render layer<a class="headerlink" href="#render-layer" title="Permanent link">&para;</a></h3>
<p>A containerLite can have a <a href="../layer/">layer</a>.
Current children and new children will draw on this layer, instead of display list of scene.</p>
<ul>
Expand Down Expand Up @@ -10548,7 +10574,7 @@ <h3 id="mask">Mask<a class="headerlink" href="#mask" title="Permanent link">&par
</code></pre></div></li>
</ul>
<h3 id="shader-effects">Shader effects<a class="headerlink" href="#shader-effects" title="Permanent link">&para;</a></h3>
<p>Apply post-fx pipeline on <a href="./#layer">layer of containerLite</a>.</p>
<p>Apply post-fx pipeline on <a href="./#render-layer">layer of containerLite</a>.</p>
<h3 id="snapshot">Snapshot<a class="headerlink" href="#snapshot" title="Permanent link">&para;</a></h3>
<ul>
<li>Draw all visible children on a <a href="../rendertexture/">render-texture</a>.
Expand Down Expand Up @@ -10638,6 +10664,24 @@ <h3 id="add-to-container">Add to container<a class="headerlink" href="#add-to-co
</ul>
</li>
</ul>
<h4 id="remove-from-container">Remove from container<a class="headerlink" href="#remove-from-container" title="Permanent link">&para;</a></h4>
<ul>
<li>Remove from <a href="../container/">built-in container</a>
<div class="highlight"><pre><span></span><code><span class="nx">containerLite</span><span class="p">.</span><span class="nx">removeFromContainer</span><span class="p">(</span><span class="nx">p3Container</span><span class="p">);</span>
</code></pre></div>
or
<div class="highlight"><pre><span></span><code><span class="nx">p3Container</span><span class="p">.</span><span class="nx">remove</span><span class="p">(</span><span class="nx">containerLite</span><span class="p">);</span>
</code></pre></div><ul>
<li><code>p3Container</code> : <a href="../container/">Container</a> game object.</li>
</ul>
</li>
<li>Remove from <a href="../layer/">Layer</a>
<div class="highlight"><pre><span></span><code><span class="nx">container</span><span class="p">.</span><span class="nx">removeFromLayer</span><span class="p">(</span><span class="nx">layer</span><span class="p">);</span>
</code></pre></div><ul>
<li><code>layer</code> : <a href="../layer/">Layer</a> game object.</li>
</ul>
</li>
</ul>
<h3 id="other-properties_1">Other properties<a class="headerlink" href="#other-properties_1" title="Permanent link">&para;</a></h3>
<p>See <a href="../gameobject/">game object</a></p>
<h3 id="compare-with-official-container">Compare with Official Container<a class="headerlink" href="#compare-with-official-container" title="Permanent link">&para;</a></h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/site/search/search_index.json

Large diffs are not rendered by default.

Binary file modified docs/site/sitemap.xml.gz
Binary file not shown.
5 changes: 5 additions & 0 deletions examples/container-lite/add-to-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,12 @@ class Demo extends Phaser.Scene {
console.log("Container's displayList size", container.list.length);

// Remove containerLite(rexUI) from container
// Solution A:
// dialog.removeFromContainer();

// Solution B:
container.remove(dialog);

dialog.setPosition(400, 300);

console.log('Remove from container, add to scene');
Expand Down

0 comments on commit 762485c

Please sign in to comment.