|
Rotating the screen 90°... possible? |
Marton
Member #7,173
April 2006
|
I'd like to be able in my game at some point rotate the screen 90°... Is this possible without having to use rotated fonts/objects so they display correctly rotated??? Thanks!! |
brigham toskin
Member #2,213
April 2002
|
instead of drawing directly to the screen when displaying your code, write it to an offscreen bitmap. You can then transfer that to the screen with rotate_sprite() or related function. You'll take a performance hit, but it might not really be noticeable on modern hardware. --- |
TeamTerradactyl
Member #7,733
September 2006
|
Do you mean simplyp drawing your "completely rendered" BITMAP to your screen, flipped 90-degrees? If so, you can probably very simply employ the rotate() function (see forum thread http://www.allegro.cc/forums/thread/323382 for others trying to do something similar...).
|
Marton
Member #7,173
April 2006
|
Will check the thread, thanks! |
brigham toskin
Member #2,213
April 2002
|
yes --- |
Marton
Member #7,173
April 2006
|
How am I supposed to do it? It doesn't rotate and the bitmap appears one pixel to the left and one down... I know this may be bad code but hey I'm learning DATAFILE *datafile; datafile = load_datafile("test.dat"); |
kazzmir
Member #1,786
December 2001
|
A) you have to used 'fix' numbers rotate_sprite( temp, bitmap, 0, 0, itofix( 64 ) ); In general to convert 0-360 into 0-255 use this angle * 256 / 360
|
Marton
Member #7,173
April 2006
|
Thanks!!! That was the trick! |
Fladimir da Gorf
Member #1,565
October 2001
|
If you want performance, there's more efficient ways to rotate a bitmap 90 decrees (as it's a special case of rotation). However, you'll need to write your own drawing function for that. OpenLayer has reached a random SVN version number ;) | Online manual | Installation video!| MSVC projects now possible with cmake | Now alvailable as a Dev-C++ Devpack! (Thanks to Kotori) |
miran
Member #2,407
June 2002
|
I think roatate_sprite already does multiples of 90 degrees with specialized more efficient code. -- |
Tobias Dammers
Member #2,604
August 2002
|
Yes it does. At least the C version of the code contains a comment somewhere about the trivial cases (i.e. multiples of 90 degrees). --- |
Arthur Kalliokoski
Second in Command
February 2005
|
Does this game use matrices to set screen positions? If so, you could alter a few members of the matrix and it'll get rotated automagically. They all watch too much MSNBC... they get ideas. |
Marton
Member #7,173
April 2006
|
Nope, no matrices. Anyway with rotate_sprite it works like a charm Thanks!! |
|