Ejemplo n.º 1
0
        public override void UpdateSignalCore(bool signal, bool init, bool animate)
        {
            if (animate)
            {
                if (!Game.Content.Animations.FieldWireToConnected.Revert(m_displayBackSprite))
                {
                    Game.Content.Animations.FieldWireToConnected.Apply(m_displayBackSprite, !signal);
                }

                if (!Game.Content.Animations.FieldDisplayToConnected.Revert(m_displayFrontSprite))
                {
                    Game.Content.Animations.FieldDisplayToConnected.Apply(m_displayFrontSprite, !signal);
                }
            }
            else
            {
                m_displayBackSprite.SetColor(signal ? Game.Content.Colors.WireConnected : Game.Content.Colors.WireDisconnected);
                m_displayFrontSprite.SetColor(signal ? Game.Content.Colors.DisplayConnected : Game.Content.Colors.DisplayDisconnected);
            }

            m_globeSprite.Visible   = signal;
            m_spinnerSprite.Visible = !signal;

            m_field.ConnectedDisplaysCount += (signal ? 1 : (init ? 0 : -1));
        }
Ejemplo n.º 2
0
        public void SetInitialStatus(LevelDescriptor descriptor, int connectedDisplaysCount, int displaysCount)
        {
            float scale          = 1f;
            float difficultScale = scale / 2;
            var   padding        = new Vector2(8, 2);

            m_levelIndex.SetParams('#' + (descriptor.Index + 1).ToString(), scale, padding);
            m_levelSizeLabel.SetParams(descriptor.Width + " x " + descriptor.Height, scale, padding);
            m_levelDifficult.ScaleX = difficultScale;
            m_levelDifficult.ScaleY = difficultScale;
            m_levelDifficult.SetColor(Game.Content.Colors.DifficultColors[descriptor.Difficult]);
            m_conectedLabel.SetParams(connectedDisplaysCount.ToString() + " / " + displaysCount.ToString(), scale, padding);

            m_levelIndex.X = m_levelIndex.Width / 2 + m_spacing;
            m_levelIndex.Y = m_levelIndex.Height / 2 + m_spacing;

            m_levelSizeLabel.X = m_levelIndex.X + m_levelIndex.Width / 2 + m_levelSizeLabel.Width / 2 + m_spacing;
            m_levelSizeLabel.Y = m_levelIndex.Y;

            m_levelDifficult.X = m_levelSizeLabel.X + m_levelSizeLabel.Width / 2 + m_levelDifficult.Width * m_levelDifficult.ScaleX / 2 + m_spacing;
            m_levelDifficult.Y = m_levelIndex.Y;

            m_conectedLabel.X = m_conectedLabel.Width / 2 + m_spacing;
            m_conectedLabel.Y = m_levelIndex.Y + m_levelIndex.Height / 2 + m_conectedLabel.Height / 2 + m_spacing;
        }