コード例 #1
0
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            MeshBlock block = GetFirstBlock(renderer);

            if (block == null)
            {
                // This can happen if an animation is requesting that a now offscreen element gets painted only.
                return;
            }

            block.PaintColour(BaseColour * renderer.ColorOverlay);
        }
コード例 #2
0
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            Color colour = Colour * renderer.ColorOverlay;

            MeshBlock block = GetFirstBlock(renderer);

            // For each block..
            for (int i = 0; i < BlockCount; i++)
            {
                // Paint the colour:
                block.PaintColour(colour);

                // Go to next block:
                block.Next();
            }
        }
コード例 #3
0
ファイル: BackgroundImage.cs プロジェクト: ru-ace/spark
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            // Any meshes in this elements queue should now change colour:
            Color colour = renderer.ColorOverlay;

            MeshBlock block = GetFirstBlock(renderer);

            // For each block..
            for (int i = 0; i < BlockCount; i++)
            {
                // Paint the colour:
                block.PaintColour(colour);

                // Go to next block:
                block.Next();
            }
        }
コード例 #4
0
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            // Any meshes in my queue should now change colour:
            MeshBlock block = GetFirstBlock(renderer);

            if (BaseColour == null || BaseColour.Count == 1)
            {
                // Most common case. This is a single colour border.

                // Get the default colour - that's the same as the text colour:
                Color colour = Color.black;

                // Does this border have a colour?
                if (BaseColour == null)
                {
                    // Grab the text colour if there is one:
                    if (RenderData.Text != null)
                    {
                        // It's the same as the font colour:
                        colour = RenderData.Text.BaseColour * renderer.ColorOverlay;
                    }
                    else
                    {
                        // Nope - We need to set alpha:
                        colour.a = renderer.ColorOverlay.a;
                    }
                }
                else
                {
                    colour = BaseColour[0].GetColour(RenderData, Css.Properties.BorderColor.GlobalProperty) * renderer.ColorOverlay;
                }

                // For each block..
                for (int i = 0; i < BlockCount; i++)
                {
                    // Paint the colour:
                    block.PaintColour(colour);

                    // Go to next block:
                    block.Next();
                }

                return;
            }
        }
コード例 #5
0
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            // Does the given renderer belong to the worldUI?
            if (Renderer != null && renderer == Renderer.Renderer)
            {
                // Yes! We're actually drawing the element. Do nothing.
                return;
            }

            MeshBlock block = GetFirstBlock(renderer);

            if (block == null)
            {
                // This can happen if an animation is requesting that a now offscreen element gets painted only.
                return;
            }

            block.PaintColour(renderer.ColorOverlay);
        }
コード例 #6
0
        public override void Paint(LayoutBox box, Renderman renderer)
        {
            // Resolve colour:
            BaseColour = RenderData.computedStyle.Resolve(Css.Properties.ColorProperty.GlobalProperty)
                         .GetColour(RenderData, Css.Properties.ColorProperty.GlobalProperty);

            Color colour = BaseColour * renderer.ColorOverlay;

            MeshBlock block = GetFirstBlock(renderer);

            // For each block..
            for (int i = 0; i < BlockCount; i++)
            {
                // Paint the colour:
                block.PaintColour(colour);

                // Go to next block:
                block.Next();
            }
        }