G geewiztech Member Licensed User Longtime User Sep 30, 2013 #1 I have a really strange problem with my project (attached). When I add a building the size of the building changes dependent on the screen size, even though I'm adding them with a specific dip size.
I have a really strange problem with my project (attached). When I add a building the size of the building changes dependent on the screen size, even though I'm adding them with a specific dip size.
Erel B4X founder Staff member Licensed User Longtime User Sep 30, 2013 #2 Please post questions in the questions forum. The zip file you posted is invalid. You should use File - Export as zip.
Please post questions in the questions forum. The zip file you posted is invalid. You should use File - Export as zip.
G geewiztech Member Licensed User Longtime User Sep 30, 2013 #3 Sorry, re-posted correctly in the correct forum
Informatix Expert Licensed User Longtime User Sep 30, 2013 #4 geewiztech said: I have a really strange problem with my project (attached). When I add a building the size of the building changes dependent on the screen size, even though I'm adding them with a specific dip size. Click to expand... You should read the chapter about the Camera in the tutorial. In your application, you try to use pixels (DIP means "density independent pixel") with a different unit scale (1/32 of the size, set with SetToOrtho2). That cannot work. Instead of setting globalWidth to Activity.Width, you should set it to the exact value used by libGDX = lGdx.Graphics.Width. Same thing for globalHeight. They are usually the same, but in some cases (that I can't remember) you may have different values so it's a good habit to use the right properties.
geewiztech said: I have a really strange problem with my project (attached). When I add a building the size of the building changes dependent on the screen size, even though I'm adding them with a specific dip size. Click to expand... You should read the chapter about the Camera in the tutorial. In your application, you try to use pixels (DIP means "density independent pixel") with a different unit scale (1/32 of the size, set with SetToOrtho2). That cannot work. Instead of setting globalWidth to Activity.Width, you should set it to the exact value used by libGDX = lGdx.Graphics.Width. Same thing for globalHeight. They are usually the same, but in some cases (that I can't remember) you may have different values so it's a good habit to use the right properties.