Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Crimson Wizard on Tue 29/09/2009 21:54:50

Title: [SUGGESTION] Getting Overlay's DrawingSurface
Post by: Crimson Wizard on Tue 29/09/2009 21:54:50
I think I saw something similar in a couple-of-years ago thread, but in AGS 3.1.2 I am using it is currently not possible, and there's no tip that something like this is planned in AGS 3.2.

So, basically, I ask would it be possible to allow getting DrawingSurface for Overlay?
Why this can be needed? Imagine you need to change Overlay's picture often. To do so you will have to

1. Create Dynamic sprite.
2. Draw something on it.
3. Create an overlay copying sprite's graphic.
4. Draw something new on the sprite.
5. Delete old overlay and create new one copying sprite's graphic
etc, etc.

If one could draw on Overlay directly, not only it would be simplier for scripting, but,I guess, I would require less memory (since no copying of graphic).
Title: Re: [SUGGESTION] Getting Overlay's DrawingSurface
Post by: Pumaman on Wed 30/09/2009 21:36:21
Would anyone else find this useful?
Title: Re: [SUGGESTION] Getting Overlay's DrawingSurface
Post by: monkey0506 on Wed 30/09/2009 22:28:55
Well this would open up other possibilities as well:

int GetWidth(this Overlay*) {
  DrawingSurface surface = this.GetDrawingSurface();
  return surface.Width;
}

int GetHeight(this Overlay*) {
  DrawingSurface surface = this.GetDrawingSurface();
  return surface.Height;
}

DynamicSprite* GetDynamicSprite(this Overlay*) {
  DrawingSurface surface = this.GetDrawingSurface();
  return DynamicSprite.CreateFromDrawingSurface(surface, 0, 0, surface.Width, surface.Height);
}


I believe there are outstanding requests for each of those (actually, just the first two (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=31358.0)). It's not ultra-high priority for me to be able to get these values, but it would still be nice. :P