DrawImage doesn't work!

Started by fireapache, Sun 18/11/2012 08:46:04

Previous topic - Next topic

fireapache

Hey people! I don't understand why this simple DrawImage doesn't work:

Code: AGS
// room script file

Overlay *overlay;
DynamicSprite *sprite;
DrawingSurface *surface;

function After_FadeIn()
{
  sprite = DynamicSprite.Create(320, 240, true);
  surface = sprite.GetDrawingSurface();
  surface.Clear();
  surface.DrawImage(160, 160, 35);
  surface.Release();
  overlay = Overlay.CreateGraphical(0, 0, sprite.Graphic, true);
}


Nothing happens!

The sprite on slot 35 is a cursor with an alpha channel:



... my project is running in 32-bit colour.

Calin Leafshade

does After_FadeIn() actually run? I dont think thats the default name for the function so did you create it with the editor events pane? or did you just type the function in manually?

fireapache

Yes, it's run, I did write "After_FadeIn" in the events panel of that room.

fireapache

#3
Actualy, I think there's a problem in the engine. I say that because I imported the same sprite again but telling AGS to do not use the alpha channel of the PNG and it worked!

Code: AGS
surface.DrawImage(160, 160, 37);

[imgzoom]http://imageshack.us/a/img231/1298/34730502.png[/imgzoom]

buuut... The transparency in DrawImage never worked, for both situations and graphic drivers - DirectDraw 5 and Direct3D 9.

Slasher

Quote from: Calin Leafshade on Sun 18/11/2012 09:59:16
does After_FadeIn() actually run? I dont think thats the default name for the function so did you create it with the editor events pane? or did you just type the function in manually?
You should do this via the Rooms events panel

fireapache


SMF spam blocked by CleanTalk