Ejemplo n.º 1
0
    def circle(self, X1, R1, segs):
        """
            circle(<tuple>,<radius>, <segments>)

            Will draw a ...

            .. doctest::

               >>> import fbpy.fb as fb
               
               >>> main = fb.Surface()

               >>> sub = fb.Surface((0,0), (200,200))

               >>> sub.clear()
               0
               >>> sub.circle((100,100),0.5, 100)
               0
               >>> sub.grabsilent("./source/images/circle.png")
               0
              
            .. image:: ./images/circle.png


        """
        fblib.fbarc(X1[0], X1[1], R1 * self.size[0], R1 * self.size[1], 0,
                    segs, segs)
        return 0
Ejemplo n.º 2
0
    def circle(self, X1, R1, segs):
        """
            circle(<tuple>,<radius>, <segments>)

            Will draw a ...

            .. doctest::

               >>> import fbpy.fb as fb
               
               >>> main = fb.Surface()

               >>> sub = fb.Surface((0,0), (200,200))

               >>> sub.clear()
               0
               >>> sub.circle((100,100),0.5, 100)
               0
               >>> sub.grabsilent("./source/images/circle.png")
               0
              
            .. image:: ./images/circle.png


        """
        fblib.fbarc(X1[0],X1[1],R1*self.size[0],R1*self.size[1],0,segs,segs) 
        return 0
Ejemplo n.º 3
0
    def arc(self, X1, R1, R2, startseg, endseg, segs):
        """
            arc(<tuple>, <radius 1>, <radius 2>, <start seg>, <end seg>, <no seg>)

            couple of examples here:

            .. doctest::

               >>> import fbpy.fb as fb
               
               >>> main = fb.Surface()

               >>> sub = fb.Surface((0,0), (200,200))

               >>> sub.clear()
               0
               >>> sub.pixelstyle = fb.Pixelstyles.faint

               >>> sub.arc((100,100), 60, 90, 0, 50, 100)
               0
               >>> sub.pixelstyle = fb.Pixelstyles.sharp

               >>> sub.arc((100,100), 40, 40, 30, 90, 100)
               0
               >>> sub.grabsilent("./source/images/arc.png")
               0
              
            .. image:: ./images/arc.png

        """

        if type(R1) == float:
            rx=self.size[0] * R1/2
        else:
            rx = R1
        if type(R2) == float:
            ry=self.size[1] * R2/2
        else:
            ry = R2
            
        fblib.fbarc(X1[0], X1[1], rx, ry, startseg, endseg, segs)  
        return 0
Ejemplo n.º 4
0
    def arc(self, X1, R1, R2, startseg, endseg, segs):
        """
            arc(<tuple>, <radius 1>, <radius 2>, <start seg>, <end seg>, <no seg>)

            couple of examples here:

            .. doctest::

               >>> import fbpy.fb as fb
               
               >>> main = fb.Surface()

               >>> sub = fb.Surface((0,0), (200,200))

               >>> sub.clear()
               0
               >>> sub.pixelstyle = fb.Pixelstyles.faint

               >>> sub.arc((100,100), 60, 90, 0, 50, 100)
               0
               >>> sub.pixelstyle = fb.Pixelstyles.sharp

               >>> sub.arc((100,100), 40, 40, 30, 90, 100)
               0
               >>> sub.grabsilent("./source/images/arc.png")
               0
              
            .. image:: ./images/arc.png

        """

        if type(R1) == float:
            rx = self.size[0] * R1 / 2
        else:
            rx = R1
        if type(R2) == float:
            ry = self.size[1] * R2 / 2
        else:
            ry = R2

        fblib.fbarc(X1[0], X1[1], rx, ry, startseg, endseg, segs)
        return 0