コード例 #1
0
        public static void RunGame()
        {
            game = new PhysicsGame();
            // iOS requires a user triggered action to play web audio
            if (CustomScripts.IsIOS())
            {
                game.Content.OnAllResourceLoaded = () =>
                {
                    game.IsActive = false;
                    Html5.Canvas.Remove();
                    HTMLButtonElement button = new HTMLButtonElement();
                    button.InnerHTML = "Activate web audio for iOS";
                    button.SetAttribute("style", CustomScripts.FullScreenButtonStyle);

                    button.OnClick = (e) =>
                    {
                        WebAudioHelper.Activate();
                        Document.Body.RemoveChild(button);
                        game.IsActive = true;
                        Document.Body.AppendChild(Html5.Canvas);
                    };
                    Document.Body.AppendChild(button);
                };
            }
            game.Run();
        }
コード例 #2
0
 public ContentManager()
 {
     ResourcesReady = new Dictionary <string, bool>();
     WebAudioHelper.Init();
     MediaPlayer.contentManager = this;
 }