File: texttest.py

package info (click to toggle)
python-visual 1%3A5.12-1.6
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch
  • size: 7,708 kB
  • ctags: 7,635
  • sloc: cpp: 15,593; sh: 9,615; ansic: 6,631; python: 4,737; makefile: 384
file content (25 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
from visual.text import *

# Display extruded text (uppercase only at present)
# By default, display text along x axis, with letters pointing up parallel to y axis
# Bruce Sherwood, Carnegie Mellon University, begun March 2000

# Example with default values:
#  text(pos=(0,0,0), axis=(1,0,0), string='ABC',
#    height=1, depth=0, width=1,
#    color=currentdisplay.foreground, up=(0,1,0.3))
# axis is direction along which text advances
# if width not specified, it is the same as height
# depth is measured forward from pos
# Only numbers and uppercase letters at present: others display as '*'

scene.title = "3D Text"
scene.fov = 0.001
scene.range = 7
text(pos=(0,3,0), string='ABC', color=color.red, depth=0.3, justify='center')
text(pos=(0,-3,0), string='DEF', color=color.blue, depth=0.3, justify='center')
message = text(pos=(0,0,0), string='CLICK TO CHANGE THIS', justify='center',
               color=color.yellow, axis=(1,0,1),
                depth=0.3, up=(0,1,-0.3))
scene.mouse.getclick()
message.reshape(color=color.cyan, height=2)