I'm just now learning Allegro, and all the tutorials I have looked at have used a function called textout_ex to print things out to the screen.

The problem is - textout_ex is really starting to p*ss me off horribly because of how specific you must be in the info you give it.
(for example, you can only print out char* variables, and nothing else, unless its inside quotations, and you can only print out 1 set of info)

question - is there anything better to use besides textout_ex?

7 Years
Discussion Span
Last Post by firstPerson

Just make a wrapper function :

void print(std::string msg, int posX, int posY, int color){
 textout_ex(screen, font, msg.c_str(),posX, posY, color);

And use it like so :

void doo(){
 string msg = "hello 2d world!";

an even better wrapper :

void print(std::string msg, Vec2d pos, int color){
 textout_ex(screen, font, msg.c_str(),pos.x, pos.y, color);

Where Vec2D is a class that holds the x and y position of an object.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.