Hi,

I don't understand what you want to achieve, but here a code you can try :

Code:
// Scale bmap
var sx = screen_size.x / bmap_width(main_tga);
var sy = screen_size.y / bmap_height(main_tga);
      
var scale = minv(sx, sy);
main_pan.scale_x = main_pan.scale_y = scale;
main_pan.pos_x = (screen_size.x - (bmap_width(main_tga) * scale)) * 0.5;


Best regards.