Openfeint Android and ROTOZOOMANIM

Previous topic - Next topic

jrico

Hi all!

First of all sorry about my english!

Long time ago i were programming an iPhone game using glBasic. Actually i´m trying to publish it on Android Market. I have been making some changes to allow the game to adapt all resolutions (when i made it for iPhone it only had one possible resolution). I get it working but i found one problem. On main game function finally all my sprites were rendered by function ROTOZOOMANIM. The problem is that on Android when i resize game for diferent resolutions the scale factor is diferent for X and Y. I have to scale all sprites for example 1.6 original size for X and 1.4 for Y. The function i use ROTOZOOMANIM not allows to scale diferent factors for X and Y it only uses one factor, ¿How can i do it?

Another problem is the integration for Openfeint. For iPhone i have some functions that call C functions o Openfeint API, ¿how can i do it for Android? Here is the code i have:
Code (glbasic) Select
CONSTANT LANDSCAPE = 1
CONSTANT PORTRAIT = 2

?IFDEF IPHONE
IMPORT "C" void GLB_OF_CreateOpenFeint(const char* ckey, const char* secret, const char* displayName, int mode)
IMPORT "C" void GLB_OF_ShowDashboard()
IMPORT "C" int GLB_OF_isOnline()
IMPORT "C" void GLB_OF_Achive(const char* achivementID)
IMPORT "C" void GLB_OF_HighScore(const char* leadID, long score)
?ELSE
FUNCTION GLB_OF_CreateOpenFeint: key$, secret$, displayName$, mode
ENDFUNCTION

FUNCTION GLB_OF_ShowDashboard:
ENDFUNCTION

FUNCTION GLB_OF_isOnline%:
RETURN FALSE
ENDFUNCTION

FUNCTION GLB_OF_Achive: achievementID$
ENDFUNCTION

FUNCTION GLB_OF_HighScore: leadID$, score%
ENDFUNCTION
?ENDIF

FUNCTION OpenFeintDummy:

ENDFUNCTION

ampos

Under my point of view, if you set different X&Y scaling factor, your game will be distorted, like watching an old 4:3 film in a 16:9 tv (or viceversa), stretched.

Instead, I would use the MIN(x,y) so the game will fit in any screen without distortion and a X_offset (or perhaps y_offset) to get it centered. Of course, you will have black borders. You can "fix" it if you have somekind of background that fills the screen (spritestrectch id,0,0,x_res,y_res) before drawing your game, so the black border will be a background image.

In one of my snipets I have a initialization rotine that calculates the appropiate X_zoom, Y_zoom, X_offset and Y_offset. Just check it.
check my web and/or my blog :D
http://diniplay.blogspot.com (devblog)
http://www.ampostata.org
http://ampostata.blogspot.com
I own PC-Win, MacBook 13", iPhone 3G/3GS/4G and iPAC-WinCE

jrico

First of all thanks for your response.

I thought of that solution that you tells me but my background image is very difficult to use with that solution (the borders of my background images are not integrable with any other background image). I only want to rescale distorsioned background image (the all other game images will be rescaled whith same X and Y scale). It´s not a problem that it will be distorsioned because it´s an image about space.

If any one knows how to make that, please tell me...

Thanks for all ampos!