Class pyglet.text.formats.structured.ImageElement

document.InlineElement --+
                         |
                        ImageElement

Methods

  __init__(self, image, width=None, height=None)
  place(self, layout, x, y)
Construct an instance of the element at the given coordinates.
  remove(self, layout)
Remove this element from a layout.

Properties

int position
Position of the element within the document.
(Inherited from pyglet.text.document.InlineElement)

Instance Variables

int advance
Width of the element, in pixels.
(Inherited from pyglet.text.document.InlineElement)
int ascent
Ascent of the element above the baseline, in pixels.
(Inherited from pyglet.text.document.InlineElement)
int descent
Descent of the element below the baseline, in pixels.
(Inherited from pyglet.text.document.InlineElement)

Method Details

__init__

(Constructor) __init__(self, image, width=None, height=None)
Overrides:
document.InlineElement.__init__

place

place(self, layout, x, y)

Construct an instance of the element at the given coordinates.

Called when the element's position within a layout changes, either due to the initial condition, changes in the document or changes in the layout size.

It is the responsibility of the element to clip itself against the layout boundaries, and position itself appropriately with respect to the layout's position and viewport offset.

The TextLayout.top_state graphics state implements this transform and clipping into window space.

Overrides:
document.InlineElement.place

remove

remove(self, layout)

Remove this element from a layout.

The counterpart of place; called when the element is no longer visible in the given layout.

Overrides:
document.InlineElement.remove