Thread: Center text

  1. #1
    Unregistered
    Guest

    Unhappy Center text

    How do u center text vertically and horizontally on a page?
    settextjustify?

  2. #2
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    With what compiler?

    Simply, a few good tabs with printf?
    printf("\t\t\t\tCentered text");

    gotoxy( 0 , 0 )
    ( I believe it's colums, rows )

    ??
    The world is waiting. I must leave you now.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    For horizontal


    locationx=halfscreenx-(widthoftext>>1)

    Vertical

    locationy=halfscreeny-(heightoftext>>1)

    so lets say for 80 column text mode

    40-(textlen/2)

  4. #4
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Is that standard bubba?
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Text adventure engine idea. thoughts?
    By suzakugaiden in forum Game Programming
    Replies: 16
    Last Post: 01-15-2006, 05:13 AM
  2. Appending text to an edit control
    By dit6a9 in forum Windows Programming
    Replies: 3
    Last Post: 08-13-2004, 09:52 PM
  3. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 12:35 AM
  4. Scrolling The Text
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 07-14-2002, 04:33 PM
  5. Replies: 1
    Last Post: 07-13-2002, 05:45 PM