I'm reporting this as an issue, because I'm almost certain there's a problem with SpriteBatch when a source / destination rect are used with a origin.
I have an object that I want to rotate around it's center. The destination is 5 times the size of the source. What is happening is that when the destination rect is different then the source, the rotation origin changes and the object doesn't rotate around it's center anymore.
I'm almost certain there's a problem, because I've inspect the inputs for the SpriteBatch.Draw call on both Windows and Mac, and the values are exactly the same.
In windows the object rotates nicely in the center, on Mac, the objects rotates like the earth around the sun.
Here's the method with the issue:
public void Draw (Texture2D texture,
Strange is that after inspecting this method I don't know how the Windows version works! It shoudn't I guess.
I have a fix for Mac, all I have to do is to multiply the origin by the scale before the call to SpriteBatch.
Let me add this: when I say "windows" I mean XNA in windows, and not MonoGame in windows.
Is this in the develop or develop3d branch? Does it occur in both?
It happens on the develop branch, didn't try it on develop3d branch.
We never used rotation with SpriteBatch, so its possible that could be broken. For sure it is something to test on the develop3d branch as lots has changed there.
Should I be using the develop3d branch instead?
The develop3d branch is not finished and is a work in progress. If you can deal with things changing or breaking then I would recommend it. For our game we work off of develop3d daily and if something breaks it usually is fixed quickly.
If all you need is 2D and don't want to deal with the occasional broken build... then you should stick with develop and submit a pull request with your fix.
Source rectangles dont appear to work at all in IOS... using Draw(Textue2D,Vector2,Rectangle, Color) when I change the y source coordinate value in the rectangle the result is a size stretch on y. This suggests that either the whole parameter stack is off or its just mis-implemented.
I don't know about the 'develop' branch, but source rectangles do work on the 'develop3d' branch.
Just confirmed that this issue is happening in the devolop3d branch.
Edit: I'm using the MacOSX develop3d branch, btw.
Fixed #563 SpriteBatch with a source/dest rect works different then W…
Fix #563 - Removed casting to float, as it's done implicitly.
Fix issue #563 - moved scaling of Origin vector to the Draw() overloa…
…d that accepts a destinationRectangle.
This assures we're not breaking any overloads that DO NOT supply the destinationRectangle.
Fix issue #563 - Re-add casting to float, as they were necessary indeed.