[Solved] Invalid screen size and coordinates on android

Hi, all!
I am trying to run my simple puzzle game on android phone and I found that windows sizes/coordinates on windows and on android work different way.
In my game I get window width (height of game board is same) using window.get_size, calculate scale for sprites for fit all sprites on the window and it works fine on windows. But on android phone I can see only little part of game board. I think, on Android Defold get me window width, that greater than screen width approximately 1.5 times.

I also tried to get window width using render.get_width/render.get_window_width but I can not get global variable with window width from render script in game object script on android because init function from render script does not call and I do not know why (it works fine on windows)

Any ideas how to get real screen size or get render.get_width/render.get_windows_width on android?
Thanks

What is your display size in game.project? I think that you don’t need to apply recalculated scale on your sprites, just make sure your sprite size (and its scale) looks fine on the editor then I believe it will display well on all platforms.

On Android you get a window size which is equal to the resolution of your phone. This resolution very rarely matches the one you have in game.project. You may need to factor in this ratio between the actual window size and the one you have in game.project.

I did some experiments and found, that defold uses screen size from project (and I can get it from render.get_width/get_height), not from real screen size. I think, it means that I need to make my sprites for sizes what I set in game.project and it will work for any screen resolution as noticed Chung_Xa above.
Thanks everyone

You can also use:

local project_width = sys.get_config_int("display.width")
local project_height = sys.get_config_int("display.height")

Great! It can work without getting variables from render script.
Thanks