ID:2415315
 
So I'm trying to make a weather effect for my game but I dont want to spawn in a hundred weather obj around my map so I figured I'd just add the animations to the client.screen instead,

Im having some issues with this though.

My game has an adjustable map screen so the players can change their map size/zoom to be more comfortable for them on whatever oddball monitor they happen to be playing on.

The problem I'm running in to though is that when I try to add the elements to the client.screen, if the element is wider than the map size itself, it offsets the map on the user's screen to the left.

My weather effect, for example is a 10x10 icon. If a user's screen is 32x32, I can add a 3x3 instance of it to the screen, but if I try to add a 4x4 instance of it, it shifts the user's map south and west by 8 tiles to fit those extra 8 tiles from the element to the screen.

It's even worse if a user has their map smaller like say... 12x12. Because then it'd shift their map by 28 tiles SW.

Anyone have any ideas on how to resolve this issue? Is there a built-in way to tile an element on the client.screen that im not aware of other than adding them in to position manually? And is there a way to avoid this screen offset?
Just lock custom adjustable map screen for players.
Give them just most used by players. This resolve a lot of anyother problerms in future. https://en.wikipedia.org/wiki/Display_resolution

You can also deal with transform, and use translate proc. It should not shift your view.
I don't want to lock the resolution. Players combine the map size and map zoom to fit their needs.

but this translate proc, I'm not really sure how it works. I cant find a ton of documentation on it.

I guess I'll have to play around with it.
    Snow_Test_B()
set desc = "Snow Test"
set category = "Testing"


add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)

add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)

add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)

add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)
add_hud("SOUTH","WEST",0,/obj/HUD/Snow/SNOW)

var/s_x = 0
var/s_y = 0

for(var/obj/HUD/Snow/SNOW/S in usr.client.screen)
var/matrix/M = matrix()
M.Translate(s_x*320,s_y*320)
S.transform = M

if(s_x == 3)
s_x = 0
s_y++
else
s_x++
return


https://i.imgur.com/JpQoZRq.png


Thanks. This worked for what I wanted. Im sure there's a simpler way to work it than what I did but this works good enough for now.