ID:2254788
 
(See the best response by Nadrew.)
Is there a way to make certain hud objects use a separate zoom level different than the map-zoom??

So using Ter's tutorial on view resizing I noticed that I can support all kinds of aspect ratios and resolutions in the map portion by adjusting view-size/zoom. Thing is huds get messed up and can get cropped even after applying the buffer sizes. So being able to resize map portion and huds differently would fix that issue
You could use a master plane with a scale transform applied that covers the screen, then set the appearance flags of the hud to ignore those transforms.
You can put the HUD and game on different planes. This would achieve the same effect. Actually I would suggest doing both.
 //Something like this??
atom
appearance_flags=PLANE_MASTER

obj/hud
appearance flags=RESET_TRANSFORMS

mob/verb/Resize()
var/matrix/m=matrix()
m.Scale(0.8)

but how do I assign that matrix in the plane??
It's my first time using planes so I don't exactly know how to use them I only know what is included in the refference
Best response
Not quite.

image/screen_scale
plane = 0
appearance_flags = PLANE_MASTER
proc
Scale(amount)
var/matrix/scale_matrix = matrix()
scale_matrix.Scale(amount)
transform = scale_matrix

mob
var/tmp/image/screen_scale/screen_scale
Login()
..()
screen_scale = new(loc = src)
src << screen_scale

verb/ScaleUp(n as num)
if(!screen_scale) return
screen_scale.Scale(n)

obj/hud
appearance_flags = RESET_TRANSFORM
plane = 1
This works wonders!! It seems planes can do much more than layering.


EDIT: I noticed that this kind of zoom I mean using transform leaves a black space. My code adjusts zoom to fit 1560 tiles in the map if resolution is small window zooms out and vice versa so there is a balance. There isn't any alternative is it I mean for zoom out to work without black space??