Scene script code

This commit is contained in:
2026-06-04 13:36:35 -05:00
parent 2b3abbe13b
commit 3c8b6cb2cc
19 changed files with 958 additions and 33 deletions
+12 -10
View File
@@ -1,6 +1,8 @@
var scene = {};
var scene = {
'test': 'teststring'
};
scene.batch = AssetBatch([
var assets = AssetBatch([
{ path: 'test.png', type: Asset.TYPE_TEXTURE, format: Texture.FORMAT_RGBA }
]);
@@ -11,12 +13,13 @@ var testPos;
var testRenderable;
var texEntry;
scene.load = function() {
return scene.batch;
scene.init = function() {
assets.lock();
assets.onLoaded[0] = scene.loaded;
};
scene.init = function() {
texEntry = scene.batch.entry(0);
scene.loaded = function() {
texEntry = assets.entry(0);
// Camera at (3, 3, 3) looking at origin
cam = Entity.create();
@@ -35,14 +38,13 @@ scene.init = function() {
[0, 0, 1, 1, 0, 1, 1, 0]
];
testPos.localPosition = new Vec3(0, 0, 0);
};
}
scene.dispose = function() {
Console.print('Scene Dispose');
Entity.dispose(cam);
Entity.dispose(testEntity);
texEntry.unlock();
scene.batch.unlock();
assets.unlock();
};
module.exports = scene;