This question was
closed Apr 15, 2017 at 11:31 PM by
lyn-ith for the following reason:
Problem is not reproducible or outdated
Question by
lyn-ith · Apr 14, 2017 at 09:10 PM ·
gridscalingtileslocalscalescreen resolution
can i create a grid, using the screen size?
i want to create a grid which divides the screen into equal parts. and i want to be able to dynamically change the amount of rows in both x and y. all that using tiles. as an example: screen res is 1920:1080 and i want 48 horizontal and 27 vertical. now each tile must be resized, which is no problem, but how do i tell the tiles which size to take to match the screen? it should be 40 by 40 pixels each, but i don't know how to translate that to unity im using c#btw.
thanks in advance
Comment
Answer by Caruzo · Apr 14, 2017 at 09:58 PM
You can find some information in the Manual
You can change the grid size relative to the screen resolution by using Screen.Width and Screen.Height