mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-20 01:46:15 +00:00
Create resource sprites as full rect to stop tiling warnings
This commit is contained in:
1 parent
77366593f1
commit
034521b7b6
2 files changed
+8
-2
No files matched your search
@@ -19,7 +19,7 @@ public static class MiraAssets
|
|||||||
new Vector2(0.5f, 0.5f),
|
new Vector2(0.5f, 0.5f),
|
||||||
100f,
|
100f,
|
||||||
0U,
|
0U,
|
||||||
SpriteMeshType.Tight,
|
SpriteMeshType.FullRect,
|
||||||
new Vector4(20, 20, 20, 20));
|
new Vector4(20, 20, 20, 20));
|
||||||
|
|
||||||
RoundedBox = new LoadableAssetWrapper<Sprite>(boxSprite);
|
RoundedBox = new LoadableAssetWrapper<Sprite>(boxSprite);
|
||||||
|
|||||||
@@ -48,7 +48,13 @@ public static class SpriteTools
|
|||||||
public static Sprite LoadSpriteFromPath(string resourcePath, Assembly assembly, float pixelsPerUnit)
|
public static Sprite LoadSpriteFromPath(string resourcePath, Assembly assembly, float pixelsPerUnit)
|
||||||
{
|
{
|
||||||
var tex = LoadTextureFromResourcePath(resourcePath, assembly);
|
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;
|
sprite.name = resourcePath;
|
||||||
return sprite;
|
return sprite;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user