Actor images re-sizing unwantedly
Hey all,
I have a problem with my custom font for my scoreboard and level etc. I have exported all the digits as png's and made sure they are all the same size. All widths and heights are also all divisible by 2. (14x34 in this instance)
I went through the video and the logic works fine as I can see the numbers change as they should, which is great, but when the image changes from 1 to 2 and so on the image gets stretched as if it's bigger than the actor. The actor stays the correct size but you can only see part of the number.
I tried to constraining the actor size and it is set to 14x34 but it had no effect as the actor doesn't get any bigger it's just the image stretching. Also I deleted all the actors Involved and remade them making sure the sizes matched to begin with. I also re-imported all of the images after deleting them out of the project and project folder, to see if this would make a difference but to no avail.
It looks like gamesalad is maybe reading the image size incorrectly but I'm no expert.
Any ideas why this could be happening?
Thanks again for all of your help!
Comments
Double-check that all of those pngs are 72 dpi.
What happens when you set the actor's image to 2.png (or whatever you called it) manually by dragging the image onto the actor? Or just a change attribute self.Image to 2.png. In other words, simulate what happens when it changes during the game but have it happen immediately... is the effect still the same?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Thanks for the quick response,
I will check they are 72 dpi. That's a good shout!! I've been using https://tinypng.com/ to compress my png the files and I know it outputs them in 8bit but it doesn't say what the DPI is. So I'll do it manually in photoshop and see if it makes a difference.
I assigned an image of a "0" to the actor in the attributes editor and checked the size is still the same. (which it was and all digits "1","2" etc are all the same dimensions) I didn't drag and drop the image onto the actor in the stage window so I'll also try that.
And to change the image to the next image in the sequence I used the expression,
constrain: self.image to = floor((game.points%self.divider)/(self.divider/10))..".png"
I just followed one of t-shirt booths videos which seems to work well apart from this stretching. So I think it is something I've done wrong somewhere along the way and not the formula as it works perfectly fine on his video. However I'd like to work out what the problem is so I don't run into this hurdle again.
Many thanks for your help I've at least got an avenue to explore now and I'll post back if that fixes it,
Cheers.
Yeah, I've had a go at that and all images are at 72dpi and unfortunatelty no closer to finding the source of the problem??