buildoz is born, bz-select is coming
This commit is contained in:
@@ -18,10 +18,16 @@
|
||||
<header><canvas data-output="agentSampleCanvas"></canvas></header>
|
||||
<section>
|
||||
agents selector
|
||||
<select data-output="agentsSelector"></select>
|
||||
<bz-select data-output="agentsSelector">
|
||||
<option value="val1">First value</option>
|
||||
<option value="val2">Second value</option>
|
||||
<option value="val3">Third value</option>
|
||||
<option value="val4">Fourth value</option>
|
||||
<option value="val5">Fifth value</option>
|
||||
</bz-select>
|
||||
</section>
|
||||
</article>
|
||||
<article eiccard="" data-eicui-id="d9aace9b-9e60-4cfc-ad7c-98b9693d05f3" aria-enabled="true">
|
||||
<article eiccard>
|
||||
<section>
|
||||
Arena
|
||||
</section>
|
||||
|
||||
@@ -23,18 +23,24 @@ class KeyframeView extends WindozDomContent {
|
||||
|
||||
|
||||
this.agentDefs = await this.models.agents.getSprites('Basic 3D')
|
||||
for(const agentType in this.agentDefs){
|
||||
const opt = new Option(agentType, agentType)
|
||||
this.outputs.agentsSelector.add(opt)
|
||||
}
|
||||
this.outputs.agentsSelector.addEventListener('change',this.onChangeAgent.bind(this))
|
||||
// for(const agentType in this.agentDefs){
|
||||
// const opt = new Option(agentType, agentType)
|
||||
// this.outputs.agentsSelector.add(opt)
|
||||
// }
|
||||
// this.outputs.agentsSelector.addEventListener('change',this.onChangeAgent.bind(this))
|
||||
|
||||
this.agentPreview = new app.LoadedModules.AgentPreview(this.outputs.agentSampleCanvas, this.agentDefs)
|
||||
this.onChangeAgent()
|
||||
this.agentPreview.startRendering()
|
||||
this.agentPreview.animation = true
|
||||
// const x = new tinySelector('[data-output="agentsSelector"]',{
|
||||
// selectorOptions: Object.keys(this.agentDefs).map(aname => ({ markup: aname, value: aname}))
|
||||
// })
|
||||
|
||||
// this.agentPreview = new app.LoadedModules.AgentPreview(this.outputs.agentSampleCanvas, this.agentDefs)
|
||||
// this.onChangeAgent()
|
||||
// this.agentPreview.startRendering()
|
||||
// this.agentPreview.animation = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
onChangeAgent(event){
|
||||
this.agentPreview.setAgent(this.outputs.agentsSelector.value)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user