AGS Awards votes close at 13:59 BST on Wednesday 07 March 2018. You've already voted, so you've got 10 days and 19 hours left to wait before voting closes!

Author Topic: Transparency bug in DrawingSurface.DrawImage? [3.3.0]  (Read 774 times)

monkey0506

  • AGS Project Tracker Admins
  • Tasting the banhammer. Strangely, tastes like ham.
I'm working on getting a full-functioning module version of the Snow/Rain plugin, but I appear to have come across a problem. At the moment (bear in mind this is WIP!!) all of the particles should be falling straight down. Which is working great, so long as I don't try and draw them with any transparency on the DrawingSurface. If there is any transparency at all, from 1 to 100, the particle is never drawn.

I am using the D3D9 graphics driver, I have the GUI and sprite alpha rendering styles set to proper alpha blending, and I am doing essentially this:

Code: Adventure Game Studio
  1. DynamicSprite *guiSprite; // used as GUI background image
  2.  
  3. void Render()
  4. {
  5.   if (guiSprite == null)
  6.   {
  7.     guiSprite = DynamicSprite.Create(myGUI.Width, myGUI.Height, true);
  8.     myGUI.BackgroundGraphic = guiSprite.Graphic;
  9.   }
  10.   DrawingSurface *surface = guiSprite.GetDrawingSurface();
  11.   surface.Clear();
  12.   int i = 0;
  13.   while (i < particleCount)
  14.   {
  15.     // calculate particle position, etc.
  16.     surface.DrawImage(x, y, img, Random(maxTrans - minTrans) + minTrans); // DOES NOT WORK
  17.     // surface.DrawImage(x, y, img); // WORKS PERFECTLY
  18.     i++;
  19.   }
  20.   surface.Release();
  21. }
  22.  
  23. function repeatedly_execute_always()
  24. {
  25.   // check if snowing/raining, other sanity checks, etc.
  26.   Render();
  27. }

Any ideas why the semi-transparent particles are disappearing entirely?

P.S. The particle sprite in question is 32-bit, no alpha.
« Last Edit: 01 Jun 2014, 23:45 by monkey_05_06 »
User was banned for this post.