use package core
+#local background_texture: Texture;
+
Background :: struct {
#struct_tag Entity_Schematic.{
(scene) => {
comp.func = Background.render;
}
- queue_assets(^Background.assets);
- load_assets();
+ background_texture', _ := texture_lookup("./assets/images/background.png");
+ texture_wrap(^background_texture, .Repeat);
return this;
}
render :: (this: ^Entity) {
size :: 10000.0f
immediate_set_color(.{1, 1, 1});
- immediate_subimage(^assets.texture, this.pos.x, this.pos.y, size, size, 0, 0, size / 2, size / 2);
- }
-
- #persist assets: struct {
- #tag "./assets/images/background.png"
- #tag Texture_Wrap.Repeat
- texture: Texture;
+ immediate_subimage(^background_texture, this.pos.x, this.pos.y, size, size, 0, 0, size / 2, size / 2);
}
}
\ No newline at end of file