Added code support, not great but hey it works

This commit is contained in:
2023-05-18 23:31:36 -07:00
parent 5619ce9824
commit 8df72dace1
16 changed files with 191 additions and 6 deletions

View File

@ -4,13 +4,13 @@
</item>
<item ref="eth" prefab="prefabs/EthPrefab" />
<item ref="craig" prefab="prefabs/SimpleSpinningCubePrefab" />
<!-- <item ref="craig" prefab="prefabs/SimpleSpinningCubePrefab" />
<item ref="bg" prefab="prefabs/SimpleSpinningCubePrefab" />
<item ref="square" prefab="prefabs/SimpleSpinningCubePrefab" />
<item ref="square" prefab="prefabs/SimpleSpinningCubePrefab" /> -->
<item lookAt="0, 0, 5, 0, 0, 0" >
<Camera fov="0.436332" ref="cameraNew" />
<CameraTexture />
<item lookAt="5, 5, 5, 0, 0, 0" >
<Camera fov="0.436332" />
<CameraTexture ref="camTexture" />
</item>
<item>
@ -24,7 +24,16 @@
alignUnitRight="UI_COMPONENT_ALIGN_UNIT_PERCENT"
alignY="UI_COMPONENT_ALIGN_STRETCH"
ref="image"
texture="camTexture->renderTarget.getTexture()"
/>
</item>
</item>
<code type="init">
useEvent([&]{
assertNotNull(camTexture);
assertNotNull(image);
camTexture->renderTarget.setSize(image->getWidth(), image->getHeight());
}, image->eventAlignmentUpdated);
</code>
</scene>