get screen size Defold engine android build
- User
get screen size Defold engine android build
- Assistant
In Defold, getting the screen size on any platform—Android included—is typically done using the
render.get_window_width()andrender.get_window_height()functions for getting the width and height of the app window.Please note: In some cases, especially on mobile, the window size may not necessarily be the actual size of the physical screen due to different reasons (e.g., device pixel ratio, navigation bars, etc.).
Here is a simple Lua script example that shows how you can get the screen size in a Defold project: