The game that I am trying to create scales all my images to fit the middle of the screen. Thus if the game is 640 by 480 it will scale it on a computer screen that is 1080 * 720 and so forth.
When I print a scaled bitmap the coordinates change to negative coordinate (I don't know why but I have adjusted to that)
The problem I am running into is that for bitmaps there is a function call called
- al_draw_scaled_bitmap()
But for fonts I don't know if there exist such a function call and if not how do I scale it so that it prints on the right coordinate for the screen.
Here is an example
- al_draw_scaled_bitmap(mapImagePlain, -row * 32, -column * 24, screenWidth, screenHeight, scaleX, scaleY, scaleW, scaleH, 0);
where the xPosition and yPosition are both negative but for this call:
- al_draw_text(font, al_map_rgb(red, green, blue), xPosition, yPosition, NULL, text);
where the xPosition and yPosition are positive and its coordinates deals with the actual screen size
If anyone knows a solution or has advice it would be much appreciated thank you
Yes, there are no functions to scale fonts.
The current way to draw a scaled font is to draw your text to a separate ALLEGRO_BITMAP. Then, draw a scaled bitmap.
It might be something like this:
^ This is not tested; there may be typos. Here's how it's done in AllegroFlare.
Thank You! I'll give that a try and I'll let you know how that goes.
If the fonts are TTF, can't you just increase the font point size?
Scaling small text to HD is going to be very ugly.