private void CreateNoesisGUI() { var rootPath = Path.Combine(Environment.CurrentDirectory, "Data"); var providerManager = new NoesisProviderManager( new FolderXamlProvider(rootPath), new FolderFontProvider(rootPath), new FolderTextureProvider(rootPath, this.GraphicsDevice)); var config = new NoesisConfig( this.Window, this.graphics, providerManager, rootXamlFilePath: "Grid.xaml", //"../Data_old/Samples/TextBox.xaml", //"TextBox.xaml", themeXamlFilePath: "Theme/NoesisTheme.DarkBlue.xaml", // uncomment this line to use theme file //themeXamlFilePath: "Themes/WindowsStyle.xaml", currentTotalGameTime: this.lastUpdateTotalGameTime); config.SetupInputFromWindows(); this.noesisWrapper = new NoesisWrapper(config); //this.noesisWrapper.View.IsPPAAEnabled = true; this.noesisWrapper.View.GetView().SetFlags(Noesis.RenderFlags.PPAA | Noesis.RenderFlags.LCD); string[] fonts = new string[] { "Theme/Fonts/#PT Root UI", "Arial", "Segoe UI Emoji" }; Noesis.GUI.LoadApplicationResources("Theme/NoesisTheme.DarkBlue.xaml"); Noesis.GUI.SetFontFallbacks(fonts); Noesis.GUI.SetFontDefaultProperties(15, Noesis.FontWeight.Normal, Noesis.FontStretch.Normal, Noesis.FontStyle.Normal); }
internal InputManager( NoesisViewWrapper noesisViewWrapper, NoesisConfig config) { this.noesisViewWrapper = noesisViewWrapper; var view = noesisViewWrapper.GetView(); var controlTreeRoot = view.Content; this.keyboard = new Keyboard( view, controlTreeRoot.Keyboard, config); // Find control tree root. // It's super important to use global UI root to process visual tree hit testing: // controlTreeRoot root is not the UI root and popup visuals are created in the UI root. var rootVisual = (Visual)controlTreeRoot; while (VisualTreeHelper.GetParent(rootVisual) is var parent && parent != null) { rootVisual = parent; } this.mouse = new Mouse(view, rootVisual, controlTreeRoot, config); }
public Mouse( View view, Visual uiRendererRoot, NoesisConfig config) { this.view = view; this.doubleClickInterval = TimeSpan.FromSeconds(config.InputMouseDoubleClickIntervalSeconds); this.uiRendererRoot = uiRendererRoot; this.checkIfElementIgnoresHitTest = config.CheckIfElementIgnoresHitTest; }
public Keyboard( View view, Noesis.Keyboard noesisKeyboard, NoesisConfig config) { this.view = view; this.noesisKeyboard = noesisKeyboard; this.keyRepeatDelaySeconds = (float)config.InputKeyRepeatDelaySeconds; this.keyRepeatIntervalSeconds = (float)config.InputKeyRepeatIntervalSeconds; }
public Keyboard( View view, Noesis.Keyboard noesisKeyboard, NoesisConfig config) { this.view = view; this.noesisKeyboard = noesisKeyboard; this.isEnableDirectionalNavigation = config.IsEnableDirectionalNavigation; this.keyRepeatDelaySeconds = (float)config.InputKeyRepeatDelaySeconds; this.keyRepeatIntervalSeconds = (float)config.InputKeyRepeatIntervalSeconds; }
internal InputManager( View view, UIElement uiRendererRoot, NoesisConfig config) { this.keyboard = new Keyboard( view, uiRendererRoot.Keyboard, config); this.mouse = new Mouse(view, uiRendererRoot, config); }
private void CreateNoesisGUI() { var config = new NoesisConfig( this.Window, this.graphics, rootXamlFilePath: "TextBox.xaml", themeXamlFilePath: "NoesisStyle.xaml", currentTotalGameTime: this.lastUpdateTotalGameTime); config.SetupInputFromWindows(); config.SetupProviderSimpleFolder("Data"); this.noesisGUIWrapper = new NoesisWrapper(config); }
public Mouse( View view, Visual rootVisual, FrameworkElement controlTreeRoot, NoesisConfig config) { this.view = view; this.rootVisual = rootVisual; this.controlTreeRoot = controlTreeRoot; this.checkIfElementIgnoresHitTest = config.CheckIfElementIgnoresHitTest; this.doubleClickInterval = TimeSpan.FromSeconds(config.InputMouseDoubleClickIntervalSeconds); this.isProcessMiddleButton = config.IsProcessMouseMiddleButton; }
private void CreateNoesisGUI() { var rootPath = Path.Combine(Environment.CurrentDirectory, "Data"); var providerManager = new NoesisProviderManager( new FolderXamlProvider(rootPath), new FolderFontProvider(rootPath), new FolderTextureProvider(rootPath, this.GraphicsDevice)); var config = new NoesisConfig( this.Window, this.graphics, providerManager, rootXamlFilePath: "Samples/TextBox.xaml", themeXamlFilePath: null, // uncomment this line to use theme file //themeXamlFilePath: "Themes/WindowsStyle.xaml", currentTotalGameTime: this.lastUpdateTotalGameTime); config.SetupInputFromWindows(); this.noesisWrapper = new NoesisWrapper(config); this.noesisWrapper.View.IsPPAAEnabled = true; }