- Online Community Forums » Programming Questions » [A5] Exempt Bitmap from Transform

This thread is locked; no one can reply to it. rss feed Print
[A5] Exempt Bitmap from Transform
Eric Johnson
Member #14,841
January 2013

Hi there. I'm using a run-of-the-mill transform that doubles the scale of the display.

void Routines::stretchDisplay(const int stretch_amount) {



  // Prepare to stretch the display by the given amount
  al_scale_transform(&transform, stretch_amount, stretch_amount);

  // Apply stretch

  // EXAMPLE use: Routines.stretchDisplay(2); This doubles the scale (duh)

What I'd like to do is exempt a particular bitmap from said transform; everything but X bitmap would be scaled. Would you mind pointing me in the right directory in achieving this? Thank you kindly. 8-)

EricII on #allegro.
My Games
Momo (my JS game-making library)

Thomas Fjellstrom
Member #476
June 2000

You can temporarily store that transform using al_store_state, set up an identity or ortho transform, use that, draw the bitmap, and then restore the state after.

There may be another way, but I think that works.

Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" --

Peter Wang
Member #23
April 2000

Another fun thing to do is create a sub-bitmap, which would have an independent transform.

Go to: