Thread: allegro textout

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    479

    allegro textout

    hi all,

    in my game i want a counter that counts
    the score.

    this should'nt be a problem but i cant find anything in the docs that shows how its done.

    thanx in advance!

  2. #2
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    thanx but i've already looked trough that

    any idea how i could make it work?


    i wanna do something like this

    int score =0;

    textout(score);

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Well then that'l be:

    Code:
     void textprintf(screen,font,10,10,makecol(255,255,255),"%i",score);
    
     // screen means that whe will be drawing this text to the screen
     // font means whe are using the standerd bios font (8x8)
     // makecol(r,g,b) means the color using red green and blue (totally white in this case)
     // For the last 2 parts you need to know how printf() works in
     c/c++

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    thank you again
    but i've tried exactly that
    the last part *score* wont show?

  6. #6
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    well, then you're doing something wrong, pode.

  7. #7
    Registered User
    Join Date
    Nov 2002
    Posts
    8
    i know somthing that im sure works but u need to use sdl.

  8. #8
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by willgell
    i know somthing that im sure works but u need to use sdl.
    What i posted sure works,if it doesnt the problems lies at his code, POST IT!

  9. #9
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Originally posted by pode
    thank you again
    but i've tried exactly that
    the last part *score* wont show?
    Alright, lets all spoon-feed pode.
    Code:
    void textprintf(screen,font,10,10,makecol(255,255,255),"score: %i",score);

  10. #10
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    OH! you ment that? DOH! i thought the whole thing dint print
    i said you should know the standard printf()

  11. #11
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    what was that eibro??
    .......... you!

    the problem was not that i couldnt show "score"
    but the variable *score* idiot

  12. #12
    Registered User
    Join Date
    Dec 2001
    Posts
    479
    go spoon feed your mother

  13. #13
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Calm down there buddy, no flame wars

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. allegro, small problem
    By IM back! in forum C++ Programming
    Replies: 8
    Last Post: 11-20-2008, 02:29 PM
  2. Allegro in C for a newb
    By Ideius in forum C Programming
    Replies: 5
    Last Post: 12-29-2005, 04:36 PM
  3. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 02:00 AM
  4. double buffering for allegro
    By Leeman_s in forum C++ Programming
    Replies: 6
    Last Post: 09-12-2002, 02:45 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-20-2002, 11:35 PM