draw_sprite_ext(spr_gui_background,1,view_xview[view_current]+view_wview[view_current]-sprite_get_width(spr_gui_background),view_yview[view_current]+view_hview[view_current]-sprite_get_height(spr_gui_background),view_wview/1280,view_hview/720,0,-1,1);
How is it not correct? We need to know what you want to do with the sprite and its origin.I Tried this but It's not correct
Code:draw_sprite_ext(spr_gui_background,1,view_xview[view_current]+view_wview[view_current]-sprite_get_width(spr_gui_background),view_yview[view_current]+view_hview[view_current]-sprite_get_height(spr_gui_background),view_wview/1280,view_hview/720,0,-1,1);
var wx = sx + view_xview; //sx is the x position on screen
var wy = sy + view_yview; //sy is y pos on screen.
var scale = view_wview/640;
//change 640 with another constant to change the scale.
//assumes a a constant aspect ratio.
the sprite origin Is Vector2(0,0)How is it not correct? We need to know what you want to do with the sprite and its origin.
xx = view_xview[view_current]+view_wview[view_current]-sprite_get_width(spr_gui_background);
yy = view_yview[view_current]+view_hview[view_current]-sprite_get_height(spr_gui_background);
wx = xx + view_xview;
wy = yy + view_yview;
draw_sprite_ext(spr_gui_background,1,wx,wy,view_wview/1280,view_hview/720,0,-1,1);
Are you trying to center it or keep the original position?nothing happensCode:xx = view_xview[view_current]+view_wview[view_current]-sprite_get_width(spr_gui_background); yy = view_yview[view_current]+view_hview[view_current]-sprite_get_height(spr_gui_background); wx = xx + view_xview; wy = yy + view_yview; draw_sprite_ext(spr_gui_background,1,wx,wy,view_wview/1280,view_hview/720,0,-1,1);
Keeping It a the original positionAre you trying to center it or keep the original position?
var scale = view_hview/720;
xx = view_wview[view_current ]- (sprite_get_width( spr_gui_background) )*scale;
yy = view_hview[view_current] - (sprite_get_height( spr_gui_background) )*scale;
wx = xx + view_xview;
wy = yy + view_yview;
draw_sprite_ext( spr_gui_background, 1, wx, wy, scale, scale, 0, -1, 1);
can you Fix the PretensesWhat I think Fel666 was implying,
Code:var scale = view_hview/720; xx = view_wview[view_current ]- (sprite_get_width( spr_gui_background) )*scale; yy = view_hview[view_current] - (sprite_get_height( spr_gui_background) )*scale; wx = xx + view_xview; wy = yy + view_yview; draw_sprite_ext( spr_gui_background, 1, wx, wy, scale, scale, 0, -1, 1);
///draw_sprite_fixed(sprite, index, xport, yport, scale);
var sprite = argument0;
var index = argument1;
var x_in_view = argument2 / view_wport[view_current];
var y_in_view = argument3 / view_wport[view_current]; //coordinates to draw in view (0 - 1)
var scale = argument4; //size of object
var x_in_room = (x_in_view * view_wview[view_current]) + view_xview[view_current];
var y_in_room = (y_in_view * view_hview[view_current]) + view_yview[view_current];
var xscale = scale * view_wview[view_current] / view_wport[view_current];
var yscale = scale * view_hview[view_current] / view_hport[view_current];
var rotation = -view_angle[view_current];
draw_sprite_ext(sprite, index, x_in_room, y_in_room, xscale, yscale, rotation, c_white, 1.0);