ID:1088688
 
(See the best response by Zaoshi.)
        client.getWindowSize()
client.getScreenSize()

winset(client, "default", "pos=0,0;size=[client.screen_width]x[client.screen_height];is-maximized=true")
var/my_size = round(client.screen_height / 11)//view is 11 tiles high
while(my_size % 32 != 0)
my_size -= 1
winset(client, "default.map1", "icon-size=[my_size]")


I'm basically trying to find the nearest multiple of 32 for setting the biggest possible icon_size of map control based on screen height.
Best response
Use round() with 32 as second argument, it'll give you nearest number that divides by 32.
Ooh, math!

Find the current multiple of 32 (floor it!):

my_size = my_size - (my_size%32)

Add 32:

my_size = my_size + 32

Mathemagic
fireking just likes giving us pop quizzes
In response to Magicsofa
Magicsofa wrote:
fireking just likes giving us pop quizzes

Hah.