Exemplo n.º 1
0
        /// <summary>
        /// Fills a console with random colors and characters.
        /// </summary>
        public void FillWithRandomGarbage(bool useEffect = false)
        {
            SadConsole.Effects.Blink pulse = new SadConsole.Effects.Blink();
            pulse.CloneOnApply = true;

            //pulse.Reset();
            int charCounter = 0;

            for (int y = 0; y < CellData.Height; y++)
            {
                for (int x = 0; x < CellData.Width; x++)
                {
                    CellData.SetCharacter(x, y, charCounter);
                    CellData.SetForeground(x, y, new Color(Engine.Random.Next(0, 256), Engine.Random.Next(0, 256), Engine.Random.Next(0, 256), 255));
                    CellData.SetBackground(x, y, CellData.DefaultBackground);
                    CellData.SetBackground(x, y, new Color(Engine.Random.Next(0, 256), Engine.Random.Next(0, 256), Engine.Random.Next(0, 256), 255));
                    CellData.SetSpriteEffect(x, y, (SpriteEffects)Engine.Random.Next(0, 4));
                    if (useEffect)
                    {
                        pulse.BlinkSpeed = ((float)Engine.Random.NextDouble() * 3f);
                        CellData.SetEffect(x, y, pulse);
                    }
                    charCounter++;
                    if (charCounter > 255)
                    {
                        charCounter = 0;
                    }
                }
            }
        }
Exemplo n.º 2
0
        public Target(Point spawnCoord)
        {
            Color targetColor = new Color(255, 0, 0);

            OriginCoord = spawnCoord;

            Cursor = new Actor("Target Cursor", targetColor, Color.Transparent, 'X', spawnCoord, (int)MapLayer.PLAYER)
            {
                IsWalkable    = true,
                CanBeKilled   = false,
                CanBeAttacked = false,
                CanInteract   = false,
                LeavesGhost   = false
            };

            /* ColoredGlyph frameCell = Cursor.Appearance;
             * frameCell.Foreground = Color.Transparent;
             * frameCell.Background = Color.Transparent;
             * frameCell.Glyph = 'X';
             *
             * Timer timer = new Timer(TimeSpan.FromSeconds(2.0));*/

            SadConsole.Effects.EffectsManager.ColoredGlyphState s = new SadConsole.Effects.EffectsManager.ColoredGlyphState(Cursor.Appearance);

            SadConsole.Effects.Blink blink = new SadConsole.Effects.Blink()
            {
                BlinkCount = -1,
                BlinkSpeed = 2.0,
                //BlinkOutColor = Color.Green,
                UseCellBackgroundColor = true
            };
            Cursor.Effect = blink;
            blink.Restart();
            //Cursor.AddComponent(new AnimationComponent(timer, Cursor.Appearance, frameCell));
        }
Exemplo n.º 3
0
        public void RefreshTool()
        {
            SadConsoleEditor.Settings.QuickEditor.TextSurface = Brush.Animation.Frames[0];
            SadConsoleEditor.Settings.QuickEditor.Fill(CharacterPickPanel.SharedInstance.SettingForeground,
                                                       CharacterPickPanel.SharedInstance.SettingBackground, 95);

            SadConsole.Effects.Blink blinkEffect = new SadConsole.Effects.Blink();
            blinkEffect.BlinkSpeed = 0.35f;
            blinkManager.SetEffect(Brush.Animation.Frames[0][0], blinkEffect);

            Brush.Animation.IsDirty = true;
        }
Exemplo n.º 4
0
        /// <summary>
        /// Fills a console with random colors and characters.
        /// </summary>
        public void FillWithRandomGarbage(bool useEffect = false)
        {
            Random rand = new Random();
            SadConsole.Effects.Blink pulse = new SadConsole.Effects.Blink();
            pulse.CloneOnApply = true;

            //pulse.Reset();
            int charCounter = 0;
            for (int y = 0; y < CellData.Height; y++)
            {
                for (int x = 0; x < CellData.Width; x++)
                {
                    CellData.SetCharacter(x, y, charCounter);
                    CellData.SetForeground(x, y, new Color(rand.Next(0, 256), rand.Next(0, 256), rand.Next(0, 256), 255));
                    CellData.SetBackground(x, y, CellData.DefaultBackground);
                    CellData.SetBackground(x, y, new Color(rand.Next(0, 256), rand.Next(0, 256), rand.Next(0, 256), 255));
                    CellData.SetSpriteEffect(x, y, (SpriteEffects)rand.Next(0, 4));
                    if (useEffect)
                    {
                        pulse.BlinkSpeed = ((float)rand.NextDouble() * 3f);
                        CellData.SetEffect(x, y, pulse);
                    }
                    charCounter++;
                    if (charCounter > 255)
                        charCounter = 0;
                }
            }

            
        }
Exemplo n.º 5
0
        public void FillWithRandomGarbage()
        {
            Random rand = new Random(2523);
            SadConsole.Effects.Blink pulse = new SadConsole.Effects.Blink();
            //pulse.Reset();
            int charCounter = 0;
            for (int y = 0; y < CellData.Height; y++)
            {
                for (int x = 0; x < CellData.Width; x++)
                {
                    CellData.SetCharacter(x, y, charCounter);
                    CellData.SetForeground(x, y, new Color(rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255), 255));
                    CellData.SetBackground(x, y, CellData.DefaultBackground);
                    CellData.SetBackground(x, y, new Color(rand.Next(0, 255), rand.Next(0, 255), rand.Next(0, 255), 255));
                    pulse.BlinkSpeed = ((float)rand.NextDouble() * 3f);

                    charCounter++;
                    if (charCounter > 255)
                        charCounter = 0;
                }
            }
        }
Exemplo n.º 6
0
        public void RefreshTool()
        {
            Settings.QuickEditor.TextSurface = Brush.Animation.Frames[0];
            Settings.QuickEditor.Fill(CharacterPickPanel.SharedInstance.SettingForeground,
                                      CharacterPickPanel.SharedInstance.SettingBackground, 95);

            SadConsole.Effects.Blink blinkEffect = new SadConsole.Effects.Blink();
            blinkEffect.BlinkSpeed = 0.35f;
            blinkManager.SetEffect(Brush.Animation.Frames[0][0], blinkEffect);
        }