protected override async void OnAppearing()
        {
            base.OnAppearing();

            //await HelloWorldUrhoSurface.Show<Charts>(new ApplicationOptions(assetsFolder: null) { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });
            urhoApp = await urhoSurface.Show <Charts>(new ApplicationOptions(assetsFolder : null) { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });
        }
示例#2
0
 async void StartUrhoApp()
 {
     _urhoGame = await _urhoSurface.Show <Game>(new Urho.ApplicationOptions()
     {
         Orientation = Urho.ApplicationOptions.OrientationType.LandscapeAndPortrait
     });
 }
示例#3
0
        private async Task Setup()
        {
            // sometimes, the scene is not big enough. we wait completion
            await Task.Delay(500);

            if (_app == null && _urhoSurface != null)
            {
                if (!Application.HasCurrent)
                {
                    var applicationOptions = new ApplicationOptions
                    {
                        Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait
                    };

                    _app = await _urhoSurface.Show <PanoramaApp>(applicationOptions);
                }
                else
                {
                    _app = (PanoramaApp)Application.Current;
                }

                UpdateImage();
                UpdateFieldOfView();
                UpdatePitch();
                UpdateYaw();
            }
        }
示例#4
0
 async void StartUrhoApp()
 {
     urhoApp = await urhoSurface.Show <Charts>(new ApplicationOptions()
     {
         Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait
     });
 }
示例#5
0
 async Task StartUrhoApp()
 {
     urhoApp = await urhoSurface.Show <EarthGlobeView>(
         new Urho.ApplicationOptions(assetsFolder: "Data")
     {
         Orientation = Urho.ApplicationOptions.OrientationType.LandscapeAndPortrait
     });
 }
示例#6
0
        async void RestartBtn_Click(object sender, RoutedEventArgs e)
        {
            app = await UrhoSurface.Show <Game>(new Urho.ApplicationOptions());

            if (app.IsActive)             //in case if user clicks "restart" too quickly
            {
                app.Viewport.SetClearColor(Urho.Extensions.Wpf.UrhoSurface.ConvertColor(((SolidColorBrush)Background).Color));
            }
        }
示例#7
0
        async void samplesListbox_SelectedIndexChanged(object sender, EventArgs e)
        {
            var type = (Type)samplesListbox.SelectedItem;

            if (type == null)
            {
                return;
            }
            var app = await surface.Show(type, new ApplicationOptions("Data"));
        }
示例#8
0
        protected override async void OnAppearing()
        {
            (Xamarin.Forms.Application.Current.MainPage as MainPage).IsGestureEnabled = false;

            modelViewer = await urhoSurface.Show <ThreeDModelViewer>(new ApplicationOptions("Materials")
                                                                     { Orientation = ApplicationOptions.OrientationType.Portrait });

            modelViewer.setThreeDModelName(threeDModel);
            Urho.Application.InvokeOnMain(() => modelViewer.startDisplaying());
        }
示例#9
0
        private async void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            _App = await UrhoSurface.Show <BasicApplication>(new ApplicationOptions
            {
                NoSound         = false,
                LimitFps        = false,
                ResizableWindow = true
            });

            _App.Engine.PostRenderUpdate += Engine_PostRenderUpdate;
        }
示例#10
0
        public ThreeDimensionalLensPage(ICollection <threeDimensionalPointDTO> Points, Func <threeDimensionalPointDTO, double> Mapping)
        {
            Content      = urhoSurface;
            this.Points  = Points;
            this.Mapping = Mapping;

            urhoSurface.Show <Dots>(new DotsOptions()
            {
                Points  = Points,
                Mapping = Mapping
            });
        }
示例#11
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            urhoSurface = new UrhoSurface(View.Bounds);
            View.AddSubview(urhoSurface);
            var app = await urhoSurface.Show <MyApp>(new Urho.ApplicationOptions("MyData")
            {
                Orientation  = Urho.ApplicationOptions.OrientationType.Portrait,
                DelayedStart = false,
            });
        }
示例#12
0
        protected override async void OnAppearing()
        {
            GetPermissions();

            ApplicationOptions urhoApplicationOptions = new ApplicationOptions()
            {
                ResourcePaths = new[] { "UrhoData" },
                Orientation   = ApplicationOptions.OrientationType.LandscapeAndPortrait
            };

            urhoApp = await urhoSurface.Show <UrhoApp>(urhoApplicationOptions);
        }
示例#13
0
        public override async void ViewDidLoad()
        {
            base.ViewDidLoad();

            // Restart button
            UIButton restartBtn = new UIButton(UIButtonType.RoundedRect);

            restartBtn.Frame = new CGRect(10f, 0f, 50, 50f);
            restartBtn.SetTitle("Restart", UIControlState.Normal);
            restartBtn.TouchUpInside += async(sender, e) => game = await urhoSurface.Show <Game>(new ApplicationOptions());

            View.AddSubview(restartBtn);

            // Stop button
            UIButton stopBtn = new UIButton(UIButtonType.RoundedRect);

            stopBtn.Frame = new CGRect(75f, 0f, 50, 50f);
            stopBtn.SetTitle("Stop", UIControlState.Normal);
            stopBtn.TouchUpInside += (sender, e) =>
            {
                urhoSurface.Stop();
                game = null;
            };
            View.AddSubview(stopBtn);

            // Spawn button
            UIButton spawnBtn = new UIButton(UIButtonType.RoundedRect);

            spawnBtn.Frame = new CGRect(135f, 0f, 50, 50f);
            spawnBtn.SetTitle("Spawn", UIControlState.Normal);
            spawnBtn.TouchUpInside += (sender, e) =>
            {
                if (game != null)
                {
                    Urho.Application.InvokeOnMain(() => game?.SpawnRandomShape());
                }
            };
            View.AddSubview(spawnBtn);

            // Pause/Unpause button
            UIButton pauseBtn = new UIButton(UIButtonType.RoundedRect);

            pauseBtn.Frame = new CGRect(200f, 0f, 80, 50f);
            pauseBtn.SetTitle("(Un)pause", UIControlState.Normal);
            pauseBtn.TouchUpInside += (sender, e) => urhoSurface.Paused = !urhoSurface.Paused;
            View.AddSubview(pauseBtn);

            urhoSurface                  = new UrhoSurface();
            urhoSurface.Frame            = new CoreGraphics.CGRect(0, 50, View.Bounds.Width, View.Bounds.Height - 50);
            urhoSurface.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight;
            View.Add(urhoSurface);
        }
示例#14
0
        async Task StartUrhoApp()
        {
            if (game == null)
            {
                game = await urhoSurface.Show <SamplyGame>(new ApplicationOptions(assetsFolder : AssetsPath) { Height = 1024, Width = 576, Orientation = ApplicationOptions.OrientationType.Portrait, ResourcePackagesPaths = ResourcePacksPaths });

                game.FinishedGame     += Game_FinishedGame;
                game.NewStartMenu     += Game_NewStartMenu;
                game.RemovedStartMenu += Game_RemovedStartMenu;
                game.StartMenu.ShowSettingsClicked += StartMenu_ShowSettingsClicked;
                GameScoreService.InitFromSettings();
                await ShowTopScores(game.StartMenu);
            }
        }
        public ThreeDimensionalLensPage(ICollection <threeDimensionalPointDTO> Points, Func <threeDimensionalPointDTO, double> Mapping)
        {
            Content      = urhoSurface;
            this.Points  = Points;
            this.Mapping = Mapping;

            urhoSurface.Show <Dots>(new DotsOptions()
            {
                Orientation     = ApplicationOptions.OrientationType.LandscapeAndPortrait,
                ResizableWindow = true,
                Points          = Points,
                Mapping         = Mapping
            });
        }
        void RunMutantSurface()
        {
            var viewController = new UIViewController();

            var surface = new UrhoSurface(UIScreen.MainScreen.Bounds);

            viewController.View.AddSubview(surface);

            Window.RootViewController.PresentViewController(viewController, false, null);

            surface.Show <MutantDemo>(new ApplicationOptions
            {
                ResourcePaths = new[] { "UrhoData" },
                Orientation   = ApplicationOptions.OrientationType.Portrait
            });
        }
示例#17
0
        private async void LoadImage(string imurl)
        {
            IsLoading = true;
            try
            {
                if (sphere == null)
                {
                    sphere = await urhoSurface.Show <Image360Sphere>(new ApplicationOptions(assetsFolder : null) { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });
                }

                await sphere.SetImage(imurl);
            }
            finally
            {
                IsLoading = false;
            }
        }
示例#18
0
        protected override async void OnAppearing()
        {
            if (Device.RuntimePlatform != Device.UWP)
            {
                urhoApp = await UrhoSurface.Show <UrhoPackage.Core.ShootingGame>(
                    new ApplicationOptions(assetsFolder : "Data")
                {
                    Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait
                });
            }

            /*
             * foreach (var bar in urhoApp.Bars)
             * {
             * bar.Selected += OnBarSelection;
             * }*/
        }
示例#19
0
文件: MainPage.cs 项目: elix22/urho
        async void StartUrhoApp()
        {
            app = await urhoSurface.Show <UrhoApp>(new Urho.ApplicationOptions(assetsFolder: "Data"));

            app.SetConnection(connection);
            Urho.Application.InvokeOnMain(() =>
            {
                foreach (var surface in space.Surfaces)
                {
                    app.AddOrUpdateSurface(surface.Value);
                }
                foreach (var bulb in space.Bulbs)
                {
                    AddBulb(bulb);
                }
            });
        }
示例#20
0
        private async Task StartUrhoApp()
        {
            if (_urhoSurface == null)
            {
                throw new System.Exception("Urho Surface not defined");
            }

            if (_urhoApp == null)
            {
                //This will fail if called twice within an application
                _urhoApp = await _urhoSurface.Show <UrhoApp>(
                    new ApplicationOptions(assetsFolder : null)
                {
                    Orientation    = ApplicationOptions.OrientationType.LandscapeAndPortrait,
                    TouchEmulation = true
                });

                LoadingUrhoTask.SetResult(true);
            }
        }
示例#21
0
        public void Initialize()
        {
            Device.BeginInvokeOnMainThread(async() =>
            {
                if (_app == null && _urhoSurface != null)
                {
                    // sometimes, the scene is not big enough. we wait completion
                    await Task.Delay(500);

                    _app = await _urhoSurface.Show <PanoramaApp>(new ApplicationOptions(null) // "Data"
                    {
                        Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait
                    });

                    UpdateImage();
                    UpdateFieldOfView();
                    UpdatePitch();
                    UpdateYaw();
                }
            });
        }
示例#22
0
        public override bool FinishedLaunching(UIApplication application, NSDictionary launchOptions)
        {
            // create a new window instance based on the screen size
            Window = new UIWindow(UIScreen.MainScreen.Bounds);

            // If you have defined a root view controller, set it here:
            Window.RootViewController = new UIViewController();

            var surface = new UrhoSurface(UIScreen.MainScreen.Bounds);

            Window.RootViewController.View.AddSubview(surface);

            // make the window visible
            Window.MakeKeyAndVisible();

            surface.Show <UrhoApp>(new ApplicationOptions {
                Orientation   = ApplicationOptions.OrientationType.Landscape,
                ResourcePaths = new [] { "BookshelfData", "BaseArkitData" },
                DelayedStart  = Runtime.Arch == Arch.DEVICE                // Update() will be called for each new ARFrame (for simulators it's should be 'false')
            });

            return(true);
        }
示例#23
0
 async void StartUrhoApp()
 {
     urhoApp = await urhoSurface.Show <Cards>(new ApplicationOptions(assetsFolder : null) { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });
 }
示例#24
0
        private void Form1_Load(object sender, EventArgs e)
        {
            surface.Show(typeof(UrhoApp), new ApplicationOptions(DesktopUrhoInitializer.AssetsDirectory));

            trackBar1_Scroll(null, null);
        }
示例#25
0
 protected override async void OnAppearing()
 {
     base.OnAppearing();
     await urhoSurface.Show <HelloUrhoApp>(new ApplicationOptions(assetsFolder : null));
 }
示例#26
0
 public RenderScene(UrhoSurface renderSurface)
 {
     _renderSurface = renderSurface;
     _renderSurface.Show <PulsarApplication>(new ApplicationOptions(assetsFolder: "E:\\VSProjects\\Windows\\Pulsar\\Assets"));
     MainApplication = (PulsarApplication)_renderSurface.Application;
 }
示例#27
0
        async void StartUrhoApp()
        {
            urhoApp = await urhoSurface.Show <Gym>(new ApplicationOptions(assetsFolder : "Ninja") { Orientation = ApplicationOptions.OrientationType.Portrait });

            //urhoApp.Ready += (sender, e) => { urhoSurface.IsVisible = true; loading.IsVisible = false; };
        }
示例#28
0
 protected override async void OnAppearing()
 {
     base.OnAppearing();
     // INITIALIZATION
     await UrhoSurface.Show <SphereApp>(new Urho.ApplicationOptions(assetsFolder: "Data"));
 }
示例#29
0
 async void StartUrhoApp()
 {
     Debug.WriteLine("***** UrhoPage.StartUrhoApp()");
     await urhoSurface.Show <WorldView>(new ApplicationOptions(assetsFolder : "Data") { Orientation = ApplicationOptions.OrientationType.LandscapeAndPortrait });
 }
 protected override async void OnAppearing()
 {
     await UrhoSurface.Show <UrhoApp>(new ApplicationOptions("Data"));
 }