Centering Text

BlitzPlus Forums/BlitzPlus Beginners Area/Centering Text

How can I center the Text in a "CreateLabel" Gadget?

First, labels are not proper gadgets because they don't generate any events.

Second, if you are trying to centre it, what are you trying to centre it against?

Answering questions with questions...


MyText$ = "Try This On For Size"
TW = 14
CreateLabel( MyText$,x-((Len(MyText$)/2)*TW),y,Len(MyText$)*TW,20,mywin,mystyle)

This might help.. the 14 is a fudgefactor since I havn't tried this code out.. In theory it should work.

Thanks,
I will try this.