Reply To: Paragraph/textblock/label text alignment

#2706
Csilla Mai
Keymaster

Hi James,

I hope this short script will help you with the alignment problem:

! fontType and fontSize are parameters

define style{2} "NormalStyle" fontType, fontSize, 0		
style "NormalStyle"

if sgn(LABEL_POSITION[2][1]) = -1 then
	_iAlign = 3
else
	_iAlign = 1
endif

paragraph "paragraphName" _iAlign,
		0, 0, 0,
		1
		style "NormalStyle"
		"sample Text of Label"
    endparagraph

_textblockWidth = 7 ! Just for example

textblock "stTextblockName" _textblockWidth,
	1, 0, 1, 1, 0,
	"paragraphName"

richtext2 0, 0, "stTextblockName"

It results the behaviour you can see on the attached picture. If it does not solve your problem, please upload the 2D script or the object which you are working on.

Attachments:

Csilla Mai
Library Developer, Library Team
GRAPHISOFT SE