Mittens 2017 is likely to be in Iceland in July. Check out the thread for details!

Author Topic: Is there a function that tints the *entire room* (background)  (Read 120 times)  Share 


Been looking at character.Tint (tints a character), object.Tint (tints an object), and the game.SetAmbientTint (both characters and objects).

But is there a way to tint the *whole room background*? Even if it requires CreateDrawingSurfaceFromBackground, DrawImage, etc. that involve you drawing on to the background.

Or should I just make tinted versions of each background in Photoshop, then draw them on to the standard background?


  • Cavefish
  • Fleeing the Cylon tyrrany...
I don't know if you can tint the BG, sorry.

But you can create a single one color sprite the size of your BG, and then draw it over the BG with a transparency setting.
There are those who believe that life here began out there...


  • Global Moderator
  • Mittens Earl
  • Private Insultant
    • I can help with proof reading
    • I can help with translating
There are a couple of ways...

The easiest is to put a "color filter" layer over the whole screen (like Cassiebsg says): this will tint the background, characters and objects all together. Just create a full-screen (non-clickable) GUI, set its background to the color you want, and set its transparency to the right level.

The other is to copy the background onto a DynamicSprite, tint that, and then draw it back to the background:

Code: Adventure Game Studio
  1.   DynamicSprite* bgSprite = DynamicSprite.CreateFromBackground();
  2.   bgSprite.Tint(r,g,b,s,l); // You'll have to supply these values;
  3.   // Now copy it back to the background
  4.   DrawingSurface* bgSurface = Room.GetDrawingSurfaceForBackground();
  5.   bgSurface.DrawImage(0, 0, bgSprite.Graphic);
  6.   // Clean up
  7.   bgSurface.Release();
  8.   bgSprite.Delete();

Finally, you can also create a tinted version in Photoshop and draw that to the background in the same way (using bgSurface.DrawImage()), or by having it as a separate room background and changing the background frame.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
the better solution (without resorting to Photoshop) is the one using the "tint" setting in a dynamic sprite.
Because the so-called tint overlay will ruin the contrast (it's like you're painting some red (for example) on top of the scene, instead of turning colors into red -- do you get the difference?). It works, it's fast, but it's the second-best solution.

However that solution also requires you to set the tint setting on the characters, objects etc.