コード例 #1
0
ファイル: Menu.cs プロジェクト: Alan-Baylis/ManafestSandbox
    public static TexturedButton TexturedButton(
        string normalTexturePath = "",
        string selectTexturePath = "",
        Action onClick           = null
        )
    {
        TexturedButton tb = new TexturedButton();

        if (normalTexturePath != "")
        {
            tb.TextureNormal = ResourceLoader.Load(normalTexturePath) as Texture;
        }
        if (selectTexturePath != "")
        {
            Texture t = ResourceLoader.Load(selectTexturePath) as Texture;
            tb.TextureFocused = t;
            tb.TextureHover   = t;
        }
        if (onClick != null)
        {
            tb.SetOnClick(onClick);
        }
        tb.Expand = true;
        return(tb);
    }