gillcup_graphics.effectlayer

A Layer that provides some bling

With EffectLayer, it is possible to colorize, fade, or pixelate groups of graphics objects.

This wors by rendering the layer’s contents to a texture, and then drawing the texture with effects applied. Currently, it needs the Framebuffer Object (FBO) OpenGL extension to work.

Note

This code is experimental. Expect it to not work.

class gillcup_graphics.EffectLayer(parent=None, **kwargs)[source]

A Layer that can colorize, fade, or pixelate its contents as a whole

Animated Properties:

color

Color or tint of the object

The individual components are in the red, green, blue attributes.

opacity

Opacity of the object

mosaic

Pixelation of this layer

For example, if mosaic=(2, 4), the layer will be drawn using 2×4 blocks

need_offscreen()[source]

Return true if off-screen rendering is needed

Off-screen rendering is only done if needed, i.e. if color, opacity or mosaic don’t have their default values.

Subclasses should extend this method if they need off-screen rendering in more circumstances.

class gillcup_graphics.effectlayer.RecordingLayer(parent=None, **kwargs)[source]

A layer that records its contents as an image

After this layer is drawn, the picture is available in the last_image attribute as a pyglet ImageData object.

get_image(width, height)[source]

Draw this layer in a new invisible window and return the ImageData