Exemplo n.º 1
0
 public void CreateLabelInfoTexts(Node node)
 {
     SuspendTextChanges();
     try
     {
         Texts.Clear();
         if (node is GroupNode)
         {
             AddLabelInfoText(OperationHelper.GetMenuStringByType(((GroupNode)node).NodeType), new FilterControlFocusInfo(node, 0), Owner.OwnerControl.AppearanceGroupOperatorColor, ElementType.Group, true);
             if (node.OwnerControl.ShowGroupCommandsIcon)
             {
                 AddLabelInfoText("@*", new FilterControlFocusInfo(node, 0), Color.Empty, ElementType.NodeAction, true);
             }
             AddLabelInfoText("@+", new FilterControlFocusInfo(node, 0), Color.Empty, ElementType.NodeAdd, true);
         }
         ClauseNode clauseNode = node as ClauseNode;
         if (clauseNode != null)
         {
             AddLabelInfoText(GetDisplayText(clauseNode.FirstOperand), new FilterControlFocusInfo(clauseNode, 0), Owner.OwnerControl.AppearanceFieldNameColor, ElementType.Property, true);
             AddSpace();
             AddLabelInfoText(OperationHelper.GetMenuStringByType(clauseNode.Operation), new FilterControlFocusInfo(clauseNode, 1), Owner.OwnerControl.AppearanceOperatorColor, ElementType.Operation, true);
             AddSpace();
             AddAdditionalOperands(clauseNode);
             AddLabelInfoText("@-", new FilterControlFocusInfo(node, 0), Color.Empty, ElementType.NodeRemove, true);
         }
     }
     finally
     {
         ResumeTextChanges();
     }
     Invalidate();
 }
Exemplo n.º 2
0
        public void LoadWorld(string levelName, Game1 game, bool clearMario = true)
        {
            var state = (game.Mario == null) ? null : game.Mario.State;

            game.LevelName = levelName;
            game.Map       = null;
            game.Mario     = null;
            Items.Clear();
            Enemies.Clear();
            Fireballs.Clear();
            Pipes.Clear();
            Background.Clear();
            Texts.Clear();
            MovingTexts.Clear();
            Achievements.Clear();
            Game1.Camera.Position = Vector2.Zero;
            LevelName             = levelName;
            string level = Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName) + "\\Content\\Levels\\" + levelName + ".csv";

            new LevelLoader(game, level);
            if (!clearMario)
            {
                if (state.Name == "Big")
                {
                    game.Mario.ToBig();
                }
                else if (state.Name == "Fire")
                {
                    game.Mario.ToFire();
                }
            }
        }
Exemplo n.º 3
0
 public void RefreshData()
 {
     Texts.Clear();
     ToIndex       = 0;
     FromIndex     = 0;
     FromSelect    = 0;
     ToSelect      = 0;
     CheckBoxGroup = new CheckBoxGroupModel();
 }
Exemplo n.º 4
0
        public void ChangeTextsByList(List <string> key, List <string> value)
        {
            Texts.Clear();

            int i = 0;

            foreach (var k in key)
            {
                Texts.Add(k, value[i]);
                i++;
            }
        }
Exemplo n.º 5
0
        public void SetByString(string str)
        {
            XmlDocument doc = new XmlDocument();

            doc.LoadXml(str);

            XmlNode root = doc.SelectNodes("/Texts")[0];

            _name   = root.SelectNodes("Name")[0].InnerText;
            _region = root.SelectNodes("Region")[0].InnerText;
            _code   = root.SelectNodes("Code")[0].InnerText;

            Texts.Clear();

            foreach (XmlNode it in root.SelectNodes("Text"))
            {
                string key   = it.Attributes["Key"].Value;
                string value = it.Attributes["Value"].Value;

                Texts.Add(key, value);
            }
        }
Exemplo n.º 6
0
 public void ClearText()
 {
     Texts.Clear();
 }
Exemplo n.º 7
0
        /// <summary>
        /// Start the title screen
        /// This happens at the beginning of the game, and when you're done playing
        /// </summary>
        public override void StartScene()
        {
            Texts.Clear();
            Sprites.Clear();

            // Add the title text
            AddText(new Text
            {
                Value            = "Space Invaders",
                Position         = new Vector2(0f, 80f),
                Alignment        = HorizontalAlignments.Center,
                AnimationType    = TextAnimations.Typewriter,
                AnimationSeconds = 0.15,
                Scale            = 1f,
                //Font = FancyFont,
                OnAnimationComplete = (Text text) =>
                {
                    // When the title text is done typing, show the high score
                    HighScoreText = AddText(new Text
                    {
                        Value              = "High Score:",
                        Position           = new Vector2(80f, 90f),
                        Alignment          = HorizontalAlignments.Center,
                        VerticalAlign      = VerticalAlignments.Top,
                        AnimationType      = TextAnimations.SeeSaw,
                        AnimationSeconds   = 0.2,
                        AnimationIntensity = 0.15,
                        Scale              = 0.4f,
                    });

                    UfoSprite ufo = AddSprite <UfoSprite>();
                    ufo.X         = -49;
                    ufo.Y         = 45;

                    Wait(2.3f, () =>
                    {
                        AlienSprite alien = AddSprite <AlienSprite>();
                        alien.X           = -40;
                        alien.Y           = 13;
                        alien.Setup(1);
                    });
                    Wait(5.2f, () =>
                    {
                        AlienSprite alien = AddSprite <AlienSprite>();
                        alien.X           = -40;
                        alien.Y           = -13;
                        alien.Setup(2);
                    });
                    Wait(8.7, () =>
                    {
                        AlienSprite alien = AddSprite <AlienSprite>();
                        alien.X           = -40;
                        alien.Y           = -43;
                        alien.Setup(3);
                    });


                    AlienScoreText = AddText(new Text
                    {
                        Value = "= ? POINTS" + Text.NewLine + Text.NewLine +
                                "= 10 POINTS" + Text.NewLine + Text.NewLine +
                                "= 20 POINTS" + Text.NewLine + Text.NewLine +
                                "= 30 POINTS",
                        Position         = new Vector2(0, 0),
                        Alignment        = HorizontalAlignments.Center,
                        VerticalAlign    = VerticalAlignments.Center,
                        AnimationType    = TextAnimations.Typewriter,
                        AnimationSeconds = 0.2,
                        Scale            = 0.8f,
                        Color            = Color.White
                    });
                }
            });

            // Add the 1p start key text
            Player1StartText = AddText(new Text
            {
                Value              = "1 Player Start",
                Position           = new Vector2(-65f, -85f),
                Alignment          = HorizontalAlignments.Center,
                VerticalAlign      = VerticalAlignments.Center,
                AnimationType      = TextAnimations.None,
                AnimationIntensity = 0.2,
                Scale              = 0.6f,
                Color              = Color.Lime
            });

            // Add the 2p start key text
            Player2StartText = AddText(new Text
            {
                Value              = "2 Player Start",
                Position           = new Vector2(65f, -85f),
                Alignment          = HorizontalAlignments.Center,
                VerticalAlign      = VerticalAlignments.Center,
                AnimationType      = TextAnimations.None,
                AnimationIntensity = 0.2,
                Scale              = 0.6f,
                Color              = Color.Lime
            });

            if (SpaceInvaders.NumberOfPlayers == 1)
            {
                Player1StartText.AnimationType = TextAnimations.Throb;
                Player1StartText.Scale         = 0.6f;
                Player1StartText.Start();
            }
            else
            {
                Player2StartText.AnimationType = TextAnimations.Throb;
                Player2StartText.Scale         = 0.6f;
                Player2StartText.Start();
            }
        }