+
When is Tres ready?
+
+ Tres is "ready" if either:
+
+
+ -
+ The scene can be meaningfully rendered.
+
+
+ - the renderer exists
+ - the canvas width and height are > 0
+
+ - Tres has waited 100 ms - assumes setup is intentionally degenerate.
+
+
+
"ready" in user space
+
<TresCanvas @ready="(ctx:TresContext) => {}">
+
A callback can be defined in the <script setup />
of a <TresCanvas>.
+
+ -
+ {{ passed ? "✅" : "❌" }} {{ msg }}
+
+
+
onTresReady((ctx:TresContext) => {})
+
onTresReady
can only be called in a child component.
+
+ -
+ {{ passed ? "✅" : "❌" }} {{ msg }}
+
+
+
useLoop()...(callback)
+
useLoop
can only be called in a child component.
+
+ -
+ {{ passed ? "✅" : "❌" }} {{ msg }}
+
+
+
+
Context
+
+ See this Github issue for further explanation.
+
+
+