W
warbo
Guest
So i have been working on a way to get my "shop" to scale with the rooms camera/view and scroll and its all working great except for my images.
The first image works fine, its scaled and positioned correctly but when i cycle to the next few the image scales and positions funny, i have added a video to show this.
https://streamable.com/qgh2u
This is the code that is in the image object where the image gets drawn.
The create event where i store the needed things
All the images are the same size.
Basically there are 4 of the above and all of them are in one sprite so that is where the "global.itemImageNumber[1] = 0;" as this changes the image.
I cant work out why after the first image they all mess up after that.
The first image works fine, its scaled and positioned correctly but when i cycle to the next few the image scales and positions funny, i have added a video to show this.
https://streamable.com/qgh2u
This is the code that is in the image object where the image gets drawn.
Code:
/// @description Insert description here
// You can write your code in this editor
draw_self();
draw_sprite_stretched(spr_ShopItems, global.itemImageNumber[global.currentItem], x - 130 * global.zoom, y - 130 * global.zoom, sprite_get_width(global.itemImageNumber[global.currentItem]) /2 * global.zoom, sprite_get_height(global.itemImageNumber[global.currentItem]) /2 * global.zoom)
Code:
global.itemName[1] = "Yellow Cables";
global.itemPrice[1] = "$35.00";
global.itemImageNumber[1] = 0;
global.itemDescription[1] = "These cables are used with the\nmobie power generator.\n\nYou would use these to\nconnect upto Hog Pan.";
global.itemName[2] = "Mobile Generator";
global.itemPrice[2] = "$150";
global.itemImageNumber[2] = 1;
global.itemDescription[2] = "The mobile generator runs on\ngasoline and is a great runner!";
Basically there are 4 of the above and all of them are in one sprite so that is where the "global.itemImageNumber[1] = 0;" as this changes the image.
I cant work out why after the first image they all mess up after that.