(Android)changing the game window size and re-positioning it -


i'm making top-down shooter android platform , i'm trying screen portrayed in added image( orange rectangles virtual buttons). following code being run before game starts change game window size fit device's screen:

///display properties   display_width=display_get_width(); display_height=display_get_height();  ideal_width=0; ideal_height=display_height;    aspect_ratio=display_width/display_height;  ideal_width=round(ideal_height*aspect_ratio); //ideal_height=round(ideal_width / aspect_ratio);    //perfect pixel scaling if(display_width mod ideal_width != 0) { var d = round(display_width/ideal_width); ideal_width=display_width/d; } if(display_height mod ideal_height != 0) { var d = round(display_height/ideal_height); ideal_height=display_height/d; }  //check odd numbers if(ideal_width & 1) ideal_width++; if(ideal_height & 1) ideal_height++;   for(var i=1; i<=room_last; i++) { if(room_exists(i)) { room_set_view(i,0,true,0,0,720,1280,60,60,720,1280,0,0,0,0,-1); room_set_view_enabled(i,true); room_set_width(i,720); room_set_height(i,1280); } }  //window_set_size(ideal_width-120,ideal_height-120); //window_set_rectangle(60,60,display_width-120,display_height-120);  display_set_gui_size(720,1280); surface_resize(application_surface,ideal_width,ideal_height);  //alarm[0]=1;  room_goto(room_next(room)); 

changing xport , yport values of view yield desired effect changing hport , wport doesn't seem change anything.

thank time , help!! :)game screen description


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -