Example #1
0
        public static ActivityAttribute GetActivityAttribute(this AndroidGameActivity obj)
        {
            var attr = obj.GetType().GetCustomAttributes(typeof(ActivityAttribute), true);

            if (attr != null)
            {
                return((ActivityAttribute)attr[0]);
            }
            return(null);
        }
Example #2
0
        public AndroidGameWindow(AndroidGameActivity activity, Game game)
        {
            _game = game;

            EW.Framework.Point size;
            if (Build.VERSION.SdkInt < BuildVersionCodes.JellyBean)
            {
                size.X = activity.Resources.DisplayMetrics.WidthPixels;
                size.Y = activity.Resources.DisplayMetrics.HeightPixels;
            }
            else
            {
                Android.Graphics.Point p = new Android.Graphics.Point();
                activity.WindowManager.DefaultDisplay.GetRealSize(p);
                size.X = p.X;
                size.Y = p.Y;
            }
            Initialize(activity);

            game.Services.AddService(typeof(View), GameView);
        }