logs in console, caching in getAgentProps, console createAgent independent of GUI
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<style>
|
||||
.kf-editor .inner-console .results .api-summary{ border: 1px solid white;margin: .5em;width: 90%; }
|
||||
.kf-editor .inner-console .results .api-summary{ border: 1px solid white;margin: .5em;width: 90%; border-radius: 7px;}
|
||||
.kf-editor .inner-console .results .api-summary h1{
|
||||
font-size: 1.5em;
|
||||
margin: 0;
|
||||
@@ -12,6 +12,7 @@
|
||||
background: #DDD;
|
||||
color: black;
|
||||
}
|
||||
.kf-editor .inner-console .results button[data-trigger="onExample"]{ margin-left: 2em; }
|
||||
</style>
|
||||
<div class="title">Javascript Keyframe console</div>
|
||||
Use any combination of Javascript and API calls to update your keyframe scene.<br>
|
||||
@@ -21,8 +22,32 @@ Special commands:<br>
|
||||
<div class="api-summary">
|
||||
<h1>API:</h1>
|
||||
<ul>
|
||||
<li>Create an agent: <b>newAgent(type, properties)</b> - returns the AID</li>
|
||||
<li>Remove an agent: <b>removeAgent(aid)</b></li>
|
||||
<li>Update an agent: <b>updateAgent(aid, properties)</b></li>
|
||||
<li>Log here: <b>log()</b> - any number of arguments of any type</li>
|
||||
<li>Create an agent: <b>createAgent(type, properties)</b> - Promise returning the AID <button eicbutton info xxsmall data-trigger="onSnippet" data-snippet="createAgent">Snippet</button></li>
|
||||
<li>Remove an agent: <b>removeAgent(aid)</b> <button eicbutton info xxsmall data-trigger="onSnippet" data-snippet="removeAgent">Snippet</button></li>
|
||||
<li>Update an agent: <b>updateAgent(aid, properties)</b> <button eicbutton info xxsmall data-trigger="onSnippet" data-snippet="updateAgent">Snippet</button></li>
|
||||
<li>List agent types: <b>listAgentTypes()</b> <button eicbutton info xxsmall data-trigger="onSnippet" data-snippet="listAgentTypes">Snippet</button></li>
|
||||
<li>List agents on scene: <b>listAgentsOnScene()</b> <button eicbutton info xxsmall data-trigger="onSnippet" data-snippet="listAgentsOnScene">Snippet</button></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="snippet" data-snippet="createAgent" style="display:none">
|
||||
const agtIds = []
|
||||
for(let i=0; i<360; i+=22.5){
|
||||
agtIds.push(
|
||||
await createAgent(1, { position: { x: 10*Math.sin(i*Math.PI/180), y: 10*Math.cos(i*Math.PI/180), z: 0 } } )
|
||||
)
|
||||
}
|
||||
log(agtIds)
|
||||
</div>
|
||||
<div class="snippet" data-snippet="removeAgent" style="display:none">
|
||||
|
||||
</div>
|
||||
<div class="snippet" data-snippet="updateAgent" style="display:none">
|
||||
|
||||
</div>
|
||||
<div class="snippet" data-snippet="listAgentTypes" style="display:none">
|
||||
for(const agt of listAgentTypes() console.log(agt)
|
||||
</div>
|
||||
<div class="snippet" data-snippet="listAgentsOnScene" style="display:none">
|
||||
for(const agt of listAgentsOnScene() console.log(agt)
|
||||
</div>
|
||||
Reference in New Issue
Block a user