Problems with Sprite.Draw2D & October SDK

Hi,
I replaced my Direct3DX reference (1.0.2906.0) with the latest version included in the October SDK (1.0.2908.0).

However, when I now compile, my code fails with "Overload resolution failed because no accessible 'Draw2D' can be called with these arguments:"

Sprite.Draw2D(Texture, Rectangle, Rectange, Point, Color)

The "dxreadme.htm" states that the D3DX dll is unchanged from the August version. So what is this 1.0.2908

I have gone back to the 1.0.2906 dll and all is fine again.

Can someone explain what I am doing wrong please.

Thanks,
Jim


Answer this question

Problems with Sprite.Draw2D & October SDK

  • spillai

    Hi,
    I couldn't get Sprite.Draw2D to work at all using the October SDK ie the 1.0.2908 library.

    However, I changed the code to sprite.draw - the 3D variant and just set the Z value=0. It works fine and my FPS are unchanged.

    I don't know if it would solve your problem - but might be worth a try.

    Jim

  • Rory Becker

    try - DrawOffscreenPlainSurface()


  • dronick

    With the work I have been doing I have found that most of the changes where to convert the point to pointF and such. Looking at the Samples in the SDK I have moderfied the Draw2D call from the 2D Sample to do what I need.



    sprite.draw2D(texture, sourceRectangle,
       new SizeF(spriteWidth, spriteHieght),
       new PointF(sourceRectangle.Width /2f, sourceRectangle.Height /2f,
       new PointF(position.X, position.Y), Color.White);

     



  • dredrunde

    Hi
    I found that out too. Using the 3D Draw it seems setting Z to 0 makes this 2D object in front of the 3D stuff, and setting it to 1 (moving away from me into the screen in my world) puts it behind the 3D stuff which is exactly what I want!
    So thanks for the reply.

    Shame the Draw2D can be made to work the same way as the scaling would be quite useful for me!

    Cheers

    Simon

  • Anders L

    There were some changes to the Directx sprite class but I'm not sure what changed or when it did. That's why you are getting errors.

  • SarahBurgess

    But the documentation still lists the method I'm calling as valid. I have tried other Draw2D methods with the same result.

    Has Draw2D been withdrawn

  • Big H

    Hi
    I came across the same problem. The new Draw2D however has now had it's bugs fixed, and does proper scaling. The problem I have now though is that all sprites  appear on top of every 3D object, whereas the 1.0.2906 library rendered things in the order they were drawn in the code.

    Does anyone know how to get round this Or come across the same problem

    Thanks

    Simon

  • Problems with Sprite.Draw2D & October SDK