Beispiel #1
0
        private void RemoveObjectIfOffscreen(GameObject gameObject)
        {
            if (!ObjectPastEndOfQueue(gameObject))
            {
                return;
            }

            ChildObjects.Remove(gameObject);
            _offScreenObjects.Add(new OffscreenQueueObject
            {
                DistanceToWait = GenerateDistance(),
                Object         = gameObject
            });
        }
        /// <summary>
        /// Removes an image from our overlay list
        /// </summary>
        private void Menu_Remove(object sender, EventArgs e)
        {
            if (SelectedOverlay == null)
            {
                return;
            }

            string msg = "Are you sure you want to remove " + SelectedOverlay.Name + "?";

            if (MessageBox.Show(msg, "Remove image",
                                MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
            {
                return;
            }

            // Remove the image
            ChildObjects.Remove(SelectedOverlay);
            SelectedOverlay.Dispose();
            SelectedOverlay = null;
        }