[SUGGESTION] Getting Overlay's DrawingSurface

Started by Crimson Wizard, Tue 29/09/2009 21:54:50

Previous topic - Next topic

Crimson Wizard

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).

Pumaman


monkey0506

Well this would open up other possibilities as well:

Code: ags
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). It's not ultra-high priority for me to be able to get these values, but it would still be nice. :P

SMF spam blocked by CleanTalk