let mouse clicks change active photo

This commit is contained in:
Colin McMillen 2023-07-08 00:18:31 -04:00
parent 5194fec400
commit 95397087d2

View File

@ -245,6 +245,17 @@ public class Game : GameWindow {
KeyboardState input = KeyboardState; 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)) { if (input.IsKeyDown(Keys.Escape)) {
Close(); Close();
} }