mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Add the concept of skinnable target containers and mark a basic one for HUD elements
This commit is contained in:
@ -45,6 +45,15 @@ namespace osu.Game.Extensions
|
||||
public static Vector2 ScreenSpaceDeltaToParentSpace(this Drawable drawable, Vector2 delta) =>
|
||||
drawable.Parent.ToLocalSpace(drawable.Parent.ToScreenSpace(Vector2.Zero) + delta);
|
||||
|
||||
public static StoredSkinnableInfo CreateSerialisedInformation(this Drawable component) => new StoredSkinnableInfo(component);
|
||||
public static SkinnableInfo CreateSerialisedInformation(this Drawable component) => new SkinnableInfo(component);
|
||||
|
||||
public static void ApplySerialisedInformation(this Drawable component, ISkinnableInfo info)
|
||||
{
|
||||
// todo: can probably make this better via deserialisation directly using a common interface.
|
||||
component.Position = info.Position;
|
||||
component.Rotation = info.Rotation;
|
||||
component.Scale = info.Scale;
|
||||
component.Anchor = info.Anchor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user