zyy-engine

图形引擎API


添加/移除视图

<h1>添加视图</h1> <h2>接口</h2> <p><code>addViewer2D(viewer2D)</code></p> <h3>成员</h3> <table> <thead> <tr> <th>参数名</th> <th>必选</th> <th>类型</th> <th>说明</th> <th>可选项</th> </tr> </thead> <tbody> <tr> <td>viewer2D</td> <td>是</td> <td>BCore2DFast.Viewer2D</td> <td>Viewer2D</td> <td>-</td> </tr> </tbody> </table> <p><strong>示例:</strong></p> <pre><code class="language-javascript">let mApplication2D = new BCore2DFast.Application.Application2D(new BCore2D.Application.Application2DConfig()); let mViewer2D = new BCore2DFast.Viewer.Viewer2D('domId', new BCore2D.Viewer.Viewer2DConfig()); mApplication2D.addViewer2D(mViewer2D);</code></pre> <hr /> <h2>移除视图</h2> <h3>接口</h3> <p><code>destoryViewer2D(viewer2D)</code></p> <p><strong>成员:</strong></p> <table> <thead> <tr> <th>参数名</th> <th>必选</th> <th>类型</th> <th>说明</th> <th>可选项</th> </tr> </thead> <tbody> <tr> <td>viewer2D</td> <td>是</td> <td>BCore2D.Viewer2D</td> <td>Viewer2D</td> <td>-</td> </tr> </tbody> </table> <p><strong>示例:</strong></p> <pre><code class="language-javascript">mApplication2D.destoryViewer2D(mViewer2D);</code></pre> <hr /> <h3>注意事项</h3> <ul> <li>请确保在添加或移除视图时正确地传入<code>viewer2D</code>参数。</li> <li>为避免内存泄漏,使用<code>destoryViewer2D</code>移除不再需要的视图。</li> </ul>

页面列表

ITEM_HTML