Ejemplo n.º 1
0
 public void OpenScreen(UiScreenType newScreenType)
 {
     ScreenType = newScreenType;
     HudScreen.SetActive(newScreenType == UiScreenType.Hud);
     OptionsScreen.SetActive(newScreenType == UiScreenType.Options);
     OnScreenChanged?.Invoke(ScreenType);
 }
Ejemplo n.º 2
0
        public void Debug()
        {
            //Console.Clear();
            Console.Write(Emulator.GetScreen());
            var screen = Emulator.GetScreen();

            OnScreenChanged?.Invoke(screen);
            System.Diagnostics.Debug.Flush();
            System.Diagnostics.Debug.Print(screen);
            // _logger.Log(LogLevel.Trace, screen);
        }
            void ConfigurationChanged(object sender, EventArgs e)
            {
                if (IsDuo)
                {
                    _helper?.Update();
                }

                bool screenChanged = false;

                if (_isLandscape != IsLandscape)
                {
                    _isLandscape  = IsLandscape;
                    screenChanged = true;
                }

                if (_mainActivity != null)
                {
                    using (DisplayMetrics display = _mainActivity.Resources.DisplayMetrics)
                    {
                        var scalingFactor = display.Density;
                        _pixelScreenSize = new Size(display.WidthPixels, display.HeightPixels);
                        var newSize = new Size(_pixelScreenSize.Width / scalingFactor, _pixelScreenSize.Height / scalingFactor);

                        if (newSize != ScaledScreenSize)
                        {
                            ScaledScreenSize = newSize;
                            screenChanged    = true;
                        }
                    }
                }

                if (screenChanged)
                {
                    OnScreenChanged?.Invoke(this, e);
                }
            }
Ejemplo n.º 4
0
 void OnContainerElementLayoutUpdated(object sender, object e)
 {
     OnScreenChanged?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 5
0
 void OnCurrentSizeChanged(object sender, global::Windows.UI.Core.WindowSizeChangedEventArgs e)
 {
     OnScreenChanged?.Invoke(this, EventArgs.Empty);
 }
Ejemplo n.º 6
0
 void OnLayoutChangesCommited(object sender, EventArg <VisualElement> e)
 {
     OnScreenChanged?.Invoke(this, EventArgs.Empty);
 }