【问题标题】:Embed Spine animations in Xamarin.Forms using Monogame使用 Monogame 在 Xamarin.Forms 中嵌入 Spine 动画
【发布时间】:2015-09-15 07:34:00
【问题描述】:

我正在尝试在 Xamarin.Forms 中嵌入使用 Spine 创建的动画头像。

思路如下: 我想在 PCL 中创建 Xamarin.Forms UI (XAML),实例化 Monogame 框架 (Microsoft.Xna.Framework.Game) 的 Game 类,并在 Xamarin.Forms 视图上呈现该游戏实例。

到目前为止,我已经设法让 Spine 动画在 Xamarin.Android 上运行。

在Android项目中,我可以向Monogame游戏类like that请求一个“Android View”服务类型:

protected override void OnCreate (Bundle bundle)
{
    base.OnCreate (bundle);

    var g = new Game1(); //inherits from Microsoft.Xna.Framework.Game
    SetContentView((View)g.Services.GetService(typeof(View)));
    g.Run();
}

是否有我可以从 Game 类请求的通用视图类型来获取该视图并将其呈现在 Xamarin.Forms 页面上? (这样我就可以将所有与动画相关的代码留在 PCL 中,并让它以跨平台的方式呈现。)

或者有没有其他方法可以将动画集成到 Xamarin.Forms 中?动画应与其他 Xamarin.Forms 控件(如按钮或菜单)一起存在。

【问题讨论】:

    标签: xamarin xna xamarin.forms monogame spine


    【解决方案1】:
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-05
    • 2015-07-13
    • 1970-01-01
    • 2023-04-02
    • 1970-01-01
    • 2022-06-30
    • 2017-11-07
    相关资源
    最近更新 更多