Overlay.setSourceCoordinates() has no effect

Started by Lobby, February 10, 2014, 12:04:11 AM

Previous topic - Next topic

Lobby

Hello, I tried to get an overlay to show just a part of the source texture by using the method setSourceCoordinates(). Unfortunately, this method seems to have no effect at all, it just doesn't matter what parameters I use (while other methods like setNewCoordinates() work properly).

Lobby

#1
Ok, it's not a bug, but the documentation forgot to mention that I have to use the Overlay constructor with parameter modifyUV set to true :'( .

Lobby

By the way, would be nice to use float values as source coordinates for better accuracy.

EgonOlsen

You are right in both cases. I'll update the docs and change the parameters to float for the next release. Do you need these floats now?

Lobby

Thank you :)

Quote from: EgonOlsen on February 10, 2014, 09:17:53 PMDo you need these floats now?

Would be nice to get them as soon as possible.



Lobby

May I suggest to add a method to set the four uv coords manually or at least to set a rotated source rectangle? I want to rotate a background that is an overlay but to rotate the whole overlay is a bad solution I think (therefore the overlay would have to be bigger than the screen).

I hope it doesn't matter that I recycle this thread.

EgonOlsen

You could get the Object3D from the Overlay and assign a texture matrix to it that does the rotation...if that's what you meant.

Lobby

Thank you, that's a working work around. However, now I have to do some confusing calculations for the matrix and I'm not sure whether an extended setSourceCoordinates() method would be easier to implement.

Something other, why SimpleVector has no SimpleVector calcScalarMul(float scalar) method?

EgonOlsen

Quote from: Lobby on February 15, 2014, 02:12:21 PM
Thank you, that's a working work around. However, now I have to do some confusing calculations for the matrix and I'm not sure whether an extended setSourceCoordinates() method would be easier to implement.

Something other, why SimpleVector has no SimpleVector calcScalarMul(float scalar) method?
I see your point, but i prefer the matrix solution. It's more flexible and this is a very special case anyway. About the calcScalarMul()...no idea. I guess i never needed it and no one ever requested it. Want it? Need it?

Lobby

Sure, no one really needs a calcScalarMul-method as some lines more can erase it's functionality. The point is, that in fast writing something I would prefer the short form with calc* and whenever I do this I notice this inconsistency.