1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-07 01:43:25 +08:00

Move and tweak avatar class

This commit is contained in:
Lunar Dust 2016-10-17 17:08:06 -05:00 committed by GitHub
parent 68f3a1b71d
commit c31796c957

View File

@ -0,0 +1,41 @@
//Copyright (c) 2007-2016 ppy Pty Ltd <contact@ppy.sh>.
//Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites;
using osu.Framework.Graphics.Textures;
using osu.Framework.IO.Stores;
using OpenTK;
namespace osu.Game.Graphics
{
public class Avatar : Sprite
{
private int userId;
private int rounding;
private int avatarSize = 50;
public Avatar(int userid, int avatarsize, int round)
{
this.userId = uId;
this.avatarSize = aSize;
this.rounding = round;
Anchor = Anchor.Centre;
Origin = Anchor.Centre;
}
public override async void Load(BaseGame game)
{
base.Load(game);
Texture = await game.Textures.GetAsync($@"https://a.ppy.sh/{userId}");
Size = new Vector2(avatarSize);
CornerRadius = rounding;
}
}
}