Rotation
BlitzMax Forums/BlitzMax Beginners Area/Rotation
| ||
I have totaly failed at understanding how Rotation in BMax works From what I could tell, using SetRotation would rotate all images drawn after that point, however, SetRotation appears to do absolutly nothing, I figured maybe I had to reload the images I wanted to rotate, like with SetMask, but this didnt work either |
| ||
it does what it says, everything will be drawn rotated until another setrotation command is given. |
| ||
It works fine here - maybe you're feeding it a float between 0 and 1, where you should be using an angle measured in degrees? |
| ||
SetRotation changes the rotation of all following drawimage commands, thats correct. BUT: the angle you set is absolute, not relative to their previous angle, so if you want have a changing angle you need to have a variable that you raise. SetRotation rotates the images around their handle which normally is the top left corner. You don't need to reload or anything else. |
| ||
but it isnt, I've tested!TestImage = LoadImage("TS/Arrow.png") Graphics 800,600 DrawImage TestImage, 1,1 Flip Delay 1000 SetRotation (90) Cls DrawImage TestImage, 1,1 Flip Delay 1000 After 1 second the screen goes black aparently, SetRotation is causing DrawImage to do nothing |
| ||
OMG I'm so stupid, the image was rotating off the screen If I didnt beleive it would send me to hell, I would go and hang myself in stupidity right now |
| ||
That code can't work. You have to FIRST call graphics and load media afterwards. Graphics cleans all graphic data. |
| ||
Aparently Graphics doesnt clean all graphics data as the image still worked, but the problem is fixed at any rate |
| ||
That code can't work. Yes, it does work. You have to FIRST call graphics and load media afterwards. Graphics cleans all graphic data. Not the case with DX or GL - try it and see. |
| ||
I have done that in several ocations but I did noticed that on some graphics cards with certain resolution the image gets distorted. now to play it safe, first I call the graphics command. And maybe that got fixed with the newest version of BMAX. |