| |
 |  |  |
 | Command |  | Argument |  | Datatype |  | Default |
 | Min |
 | Max |  |  |
 | Format: |
 | MakeTextObj |
| Name = Object name, |  | STRING |  |
- |  | - |  | - |  |  | |  |
| | Width = Board width in Å, |
 | FLOAT |  | - |  | - |
 | - |
 |  | |  |
| | Height = Board height in Å |  | FLOAT |  | - |  | - |  | - |
 |  |  | Python: |  | result = MakeTextObj(name,width,height) |
 |  |  | Menu: |  | Effects > Text > Make object |  |  |
 | Related: |
 | Font
, PosText, MoveMesh
, Print, PrintObj
, PrintCon, PrintHUD
|  |  |
 | Required: |  |  |  |
 |
The MakeTextObj
command creates an invisible text board of the given width and height. You can then use
PosText to move to a certain position on the board,
choose a Font and Print
some text. The printed text will wrap around the invisible horizontal borders of the text board. When done,
direct the output of the Print command back to the console using
PrintCon.
Especially when the letters are small, they may not look as good as a fully antialiased true-type font. The following hints improve the result:
- If only a picture is needed, use the RayTrace command, which performs high-quality antialiasing.
- If you have a powerful graphics card, try to activate fullscreen antialiasing in the OpenGL settings. While this reduces the clarity of bitmap fonts in the head-up display or the menus, the 3D text objects look much better.
- If you create an MPEG movie, make the YASARA window twice as large as the final MPEG movie resolution. Then the content of the YASARA window has to be scaled down, which delivers antialiasing for free.
If there is a lot of text to print, an alternative is to use a program like Powerpoint,
GIMP, Paint etc. and create a bitmap of the text, which can then be displayed with
LoadPNG/ LoadBMP
and ShowImage. LoadPNG
is the preferred solution, as PNG images are compressed and contain an alpha channel that can be used to create antialiased text.
The created text rotates around the origin of its local coordinate system
, which is at the center of the text board. Use the MoveMesh
command to shift the origin.
Example 1:
MakeTextObj Name=Title,Width=80,Height=40
Create a text board object named Title, 80x40 Angstroms large and prepare to print text to it.
Example 2:
obj = MakeTextObj Name=Title,Width=80,Height=40
As above, and assign the number of the new object to variable
'obj'.
Example macro:
# EXAMPLE MakeTextObj
# Requires YASARA Model
#
# Define the style sheet
Page='Page,Width=100,Height=80'
# The fonts
Heading1Font='Arial,Height=5,Color=White,Depth=2,DepthCol=000000'
Heading2Font='Arial,Height=4,Color=White,Depth=1,DepthCol=000000'
StandardFont='Times,Height=3,Color=White,Depth=0'
# The indentation levels
Heading1PosX=0
Heading2PosX=5
StandardPosX=10
# Create a page
Clear
Console Off
MakeTextObj (Page)
text='Heading1',"YASARA - an overview",
'Heading2', "- Molecular graphics",
'Standard', "- Optimized OpenGL+ engine",
'Standard', "- Multimedia, YASARA/MPEG movies",
'Heading2', "- Molecular modeling",
'Standard', "- Building of small to big molecules",
'Standard', "- Extensive structure analysis",
'Heading2', "- Molecular simulations",
'Standard', "- Highest performance, PVL assembly code",
'Standard', "- New force fields, optimized for modeling"
lines=count text/2
for i=1 to lines
style=text(i*2-1)
Font ((style)Font)
PosText ((style)PosX)%,((lines-i)*100/lines)%,justify=Left
Print (text(i*2))
# Animate the page
ColorBG 800000,ff8000
Pos 16,5,0
Ori 51,346,0
AutoMoveTo 0,0,120,Steps=300,Wait=No
AutoRotateTo 0,0,0,Steps=300,Wait=No
Wait 150
 | | Figure: Result of the example macro above. |
|