Vertical font alignment - not available in text gadgets ?

You need some new stunning features ? Tell us here.
agb2008
User
User
Posts: 60
Joined: Fri Jan 15, 2016 2:22 pm

Vertical font alignment - not available in text gadgets ?

Post by agb2008 »

Just another quick question - when I use text gadgets it seems that there is no
option to align text - so that it would be centered in terms of vertical alignment -
am I correct ? Text would be displayed at the top of gadget... Same thing happens
for string gadgets. Any possible workaround ?
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Vertical font alignment - not available in text gadgets

Post by TI-994A »

agb2008 wrote:...there is no option to align text - so that it would be centered in terms of vertical alignment - am I correct ? ... Any possible workaround ?
Yes, you are correct. :wink:

As for workarounds, there are many offered in this forum. Here's a fairly old one, recently infused with some new suggestions:

>> StringGadget Vertical
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
User avatar
RSBasic
Moderator
Moderator
Posts: 1218
Joined: Thu Dec 31, 2009 11:05 pm
Location: Gernsbach (Germany)
Contact:

Re: Vertical font alignment - not available in text gadgets

Post by RSBasic »

Vertical align (center) for TextGadget:

Code: Select all

EnableExplicit

If OpenWindow(0, 0, 0, 500, 400, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  TextGadget(1, 10, 10, 480, 400, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", #SS_CENTERIMAGE)
  
  Repeat
    Select WaitWindowEvent()
      Case #PB_Event_CloseWindow
        End
    EndSelect
  ForEver
EndIf
Image
Image
User avatar
TI-994A
Addict
Addict
Posts: 2512
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Vertical font alignment - not available in text gadgets

Post by TI-994A »

RSBasic wrote:

Code: Select all

TextGadget(1, 10, 10, 480, 400, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit.", #SS_CENTERIMAGE)
It should be noted that the SS_CENTERIMAGE flag is a Windows-only style setting, which only works with the TextGadget(), and not the StringGadget().
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
agb2008
User
User
Posts: 60
Joined: Fri Jan 15, 2016 2:22 pm

Re: Vertical font alignment - not available in text gadgets

Post by agb2008 »

TI-994A, RSBasic:

Thank you for your suggestions ! A bit strange that this option is not available in PB... :?
Post Reply