Class n.c.GroupBase(object):

Part of nevow.canvas View Source View In Hierarchy

Known subclasses: nevow.canvas.CanvasSocket, nevow.canvas.Group

No class docstring
Line # Kind Name Docs
105 Method call Call a client-side method with the given arguments. Arguments
117 Method reposition Reposition all the elements in this group
124 Method rotate Rotate all the elements of this group
130 Method alpha Set the alpha value of this group
136 Method line Draw a line from the current point to the given point.
145 Method move Move the pen to the given point.
154 Method pen Change the current pen attributes.
163 Method clear Clear the current pen attributes.
168 Method fill Set the current fill. Fill will not be drawn until close is called.
176 Method close Close the current shape. A line will be drawn from the end point
182 Method curve Draw a curve
187 Method gradient Draw a gradient. Currently the API for this sucks, see the flash documentation
198 Method text Place the given text on the canvas using the given x, y, height and width.
208 Method image Load an image from the URL "where". The result is an Image object which
218 Method sound Load an mp3 from the URL "where". The result is a Sound object which
229 Method group Create a new group of shapes. The returned object will
def call(self, method, *args): (source)
Call a client-side method with the given arguments. Arguments will be converted to strings. You should probably use the other higher-level apis instead.
def reposition(self, x, y): (source)
Reposition all the elements in this group
def rotate(self, angle): (source)
Rotate all the elements of this group
def alpha(self, percent): (source)
Set the alpha value of this group
def line(self, x, y): (source)

Draw a line from the current point to the given point.

(0,0) is in the center of the canvas.
def move(self, x, y): (source)

Move the pen to the given point.

(0, 0) is in the center of the canvas.
def pen(self, width=None, rgb=None, alpha=None): (source)

Change the current pen attributes.

width: an integer between 0 and 255; the pen thickness, in pixels. rgb: an integer between 0x000000 and 0xffffff alpha: an integer between 0 and 100; the opacity of the pen
def clear(self): (source)
Clear the current pen attributes.
def fill(self, rgb, alpha=100): (source)

Set the current fill. Fill will not be drawn until close is called.

rgb: color of fill, integer between 0x000000 and 0xffffff alpha: an integer between 0 and 100; the opacity of the fill
def close(self): (source)
Close the current shape. A line will be drawn from the end point to the start point, and the shape will be filled with the current fill.
def curve(self, controlX, controlY, anchorX, anchorY): (source)
Draw a curve
def gradient(self, type, colors, alphas, ratios, matrix): (source)
Draw a gradient. Currently the API for this sucks, see the flash documentation for info. Higher level objects for creating gradients will hopefully be developed eventually.
def text(self, text, x, y, height, width): (source)
Place the given text on the canvas using the given x, y, height and width. The result is a Text object which can be further manipulated to affect the text.
def image(self, where): (source)
Load an image from the URL "where". The result is an Image object which can be further manipulated to move it or change rotation.
def sound(self, where, stream=True): (source)

Load an mp3 from the URL "where". The result is a Sound object which can be further manipulated.

If stream is True, the sound will play as soon as possible. If false,
def group(self): (source)
Create a new group of shapes. The returned object will have all of the same APIs for drawing, except the grouped items can all be moved simultaneously, deleted, etc.
API Documentation for Nevow, generated by pydoctor.