private void Window_Deactivated(object sender, EventArgs e) { if (Selected) { return; } Selection = new Point(-1, -1); WordSelected?.Invoke(this, Selection); Selected = true; Close(); }
private void Canvas_PreviewMouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (Selected) { return; } e.Handled = true; Selection = e.GetPosition(this); WordSelected?.Invoke(this, Selection); Selected = true; Close(); }
public override void Start() { base.Start(); GameObject background = new GameObject(new Vector2(Game.Window.Width / 2, Game.Window.Height + 60), "background_forest"); GameObject board = new GameObject(new Vector2(Game.Window.Width / 2, 230f), "board"); GameObject crashLabel = new GameObject(board.Position + new Vector2(0, 70f), "crashLabel"); crashLabel.GetSprite().scale = new Vector2(3.5f); GameObject arrow1 = new GameObject(board.Position + new Vector2(-board.Width / 5.5f, 30f), "arrowMenu1"); arrow1.GetSprite().scale = new Vector2(4f); GameObject arrow2 = new GameObject(board.Position + new Vector2(board.Width / 6.5f, 0f), "arrowMenu2"); arrow2.GetSprite().scale = new Vector2(4f); arrow2.GetSprite().Rotation -= MathHelper.DegreesToRadians(15f); playDemoWord = LetterManager.GetWord("PLAY DEMO", board.Position + new Vector2(-board.Width / 10, board.Height / 1.5f), 3f); exitWord = LetterManager.GetWord("EXIT", playDemoWord.Position + new Vector2(0, playDemoWord.Height * 2)); informationWords = LetterManager.GetWord("Demo developed by Gaeta Nicola", new Vector2(Game.Window.Width / 4, Game.Window.Height - 20f)); wordSelected = WordSelected.Play; selector = LetterManager.GetSelector(playDemoWord.Position); selector.GetSprite().FlipX = true; SetSelectorPosition(); gameObjects.Add(background); gameObjects.Add(arrow1); gameObjects.Add(arrow2); gameObjects.Add(board); gameObjects.Add(crashLabel); audioSourceBackground = new AudioSource(); audioSourceSelection = new AudioSource(); clipMenu = new AudioClip("Assets/Audio/BackgroundTheme.ogg"); clipSelector = new AudioClip("Assets/Audio/Bleep.wav"); }
public override bool OnJsAlert(WebView view, string url, string message, JsResult result) { Logger.Log("JS", message); if (message.StartsWith("page count: ")) { int pageCount = int.Parse(message.Split(": ")[1]); ChapterLoaded?.Invoke(pageCount); } if (message == "swipe left") { SwipeLeft?.Invoke(); } if (message == "swipe right") { SwipeRight?.Invoke(); } if (message == "swipe down") { SwipeDown?.Invoke(); } if (message.StartsWith("word selected: ")) { string word = message.Split(": ")[1].Split('|')[0].Trim().ToLower(); string sentence = message.Split(": ")[1].Split('|')[1].Trim(); WordSelected?.Invoke(word, sentence); } result.Cancel(); return(true); }
void OnWordSelected(WordId?e) => WordSelected?.Invoke(this, e);