Move surfaces via mouse

Hi,

SDL.Net has the ability to allow the mouse to move Surfaces or Sprites.
Could this be added to AgateLib, too?

~ Agon

This is an interesting idea,

This is an interesting idea, I will have to think about it some to see if it could be implemented in AgateLib without breaking anything. I will have a look at the way SDL.Net does that sort of thing.

I don't know how this is

I don't know how this is handled in SDL.Net but in agate.lib a surface has just a size and no position.
When you call the Surface.Draw() method you can tell where the surface should be placed

  1. //...
  2.  
  3. Mouse.Move += new InputEventHandler(Mouse_MouseMove);
  4.  
  5. //..
  6.  
  7. private void Mouse_MouseMove(InputEventArgs e)
  8. {
  9.   Surface cursor = new Surface("mycursor.png");
  10.   // Display.BeginFrame();
  11.   // Display.Clear();
  12.  
  13.   cursor.Draw(e.MousePosition);
  14.  
  15.   // Display.EndFrame();
  16. }

Perhaps that helps

Yeah, this would work. But

Yeah, this would work.

But in SDL.Net it is easier.
You can do it like this:

  1. surface.AllowMouseMove = true;

Then you can click and while holding mouse button move the surface/sprite.