Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Why aren't my suffixes working? - Gideros Forum

Why aren't my suffixes working?

rpallenrpallen Member
edited November 2017 in General questions
I'm a bit lost with using suffixes to use different images for different sized screens.

Here is what I did. Note: Though I describe what I did here, all you really need to see is in the attached screenshot, studio.png. What I did is based on the information in the other screenshot, instructions.png, which is taken from page 23 of Arturs Sosins book, "Gideros Mobile Game Development".

The logical dimensions of the project are 960x1600 and it has landscape left orientation. In the graphics tab of the properties of my project I entered 3 suffix/ratio combinations (see screenshot):
@big 1.0
@medium 0.63
@small 0.5

I created an image for the image background.jpg and added it to the project's images folder.

I then made 3 background images from the above image and added them to the project's image folder. And yes, I added them to the images folder in the project pane after adding them to the images folder on the computer (see screenshot).
background_@big.jpg 1704x1200
background_@medium.jpg 1074x756
background_@small.jpg 852x600

I added this code to main.lua:
local bg = Bitmap.new(Texture.new("images/background.jpg", true))
bg:setAnchorPoint(0.5, 0.5)
bg:setPosition(conf.width/2, conf.height/2)

When I ran the code with all FOUR images (including the background image without a suffix, in the player I got UNSUFFIXED image.

I then removed the background.jpg image, expecting the program to use the suffixed images. But I got (as you can see in the screenshot):
images/background.jpg: No such file or directory.
stack traceback:
main.lua:3: in main chunk

I assumed that something in Gideros would change background,jpg to the file with the appropriate suffix, but I guess I was wrong. What do I need to do to get the program to use the files with suffixes?
1065 x 591 - 55K
795 x 547 - 65K


Sign In or Register to comment.