mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-22 12:58:33 +01:00
added easy scale origin function to custom draw groups
This commit is contained in:
parent
739d337d49
commit
cb56319924
1 changed files with 4 additions and 0 deletions
|
@ -42,6 +42,10 @@ namespace MLEM.Ui.Elements {
|
|||
}
|
||||
}
|
||||
|
||||
public void ScaleOrigin(float scale, Vector2? origin = null) {
|
||||
this.Transform = Matrix.CreateScale(scale, scale, 0) * Matrix.CreateTranslation(new Vector3((1 - scale) * (origin ?? this.DisplayArea.Center), 0));
|
||||
}
|
||||
|
||||
public delegate void BeginDelegate(CustomDrawGroup element, GameTime time, SpriteBatch batch, float alpha, BlendState blendState, SamplerState samplerState, Matrix matrix);
|
||||
|
||||
public delegate Matrix TransformCallback(CustomDrawGroup element, GameTime time, Matrix matrix);
|
||||
|
|
Loading…
Reference in a new issue