private async Task LaunchGame() { var mLayout = new RelativeLayout(this); surface = UrhoSurface.CreateSurface(this); mLayout.AddView(surface); SetContentView(mLayout); app = await surface.Show <Game>(new ApplicationOptions("Data")); app.Update += (obj) => { if (app.IsClosed) { Console.WriteLine("app is closed"); } if (app.IsDeleted) { Console.WriteLine("app is deleted"); } if (app.IsExiting) { Console.WriteLine("app is exiting"); } }; }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var decorView = Window.DecorView; var uiOptions = (int)decorView.SystemUiVisibility; uiOptions |= (int)SystemUiFlags.LowProfile; uiOptions |= (int)SystemUiFlags.Fullscreen; uiOptions |= (int)SystemUiFlags.HideNavigation; uiOptions |= (int)SystemUiFlags.ImmersiveSticky; decorView.SystemUiVisibility = (StatusBarVisibility)uiOptions; var layout = new FrameLayout(this); var surface = UrhoSurface.CreateSurface(this); layout.AddView(surface); SetContentView(layout); MHUrhoApp.FileManager = FileManagerDroid.LoadConfig(Assets); MHUrhoApp.FileManager.CopyStaticToDynamic(Path.Combine("Data", "Test")); try { myGame = await surface.Show <MHUrhoApp>(new ApplicationOptions("Data")); } catch (Exception e) { Urho.IO.Log.Write(LogLevel.Debug, e.ToString()); } //to stop the game use await surface.Stop(). }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); var surface = UrhoSurface.CreateSurface <SamplyGame>(this, new Urho.ApplicationOptions("Data")); mLayout.AddView(surface); SetContentView(mLayout); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var layout = new AbsoluteLayout(this); var surface = UrhoSurface.CreateSurface <MyGame>(this); layout.AddView(surface); SetContentView(layout); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); surface = UrhoSurface.CreateSurface(this, Type.GetType(Intent.GetStringExtra("Type")), new ApplicationOptions("Data"), true); mLayout.AddView(surface); SetContentView(mLayout); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); surface = UrhoSurface.CreateSurface(this, typeof(UrhoApp), new ApplicationOptions("Data"), true); mLayout.AddView(surface); SetContentView(mLayout); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new FrameLayout(this); surface = UrhoSurface.CreateSurface(this); mLayout.AddView(surface); SetContentView(mLayout); app = await surface.Show <MyApp>(new ApplicationOptions("MyData")); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var mLayout = new AbsoluteLayout(this); surface = UrhoSurface.CreateSurface(this); // (this, , true); mLayout.AddView(surface); SetContentView(mLayout); app = (DemoGame)await surface.Show(typeof(DemoGame), new ApplicationOptions("Data")); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); var surface = UrhoSurface.CreateSurface(this); // (this, , true); mLayout.AddView(surface); SetContentView(mLayout); var app = await surface.Show <SamplyGame>(new Urho.ApplicationOptions("Data")); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); placeholder = new FrameLayout(this); surface = UrhoSurface.CreateSurface(this); placeholder.AddView(surface); SetContentView(placeholder); LaunchUrho(); }
protected async override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var mLayout = new RelativeLayout(this); var surface = UrhoSurface.CreateSurface(this); mLayout.AddView(surface); SetContentView(mLayout); app = await surface.Show <BertApp>(new ApplicationOptions("Data")); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var layout = new AbsoluteLayout(this); var surface = UrhoSurface.CreateSurface(this); layout.AddView(surface); SetContentView(layout); // myGame = await surface.Show<SamplyGame>(new ApplicationOptions("Data")); //to stop the game use await surface.Stop(). }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); UrhoEngine.Init(); var surface = UrhoSurface.CreateSurface <SamplyGame>(this); mLayout.AddView(surface); SetContentView(mLayout); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); var layout = new AbsoluteLayout(this); Urho.Application.Started += UrhoAppStarted; var surface = UrhoSurface.CreateSurface <UrhoApp>(this); layout.AddView(surface); SetContentView(layout); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); surface = UrhoSurface.CreateSurface(this); // (this, , true); mLayout.AddView(surface); SetContentView(mLayout); app = await surface.Show(Type.GetType(Intent.GetStringExtra("Type")), new ApplicationOptions("Data")); AppCenter.Start("1ee54659-f01e-4605-a401-9b276c3708d7", typeof(Analytics), typeof(Crashes)); }
async void OnRestart(object sender, EventArgs e) { if (surface != null) { surface.Stop(); var viewGroup = surface.Parent as ViewGroup; viewGroup?.RemoveView(surface); } surface = UrhoSurface.CreateSurface(this); placeholder.AddView(surface); //game = await surface.Show<Game>(new Urho.ApplicationOptions()); game = await surface.Show <ARCoreSample>(new Urho.ApplicationOptions()); }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); RenderScript = RenderScript.Create(this); var layout = new AbsoluteLayout(this); Urho.Application.Started += UrhoAppStarted; var surface = UrhoSurface.CreateSurface <UrhoApp>(this); surface.SetBackgroundColor(Color.Transparent); layout.AddView(surface); SetContentView(layout); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); var appType = Assembly.Load("Sample").GetTypes() .Where(_ => _.IsSubclassOf(typeof(Urho.Application))) .Where(_ => !_.IsAbstract) .FirstOrDefault(); _surface = UrhoSurface.CreateSurface(this); mLayout.AddView(_surface); SetContentView(mLayout); _application = await _surface.Show(appType, new ApplicationOptions("Data")); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); var layout = new FrameLayout(this); var surface = UrhoSurface.CreateSurface(this); layout.AddView(surface); SetContentView(layout); var options = new ApplicationOptions() { ResourcePaths = new[] { "Data" } }; var app = await surface.Show <SamplyGame>(options); }
protected override async void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); // Create your application here var layout = new FrameLayout(this); surface = UrhoSurface.CreateSurface(this); layout.AddView(surface); SetContentView(layout); var type = Type.GetType(Intent.GetStringExtra("Type")); var options = new ApplicationOptions() { ResourcePaths = new[] { "Data" } }; app = await surface.Show(type, options); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new FrameLayout(this); surface = UrhoSurface.CreateSurface(this); mLayout.AddView(surface); SetContentView(mLayout); app = await surface.Show <MyApp>(new ApplicationOptions("MyData")); mSensorManager = (SensorManager)GetSystemService(Activity.SensorService); mAccSensor = mSensorManager.GetDefaultSensor(SensorType.GeomagneticRotationVector); //mMagneticSensor = mSensorManager.GetDefaultSensor(SensorType.MagneticField);; mSensorManager.RegisterListener(this, mAccSensor, SensorDelay.Game); // mSensorManager.RegisterListener(this, mMagneticSensor, SensorDelay.Game); }
async void LaunchUrho() { if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.Camera) != Permission.Granted) { ActivityCompat.RequestPermissions(this, new[] { Manifest.Permission.Camera }, 42); return; } if (launched) { return; } launched = true; surface = UrhoSurface.CreateSurface(this); placeholder.AddView(surface); app = await surface.Show <MyApp>(new Urho.ApplicationOptions("MyData")); }
private async Task Initialize() { if (ContextCompat.CheckSelfPermission(Context, Manifest.Permission.Camera) != Permission.Granted) { ActivityCompat.RequestPermissions(Context as Activity, new[] { Manifest.Permission.Camera }, 42); return; } if (surface != null) { return; } surface = UrhoSurface.CreateSurface(Context as Activity); SetNativeControl(surface); await surface.Show <Game>(); }
protected override async void OnCreate(Bundle bundle) { base.OnCreate(bundle); var mLayout = new AbsoluteLayout(this); var appType = Assembly.Load("UrhoSharpEditor").GetTypes() .Where(_ => _.IsSubclassOf(typeof(Urho.Application))) .Where(_ => !_.IsAbstract) .FirstOrDefault(); _surface = UrhoSurface.CreateSurface(this); mLayout.AddView(_surface); SetContentView(mLayout); Android.Views.View decorView = Window.DecorView; var uiOptions = (int)decorView.SystemUiVisibility; var newUiOptions = (int)uiOptions; newUiOptions |= (int)SystemUiFlags.Fullscreen; newUiOptions |= (int)SystemUiFlags.HideNavigation; newUiOptions |= (int)SystemUiFlags.Immersive; decorView.SystemUiVisibility = (StatusBarVisibility)newUiOptions; _application = await _surface.Show(appType, new ApplicationOptions("Data")); }