Example #1
0
        public void OnLeftClick(Vector2 position, ClickState click, GameTime time)
        {
            position = position.RelativeTo (screen.viewport);
            Console.WriteLine ("ColorPicker.OnLeftClick: positon=" + position);
            int i = 0;
            foreach (Vector2 tile in tiles) {
                Console.WriteLine ("ColorPicker: tile=" + tile + "  "
                                   + (tile.X <= position.X) + " " + (tile.X + tileSize.X > position.X) + " " + (
                                       tile.Y <= position.Y) + " " + (tile.Y + tileSize.Y > position.Y)
                                  );
                if (tile.X <= position.X && tile.X + tileSize.X > position.X
                        && tile.Y <= position.Y && tile.Y + tileSize.Y > position.Y) {
                    Console.WriteLine ("ColorPicker: color=" + colors [i]);

                    SelectColor (colors [i]);
                }
                ++i;
            }
        }