Home | Trees | Indices | Help |
|
---|
|
object --+ | ScaledSprite
Instance Methods | |||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
Properties | |
Inherited from |
Method Details |
ScaledSprite Object -- pype's main tool for graphics generation. This is a basic sprite object. The improvement here is that the sprite has both a real size (rwidth x rheight) and a display size (dwidth x dheight). If these match, it's a standard Sprite object. If they don't match, the coordinate system for sprite makes it look like it's display size, so gratings etc are computed properly. But only rwidth x rheight pixels are kepts around, so you can use coarse sprites plus OpenGL scaling to get more speed. The standard Sprite class is now a subclass of ScaledSprite with rwidth==dwidth and rheight==dheight..
|
Sprite clean up. Remove the name of the sprite from the global list of sprites to facilitate detection of un-garbage collected sprites |
|
|
Convert sprite to a Tkinter displayable PhotoImage. This depends on the python imaging library (PIL)
|
Convert sprite to a PIL Image. This depends on the python imaging library (PIL)
|
Set global alpha value. Set transparency of the entire sprite to this value.
|
Draw line of specified color in sprite. NB not the same syntax as the FrameBuffer.line() method!!
|
Fill sprite with specficied color. Like clear method above, but requires color to be specified
|
Clear sprite to specified color. Set's all pixels in the sprite to the indicated color, or black if no color is specified.
|
Fill sprite with white noise. Fill sprite with binary white noise. Threshold can be used to specified the DC level of the noise.
|
Draw filled circle in sprite. Only pixels inside the circle are affected.
|
Draw filled circle into sprite. Pixels inside the specified circle are filled to specified color. If mask is True (default), the rest of the sprite is set to be 100% transparent (alpha=0).
|
Draw a filled rectangle of the specifed color on a sprite. NB - parameter sequence is not the same order as circlefill()
|
Lossy rotation of spite image data. CW rotation of sprite about the center using pygame.transform primitives. This is a non-invertable deformation -- multiple rotations will accumulate errors, so if you're doing that, keep an original copy and rotate the copy each time.
|
Fast resizing of sprite using pygame.rotozoom. Can scale up or down equally well. Changes the data within the sprite, so it's not really invertable. If you want to save the original image data, first clone() and then scale(). Warning: in general, this is obsolete -- you should use xscale/yscale to do scaling through the GL pipeline
|
Apply hard-edged circular vignette/mask in place. This works by setting pixels outside the specified region to
(0,0,0,0). Formerly known as |
|
Add soft-edged apperature (gradient vignette) Vignette the sprite using a soft, linear, circular aperture. This draws a linearly ramped mask of the specified size into the alpha channel.
|
Add soft-edged apperature (gradient vignette) Like alpha_gradient() above, but mask is applied directly to the image data by doing alpha blending in software, under the assumption that the background is a solid fill of value 'bg'.
|
Reduce sprite contrast Reduce sprite's contrast. Modifies sprite's image data. v = (1-mult)*(v-mean), where v is the pixel values. NB This assumes the mean value of the image data is 'meanval', which is not always the case. If it's not, then you need to compute and pass in the mean value explicitly.
|
Threshold sprite image data Threshold (binarize) sprite's image data v = (v > thresh) ? 255 : 1, where v is pixel value
|
|
|
|
Relative move. Shifts sprite by dx,dy pixels relative to current position.
|
Copy sprite to screen (block transfer).
|
Extract sub-region of sprite into new sprite. Generates a new sprite containing image data from specified sub-region of this sprite. Image data is copied, not shared or referenced -- changes to result will not affet original.
|
Duplicate sprite (aka deepcopy). Create no sprite with all the same data, including image and alpha, duplicated. Like subimage, data are copied, not referenced, so changes to clone will not affect parent. |
Write sprite as image to file Image is saved to file using pygame image tools. Filename extension determines the output format (png and jpg ok). If the sprite is scaled or anything like that, it will be saved as displayed, which may not match the in-memory image data. |
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sat Nov 17 00:22:04 2018 | http://epydoc.sourceforge.net |