Create resource sprites as full rect to stop tiling warnings

This commit is contained in:
ReAdmin committed 2026-10-07 02:16:11 -07:00
1 parent 77366593f1
commit 034521b7b6
2 files changed
+8 -2

No files matched your search

+1 -1
View File
@@ -19,7 +19,7 @@ public static class MiraAssets
new Vector2(0.5f, 0.5f),
100f,
0U,
SpriteMeshType.Tight,
SpriteMeshType.FullRect,
new Vector4(20, 20, 20, 20));
RoundedBox = new LoadableAssetWrapper<Sprite>(boxSprite);
+7 -1
View File
@@ -48,7 +48,13 @@ public static class SpriteTools
public static Sprite LoadSpriteFromPath(string resourcePath, Assembly assembly, float pixelsPerUnit)
{
var tex = LoadTextureFromResourcePath(resourcePath, assembly);
var sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f), pixelsPerUnit);
var sprite = Sprite.Create(
tex,
new Rect(0, 0, tex.width, tex.height),
new Vector2(0.5f, 0.5f),
pixelsPerUnit,
0,
SpriteMeshType.FullRect);
sprite.name = resourcePath;
return sprite;
}