ID:2262317
 
(See the best response by Nadrew.)
Code:
http://www.byond.com/developer/Kidpaddle45/MouseWheelZoom
http://www.byond.com/developer/Kumorii/Kii_Spotlight


Problem description: How can I use this 2 libraries together? I tried some things, but I don't understand very well how plane and aparrence_flags works.




Best response
You'd need to scale your lighting plane as well as your master plane for the zoom to apply to the lights.
In response to Nadrew
Both plane=0

I can't check the libraries in question, but if both were on plane 0 they'd both be scaling. So, they're not both on plane 0.

The PLANE_MASTER and lightning plane probably aren't on the same plane, as the effect wouldn't work so great that way.

The way PLANE_MASTERs work is that they control the drawing of everything else on that plane, so when you scale one, everything on that plane scales.

Your HUD for instance stays the same size because it's own its own plane, your lights are doing the same thing because they're not on the same plane as the one being scaled to create the zooming effect.
In response to Nadrew
client/MouseWheel(src,delta_x,delta_y,location,control,params) //Control zooming with the mouse wheel!
if(usr.client && control =="default.map1")
var/obj/map_zoom/z = locate() in usr.client.screen
var/obj/lighting_plane/z2 = locate() in usr.client.screen
if(z)
if(delta_y>=1)
if(iconsize>= 6) return
iconsize += 1
animate(z, transform = matrix()*iconsize, time = 2)
animate(z2, transform = matrix()*iconsize, time = 2)
return
if(delta_y<=-1)
iconsize -= 1
if(iconsize<= 1)
iconsize = 1
animate(z, transform = matrix()*iconsize, time = 2)
animate(z2, transform = matrix()*iconsize, time = 2)
return

animate(z, transform = matrix()*(iconsize), time = 2)
animate(z2, transform = matrix()*iconsize, time = 2)
return


I can't did it changing the plane, but came in my mid it, change both PLANE_MASTER (plane 0 and plane 1) at the same time.

Just copy what you do for the zoom effect, but apply it to everything on the plane that the lighting stuff is on (1, iirc?)

I've never used the other library before though. If you can't figure it out i'll take a look though.
In response to Kumorii
That's what I did, I left it up for if someone looks for a day on the forum. The two library together make any game a very beautiful game.
Glad you enjoy the library! <3
Considering adding support for intensity/brightness and size of the spotlight soon.

Happy to hear that aswell ;)

As mentionned above you'd need the lighting plane to be on a higher/lower plane (as long as it's different) it should work I believe.