From 95397087d243d31d265941bb2446f7b30389fb30 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 8 Jul 2023 00:18:31 -0400 Subject: [PATCH] let mouse clicks change active photo --- Program.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Program.cs b/Program.cs index 862f94b..a54b545 100644 --- a/Program.cs +++ b/Program.cs @@ -245,6 +245,17 @@ public class Game : GameWindow { KeyboardState input = KeyboardState; + if (MouseState.IsButtonPressed(0)) { + for (int i = 0; i < geometry.ThumbnailBoxes.Count; i++) { + Box2i box = geometry.ThumbnailBoxes[i]; + if (box.ContainsInclusive((Vector2i) MouseState.Position)) { + if (0 <= i && i < textures.Count) { + textureIndex = i; + } + } + } + } + if (input.IsKeyDown(Keys.Escape)) { Close(); }