A
Adry
Guest
Hey community ! I've been running circles trying to get this really insignificant thing to work, but now it seems like I've become obsessed.. Sigh, but I'm thinking of just letting it go 'cause it's causing unnecessary frustration..
Basically, I'm trying to get one single sprite, (background sprite) to display at a different pixel resolution than what the window size displays. I have taken some pictures to further illustrate this:
This is how it displays within the draw event on a 480 * 420 window:
This is what I'd like to achieve..
The window is still 480 * 420, however as you can see, the surface has a resolution of 160 * 140, the original pixel size. Here is my frustration..
I can only seem to accomplish this via the draw_gui event. This is a problem because this is supposed to be a background and the GUI draw event draws this as you all know to the front of the screen.
Is there any other way to do this? Or I'm I trying to do something that I can't really fix with code? Any advice? Here is my code from the GUI draw event:
Basically, I'm trying to get one single sprite, (background sprite) to display at a different pixel resolution than what the window size displays. I have taken some pictures to further illustrate this:
This is how it displays within the draw event on a 480 * 420 window:
This is what I'd like to achieve..
The window is still 480 * 420, however as you can see, the surface has a resolution of 160 * 140, the original pixel size. Here is my frustration..
I can only seem to accomplish this via the draw_gui event. This is a problem because this is supposed to be a background and the GUI draw event draws this as you all know to the front of the screen.
Is there any other way to do this? Or I'm I trying to do something that I can't really fix with code? Any advice? Here is my code from the GUI draw event:
GML:
// IN THE CREATE EVENT
surface = -1; // Initialise the variable that wil hold the surface ID
display_set_gui_size(480, 420);
// IN THE DRAW GUI EVENT
if !surface_exists(surface) // Check and see if surface exists
{
// Surface doesn't exist so create it and make it the size of the background sprite
surface = surface_create(480, 420);
// Now draw the background to the surface
surface_set_target(surface);
draw_sprite_tiled(battle_bg_c, 0, 0, 0);
surface_reset_target();
}
else
{
// Draw the surface
draw_surface(surface, 0, 0);
}