help with scrolling text please

This is a discussion on help with scrolling text please within the Game Programming forums, part of the General Programming Boards category; Hello, I am new to C++ (only 3 days now) but I've progressed pretty far. I have began programming a ...

  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    2

    Exclamation help with scrolling text please

    Hello, I am new to C++ (only 3 days now) but I've progressed pretty far. I have began programming a game and I would like to have scrolling text so that when one character appears the next character appears like 1/4 a second later. Also I would like to know how to have a length of time before the next command takes place. For example the screen says 'Hello', waits 2 seconds, then says 'How are you?' Thanks a lot if anyone can help.

  2. #2
    Rabite SirCrono6's Avatar
    Join Date
    Nov 2003
    Location
    California, US
    Posts
    269
    Sleep
    Code:
    Sleep( 1000 ); //Sleep 1 second
    Sleep( 250 ); //1/4 second
    - SirCrono6
    From C to shining C++!

    Great graphics, sounds, algorithms, AI, pathfinding, visual effects, cutscenes, etc., etc. do NOT make a good game.
    - Bubba

    IDE and Compiler - Code::Blocks with MinGW
    Operating System - Windows XP Professional x64 Edition

  3. #3
    email for MystWind avatar MystWind's Avatar
    Join Date
    Feb 2005
    Location
    Holland , The Hague
    Posts
    88
    Sleep() using : #include <windows.h>
    sleep() using : #include <unistd.h>

    then it just works like crono says : Sleep(1000); to pause program for 1 sec.
    PLay MystWind beta , within two years

  4. #4
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    I know this is kinda on the side, but heres what I use when I do that.

    [code]
    #include <iostream>
    #include <fstream>
    using namespace std;

    int main()
    {
    This war, like the next war, is a war to end war.

  5. #5
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    I know this is kinda on the side, but heres what I use when I do that.

    Code:
    #include <iostream>
    #include <fstream>
    #include <unistd.h>
    using namespace std;
    
    int main()
    {
     ifstream fin("text.txt");
     char ch;
     while(fin.get(ch))
     {
      cout << ch;
      sleep(300);
     }
    }
    This war, like the next war, is a war to end war.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Scrolling in a text buffer
    By Kode Kid in forum C Programming
    Replies: 3
    Last Post: 07-17-2005, 03:35 PM
  2. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  3. Scrolling Text
    By fushigidane in forum C++ Programming
    Replies: 4
    Last Post: 01-04-2004, 10:43 AM
  4. Replies: 1
    Last Post: 07-13-2002, 05:45 PM
  5. Ok, Structs, I need help I am not familiar with them
    By incognito in forum C++ Programming
    Replies: 7
    Last Post: 06-29-2002, 09:45 PM

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