The title says it all. I have an image that’s 480x320 but when I put it on the simulator it’s half that size. This happened once before, does anyone know what’s going on? Also, for an example a widget button, the X/Y coordinates have values of 2000+ just to be in the middle of the screen. Pretty confused because it wasn’t this way last time I used it. [import]uid: 114389 topic_id: 31037 reply_id: 331037[/import]
try
display.newImage( [group,] filename, x, y, true) [import]uid: 7911 topic_id: 31037 reply_id: 124089[/import]
Didn’t work. [import]uid: 114389 topic_id: 31037 reply_id: 124097[/import]
Restarting Corona and computer didn’t work, using different images didn’t work either.
[import]uid: 114389 topic_id: 31037 reply_id: 124098[/import]
And opening up previous games, those don’t fill the whole screen either. Can someone please help me with this? [import]uid: 114389 topic_id: 31037 reply_id: 124099[/import]
perhaps ur config file [import]uid: 7911 topic_id: 31037 reply_id: 124100[/import]
Yes, if you could paste a snippet of code showing how you are loading the image, as well as your config.lua file, that would be helpful in solving your issue.
- Andrew [import]uid: 109711 topic_id: 31037 reply_id: 124104[/import]
Images…
local img = display.newImage( "img.png", 100, 100 )
Config
[code]
application =
{
content =
{
width = 320,
height = 480,
scale = “Letterbox”,
fps = 30,
antialias = true,
},
}
[/code] [import]uid: 114389 topic_id: 31037 reply_id: 124108[/import]
OK, nothing jumps out as obviously awry so far.
However, although your first post says the image is “half size”, you later mentioned the issue was that the images “don’t fill up the whole screen”. In your snippet of code, I notice you placed the image with its upper left corner is at (100,100). I assume your image is 480x320, as you mentioned in your first post. In this case, it won’t fill the whole screen, since a good chunk of it will spill over the right and bottom edges.
If that’s not the issue, then here are some other questions: Do you attempt to scale the img object in any way (using the scale method or by modifying its xScale or yScale properties)? Do you insert the img object into a display group, and if so, does the display group get scaled in any way?
Also, out of curiosity, what device skin are you running in the simulator?
Last, as a minor suggestion, you might want to put “Letterbox” in all lowercase. I don’t know if it’s case sensitive, but since the documentation indicates it should be in all lowercase, we might as well do so to eliminate it as a possible source of the issue.
- Andrew [import]uid: 109711 topic_id: 31037 reply_id: 124111[/import]
I was just showing (100,100) as an example of how I add images.
xScale works, but yScale doesn’t, either way those don’t seem to solve the whole problem. I viewed it as all the phones on the simulator and am getting the same result.
Here is my situation with the code below…
local bg = display.newImage("background.png")
Menu:insert(bg)
local rect2 = display.newRect( 0, 0, 480, 320 )
rect2:setFillColor( 0, 0, 155 )
rect2.alpha = .5
Menu:insert(rect2)
And here’s what it looks like…
https://picasaweb.google.com/lh/photo/qZDSEj7Rhkh3tt-Jtf4igNMTjNZETYmyPJy0liipFm0?feat=directlink
[import]uid: 114389 topic_id: 31037 reply_id: 124116[/import]
Only out of curiosity:
What happens if you change the following line from your config.lua file?
[lua]scale = “letterbox”,[/lua]
The difference from this one to yours is that you typed Letterbox (as the config.lua you posted above) and this one does not have any Capital letter.
Cheers,
Rodrigo. [import]uid: 89165 topic_id: 31037 reply_id: 124119[/import]
Unfortunately that didn’t help
[import]uid: 114389 topic_id: 31037 reply_id: 124124[/import]
Very strange.
To help debug this further, it would be helpful if you could share a minimal but complete project that exhibits this issue. In other words, create a single man.lua file and do the least amount of coding you can where you still see this issue. Then, myself and others on the forum can try it on our own machines and see if we get a different result.
Incidentally, what build number are you using?
- Andrew [import]uid: 109711 topic_id: 31037 reply_id: 124143[/import]
I solved the issue. When I initially created a new project in Corona and set it to Landscape mode, naturally I changed the width to 480 and height to 320. But I guess you have to leave those alone at height = 480, width = 320 whether in Landscape mode or not. [import]uid: 114389 topic_id: 31037 reply_id: 124193[/import]
Never change the dimensions based on whether or not you are using landscape or portrait mode- think of the device height and width like the height and width of your own body. If you are 6 foot standing up you will also be 6 foot even if you are lying down on your side. etc. [import]uid: 52491 topic_id: 31037 reply_id: 124297[/import]
try
display.newImage( [group,] filename, x, y, true) [import]uid: 7911 topic_id: 31037 reply_id: 124089[/import]
Didn’t work. [import]uid: 114389 topic_id: 31037 reply_id: 124097[/import]
Restarting Corona and computer didn’t work, using different images didn’t work either.
[import]uid: 114389 topic_id: 31037 reply_id: 124098[/import]
And opening up previous games, those don’t fill the whole screen either. Can someone please help me with this? [import]uid: 114389 topic_id: 31037 reply_id: 124099[/import]
perhaps ur config file [import]uid: 7911 topic_id: 31037 reply_id: 124100[/import]