mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
textures load!!!
This commit is contained in:
1 parent
a348e005f7
commit
05dd4dbd98
3 files changed
+11
-2
No files matched your search
@@ -107,6 +107,13 @@ public partial class GameInterface
|
||||
|
||||
public List<string> Textures => [.. texturePaths.Keys];
|
||||
|
||||
public byte[] Texture(string name)
|
||||
{
|
||||
var path = texturePaths[name];
|
||||
var texture = provider.LoadPackageObject<UTexture2D>(path);
|
||||
return provider.Image(texture);
|
||||
}
|
||||
|
||||
public HashSet<string> Files => files;
|
||||
|
||||
public byte[] TankBigIcon(string tag)
|
||||
|
||||
@@ -88,7 +88,7 @@ public class MonoGltf
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine($"Unsupported texture type: {parameterTexture.Key}");
|
||||
// Console.WriteLine($"Unsupported texture type: {parameterTexture.Key}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,7 @@ export const getStaticPaths = mixStaticPaths(_getStaticPaths, () => {
|
||||
});
|
||||
|
||||
export function GET({ params }: APIContext<never, { name: string }>) {
|
||||
return Response.json(params);
|
||||
const image = game!.texture(params.name);
|
||||
const array = new Uint8Array(image);
|
||||
return new Response(array);
|
||||
}
|
||||
Reference in new issue
Block a user