v1.5.7.0 (Summer Update)
This commit is contained in:
@@ -107,7 +107,7 @@ namespace Barotrauma
|
||||
|
||||
static partial void AddToList(Sprite sprite);
|
||||
|
||||
public Sprite(ContentXElement element, string path = "", string file = "", bool lazyLoad = false)
|
||||
public Sprite(ContentXElement element, string path = "", string file = "", bool lazyLoad = false, float sourceRectScale = 1)
|
||||
{
|
||||
if (element is null)
|
||||
{
|
||||
@@ -137,7 +137,7 @@ namespace Barotrauma
|
||||
LoadTexture(ref sourceVector, ref shouldReturn);
|
||||
}
|
||||
if (shouldReturn) { return; }
|
||||
sourceRect = new Rectangle((int)sourceVector.X, (int)sourceVector.Y, (int)sourceVector.Z, (int)sourceVector.W);
|
||||
sourceRect = new Rectangle((int)(sourceVector.X * sourceRectScale), (int)(sourceVector.Y * sourceRectScale), (int)(sourceVector.Z * sourceRectScale), (int)(sourceVector.W * sourceRectScale));
|
||||
size = SourceElement.GetAttributeVector2("size", Vector2.One);
|
||||
RelativeSize = size;
|
||||
size.X *= sourceRect.Width;
|
||||
|
||||
Reference in New Issue
Block a user