public void OpenScreen(UiScreenType newScreenType) { ScreenType = newScreenType; HudScreen.SetActive(newScreenType == UiScreenType.Hud); OptionsScreen.SetActive(newScreenType == UiScreenType.Options); OnScreenChanged?.Invoke(ScreenType); }
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); } }
void OnContainerElementLayoutUpdated(object sender, object e) { OnScreenChanged?.Invoke(this, EventArgs.Empty); }
void OnCurrentSizeChanged(object sender, global::Windows.UI.Core.WindowSizeChangedEventArgs e) { OnScreenChanged?.Invoke(this, EventArgs.Empty); }
void OnLayoutChangesCommited(object sender, EventArg <VisualElement> e) { OnScreenChanged?.Invoke(this, EventArgs.Empty); }