예제 #1
0
        // Use scroll wheel to move camera up and down if we have loads of options?

        #endregion

        #region Callbacks

        /// <summary>
        /// Syncs our button's value with our options is full screen option
        /// </summary>
        /// <param name="button"></param>
        private void SyncOptionsIsFullScreen(ClickableImage image)
        {
            Button button = image as Button;
            DebugUtils.AssertNotNull(button);

            OptionsManager.IsFullScreen = !OptionsManager.IsFullScreen;
            button.Label.Text = OptionsManager.IsFullScreen.ToString();
        }
예제 #2
0
        /// <summary>
        /// Serializes all the UIObjects in our level editor into an XML data file.
        /// </summary>
        protected void SerializeLevel(ClickableImage image)
        {
            LevelDesignScreenData levelData = ScreenData.As<LevelDesignScreenData>();
            DebugUtils.AssertNotNull(levelData);

            levelData.ClearAll();

            // Need to check for the alive ones because although the objects are cleaned up from the Screen Managers, they will still linger in the other lists

            // Serialize normal tiles to level data
            foreach (LevelDesignObject levelObject in LevelObjects[LevelDesignType.kNormalTile].FindAll(x => x.IsAlive.Value))
            {
                levelData.NormalTiles.Add(SerializeLevelObject(levelObject));
            }

            // Serialize collision tiles to level data
            foreach (LevelDesignObject levelObject in LevelObjects[LevelDesignType.kCollisionTile].FindAll(x => x.IsAlive.Value))
            {
                levelData.CollisionTiles.Add(SerializeLevelObject(levelObject));
            }

            // Serialize normal decals to level data
            foreach (LevelDesignObject levelObject in LevelObjects[LevelDesignType.kNormalDecal].FindAll(x => x.IsAlive.Value))
            {
                levelData.NormalDecals.Add(SerializeLevelObject(levelObject));
            }

            // Serialize collision decals to level data
            foreach (LevelDesignObject levelObject in LevelObjects[LevelDesignType.kCollisionDecal].FindAll(x => x.IsAlive.Value))
            {
                levelData.CollisionDecals.Add(SerializeLevelObject(levelObject));
            }

            // Load our previously serialized level here
            AssetManager.SaveData(levelData, ScreenDataAsset);
        }
예제 #3
0
        /// <summary>
        /// Changes the object we will be adding to our level.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void SetCurrentSelectedObject(ClickableImage image)
        {
            DebugUtils.AssertNotNull(image);

            RemoveScreenUIObject(CurrentSelectedObject);

            CurrentSelectedObject = AddScreenUIObject(new Image(TileSize, Vector2.Zero, (string)image.StoredObject), true, true) as Image;
            CurrentSelectedObject.StoredObject = image.StoredObject;
            CurrentSelectedObject.SetParent(GameMouse.Instance);

            GameMouse.Instance.IsFlushed = true;
        }
예제 #4
0
 private void Generate(ClickableImage image)
 {
     GenerationEngine engine = new GenerationEngine(this, null);
     engine.GenerateLevel();
 }
예제 #5
0
 /// <summary>
 /// The callback to execute when we press the 'Exit' button
 /// </summary>
 /// <param name="image">Unused</param>
 protected virtual void OnExitGameButtonClicked(ClickableImage image)
 {
     ScreenManager.Instance.EndGame();
 }
예제 #6
0
 /// <summary>
 /// The callback to execute when we press the 'Options' button
 /// </summary>
 /// <param name="image">The image that was clicked</param>
 protected virtual void OnOptionsButtonClicked(ClickableImage image)
 {
     Transition(new OptionsScreen(this));
 }
예제 #7
0
 /// <summary>
 /// The callback to execute when we press the 'Play' button
 /// </summary>
 /// <param name="image">The image that was clicked</param>
 protected virtual void OnPlayGameButtonClicked(ClickableImage image)
 {
     Transition(new PlatformGameplayScreen("Content\\Data\\Screens\\Levels\\Level1.xml"));
 }
예제 #8
0
 /// <summary>
 /// The callback to execute when we press the 'Play' button
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected virtual void OnPlayGameButtonClicked(ClickableImage image)
 {
     Transition(new LevelDesignScreen("Content\\Data\\Levels\\Level1.xml"));
 }