+ Texture.Aspect
+ Transformation.ApplyTextureSize(Texture texture) & Transformation.ApplyTextureSize(Texture texture, float width)
This commit is contained in:
parent
1a0148ff90
commit
57fb71d01b
4 changed files with 34 additions and 4 deletions
|
|
@ -1,8 +1,10 @@
|
|||
#region usings
|
||||
|
||||
using System;
|
||||
using OpenTK;
|
||||
using SM.Base.Drawing;
|
||||
using SM.Base.Scene;
|
||||
using SM.Base.Textures;
|
||||
using SM.Base.Types;
|
||||
using SM.Utility;
|
||||
|
||||
|
|
@ -38,5 +40,15 @@ namespace SM2D.Types
|
|||
vec.Normalize();
|
||||
return vec.Xy;
|
||||
}
|
||||
|
||||
public void ApplyTextureSize(Texture texture)
|
||||
{
|
||||
Size.Set(texture.Width, texture.Height);
|
||||
}
|
||||
|
||||
public void ApplyTextureSize(Texture texture, float width)
|
||||
{
|
||||
Size.Set(width, width / texture.Aspect);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue