PYME.LMVis.layers.text module¶
- class PYME.LMVis.layers.text.Text(text='', pos=(0, 0))¶
Bases:
BaseEngine
A text engine - the idea is for this to be used slightly differently than other rendering engines, in that, e.g. an annotation layer might have multiple Text instances for each annotation, rather than a 1:1 mapping between a layer and an engine as with other layers.
As currently written, it will only produce suitably sized text when used in a layer which uses screen pixel coords (i.e. projection and modelview matrices are the identity). This is currently just the LUTOverlayLayer.
TODO - allow scaled coordinates TODO - allow 3D positions TODO - rotation TODO - text colour TODO - Shader. My first instinct here would be to make the text values (as derived from the array) control transparency.
This should give an attractive anti-aliasing/blending effect, but we’d need to try it out in practice.
- classmethod gen_text_image(text='', size=12, font='courier')¶
- render(gl_canvas)¶
- set_texture(image)¶
- property text¶