Center text

This is a discussion on Center text within the C Programming forums, part of the General Programming Boards category; How do u center text vertically and horizontally on a page? settextjustify?...

  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
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    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, 10:52 PM
  3. Text positioning and Text scrolling
    By RealityFusion in forum C++ Programming
    Replies: 3
    Last Post: 08-13-2004, 01:35 AM
  4. Scrolling The Text
    By GaPe in forum C Programming
    Replies: 3
    Last Post: 07-14-2002, 05:33 PM
  5. Replies: 1
    Last Post: 07-13-2002, 06:45 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21