Exemplo n.º 1
0
    public override void Draw(Gdk.Rectangle cliprect)
    {
        if (!cliprect.IntersectsWith(new Gdk.Rectangle((int) X, (int) Y, (int) Width, (int) Height)))
            return;
        float left = X;
        float right = X + Width;
        float top = Y;
        float bottom = Y + Height;

        float[] current_color = new float[4];
        gl.GetFloatv( gl.CURRENT_COLOR, current_color );
        //get current color, might be transparent
        gl.Color4f(Color.Red, Color.Green, Color.Blue, current_color[3] * Color.Alpha);
        gl.Disable(gl.TEXTURE_2D);

        gl.Begin(gl.QUADS);
        gl.Vertex2f(left, top);
        gl.Vertex2f(right, top);
        gl.Vertex2f(right, bottom);
        gl.Vertex2f(left, bottom);
        gl.End();

        gl.Enable(gl.TEXTURE_2D);
        gl.Color4fv( current_color );
    }
Exemplo n.º 2
0
    public override void Draw(Gdk.Rectangle cliprect)
    {
        if (!cliprect.IntersectsWith((Gdk.Rectangle) Area))
            return;
        if(Sprite == null)
            return;

        Sprite.Draw(new Vector(X*32 + 16, Y*32 + 16));
    }
Exemplo n.º 3
0
 public virtual void Draw(Gdk.Rectangle cliprect)
 {
     if(Sprite == null)
         return;
     if (cliprect.IntersectsWith((Gdk.Rectangle) Area))
         Sprite.Draw(new Vector(X, Y));
 }
Exemplo n.º 4
0
 public override void Draw(Gdk.Rectangle cliprect)
 {
     if(Sprite == null)
         return;
     if (cliprect.IntersectsWith((Gdk.Rectangle) Area))
     {
         Sprite.Draw(new Vector(X, Y));
         Sprite.Draw(new Vector(X+Sprite.Width, Y));
     }
 }
Exemplo n.º 5
0
    public override void Draw(Gdk.Rectangle cliprect)
    {
        if (!cliprect.IntersectsWith((Gdk.Rectangle) Area))
            return;
        // Draw sprite
        if(Sprite == null)
            return;

        Sprite.Draw(new Vector(X, Y));
        // Draw a color rectangle
        DrawColor(magiccolor);
    }
Exemplo n.º 6
0
 public override void Draw(Gdk.Rectangle cliprect)
 {
     if(Sprite == null)
         return;
     if (cliprect.IntersectsWith((Gdk.Rectangle) Area))
     {
         Sprite.Draw(new Vector(X-128-Sprite.Width/2, Y-Sprite.Height/2));
         Sprite.Draw(new Vector(X+128-Sprite.Width/2, Y-Sprite.Height/2));
     }
 }
Exemplo n.º 7
0
        public void Draw(Context cr, Gdk.Rectangle clip)
        {
            cr.LineWidth = style.PenSize;

            for(int i = 1; i < count; i++) {
                Gdk.Rectangle rect = new Gdk.Rectangle();
                rect.X = (int)((x[i] < x[i-1]) ? x[i] : x[i-1]);
                rect.Y = (int)((y[i] < y[i-1]) ? y[i] : y[i-1]);
                rect.Width = (int)((x[i] < x[i-1]) ? x[i-1]-x[i] : x[i]-x[i-1]);
                rect.Height = (int)((y[i] < y[i-1]) ? y[i-1]-y[i] : y[i]-y[i-1]);

                if(clip.IntersectsWith(rect)) {
                    cr.MoveTo(x[i-1], y[i-1]);
                    cr.LineTo(x[i], y[i]);

                    LinearGradient g = new LinearGradient(x[i-1], y[i-1], x[i], y[i]);
                    g.AddColorStop(0.0, color[i-1]);
                    g.AddColorStop(1.0, color[i]);

                    cr.Pattern = g;
                    cr.Stroke();
                }
            }
        }