コード例 #1
0
		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);
		}
コード例 #2
0
		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);
			var mLayout = new AbsoluteLayout(this);
			var surface = UrhoSurface.CreateSurface<SamplyGame>(this);
			mLayout.AddView(surface);
			SetContentView(mLayout);
		}
コード例 #3
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     var mLayout = new AbsoluteLayout(this);
     var surface = AndroidSDLSurface.CreateSurface(this, false, typeof($$APPLICATION_APPDELEGATECLASS$$));
     mLayout.AddView(surface);
     SetContentView(mLayout);
 }
コード例 #4
0
 protected override void OnCreate(Bundle bundle)
 {
     base.OnCreate(bundle);
     var mLayout = new AbsoluteLayout(this);
     var surface = AndroidSDLSurface.CreateSurface(this, false, typeof(AtomicMain));
     mLayout.AddView(surface);
     SetContentView(mLayout);
 }
コード例 #5
0
		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);
		}
コード例 #6
0
        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 <Game>(new Urho.ApplicationOptions("Data"));
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
        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().
        }
コード例 #10
0
        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));
        }
コード例 #11
0
ファイル: MainActivity.cs プロジェクト: wqg2016/urho
 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());
 }
コード例 #12
0
        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"));
        }
コード例 #13
0
        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);
        }
コード例 #14
0
        public override void OnWindowFocusChanged(bool hasFocus)
        {
            base.OnWindowFocusChanged(hasFocus);

            //Log.Debug("Info", string.Format("Width(AbsoluteLayout): {0},Height(AbsoluteLayout): {1}", abs.Width, abs.Height));

            // ContentViewに配置したAbsoluteLayoutのサイズ
            layoutW = abs.Width;
            layoutH = abs.Height;

            // TextViewのサイズを指定・配置
            textW = layoutW / 2;
            textH = layoutH / 5;

            if (!sensorText.IsShown)
            {
                abs.AddView(sensorText, new AbsoluteLayout.LayoutParams(textW, textH, layoutW / 2 - textW / 2, layoutH / 2 - textH / 2));
            }
        }
コード例 #15
0
        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"));
        }
コード例 #16
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            Window.SetFlags(WindowManagerFlags.Fullscreen,
                            WindowManagerFlags.Fullscreen);
            SetContentView(Resource.Layout.Main);

            mFrame   = FindViewById <AbsoluteLayout>(Resource.Id.layout); //4
            mContext = this;

            mCamera = Android.Hardware.Camera.Open(0); //1
            if (mCamera == null)
            {                                          //2
                Toast.MakeText(this, "Opening camera failed", ToastLength.Long).Show();
                return;
            }
            mask = new CameraViewElement(this)
            {
                Clickable = true
            };
            mask.Click += OnMaskClick;

            photoOutput = new CameraViewOutput(this)
            {
                CubeSize = mask.Size
            };

            mask.SetOutput(photoOutput);

            preview = new CameraPreview(this, mCamera)
            {
                a         = this,
                output    = photoOutput,
                Clickable = true
            };

            mask.LayoutParameters = new AbsoluteLayout.LayoutParams(
                ViewGroup.LayoutParams.WrapContent,
                ViewGroup.LayoutParams.WrapContent,
                0,
                0
                );


            photoOutput.LayoutParameters = new AbsoluteLayout.LayoutParams(
                300,
                533,
                0,
                0
                );;
            mFrame = FindViewById <AbsoluteLayout>(Resource.Id.layout); //4

            mFrame.AddView(preview);
            mFrame.AddView(mask);
            mFrame.AddView(photoOutput);


            /*
             * CubeAnimation cb = new CubeAnimation(this);
             * cb.LayoutParameters = new AbsoluteLayout.LayoutParams(
             *  ViewGroup.LayoutParams.MatchParent,
             *  ViewGroup.LayoutParams.MatchParent,
             *  0, 0
             * );
             * mFrame.AddView(cb);
             */

            /*
             * mFrame.AddView(b = new Button(this) {
             *  LayoutParameters = new AbsoluteLayout.LayoutParams(
             *      ViewGroup.LayoutParams.MatchParent,
             *      ViewGroup.LayoutParams.WrapContent,
             *      0, 0
             *      ),
             *  Text = "Pick me"
             * });
             * b.Click += OnClick;
             */
        }