Пример #1
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            //Error	4	The call is ambiguous between the following methods or properties: 'ScriptCoreLib.JavaScript.Extensions.SpriteExtensions.ToHTMLElement(ScriptCoreLib.ActionScript.flash.display.Sprite)' and 'ScriptCoreLib.JavaScript.Extensions.AppletExtensions.ToHTMLElement(java.applet.Applet)'	X:\jsc.svn\examples\actionscript\StarlingRenderTextureExperiment\StarlingRenderTextureExperiment\Application.cs	33	25	StarlingRenderTextureExperiment


            var embed = SpriteExtensions.ToHTMLElement(sprite);

            embed.style.SetLocation(0, 0);
            embed.style.SetSize(Native.window.Width, Native.window.Height);

            Native.window.onresize +=
                delegate
            {
                embed.style.SetSize(Native.window.Width, Native.window.Height);
            };

            sprite.AttachSpriteToDocument();
        }
Пример #2
0
        /// <summary>
        /// This is a javascript application.
        /// </summary>
        /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param>
        public Application(IApp page)
        {
            ApplicationSprite sprite = new ApplicationSprite();


            // Initialize ApplicationSprite
            sprite.AttachSpriteToDocument();

            page.GoFullscreenFromFlash.onclick +=
                delegate
            {
                sprite.GoFullscreen();
            };

            page.GoFullscreenFromDOM.onclick +=
                delegate
            {
                SpriteExtensions.ToHTMLElement(sprite).requestFullscreen();
            };

            @"FlashTreasureHunt".ToDocumentTitle();
        }