public MTexture(MTexture parent, string atlasPath, Rectangle clipRect, Vector2 drawOffset, int width, int height) { Texture = parent.Texture; AtlasPath = atlasPath; ClipRect = parent.GetRelativeRect(clipRect); DrawOffset = drawOffset; Width = width; Height = height; SetUtil(); }
public MTexture(MTexture parent, int x, int y, int width, int height) { Texture = parent.Texture; AtlasPath = null; ClipRect = parent.GetRelativeRect(x, y, width, height); DrawOffset = new Vector2(-Math.Min(x - parent.DrawOffset.X, 0), -Math.Min(y - parent.DrawOffset.Y, 0)); Width = width; Height = height; SetUtil(); }