Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Press mouse button to print the current camera position
- -- Open infolog, copy paste a camera position into this widget:Initialize
- -- Then toggle widget to get back to that camera position
- function widget:GetInfo()
- return {
- name = "PrintCam",
- desc = "Print GetCameraState()",
- author = "zwzsg",
- version = "2",
- date = "Dec, 2009",
- license = "Free",
- layer = 1,
- enabled = false,
- }
- end
- function widget:MousePress(mx, my, button)
- local txt=nil
- for k,v in pairs(Spring.GetCameraState()) do
- if type(v)=="string" then
- v="\""..v.."\""
- end
- txt=(txt and (txt..", ") or "")..tostring(k).."="..tostring(v)
- end
- txt="Spring.SetCameraState({"..txt.."},1)"
- Spring.Echo(txt)
- end
- function widget:Initialize()
- Spring.SetCameraState({px=3176.9895019531, py=1271.5123291016, pz=1504.1774902344, dx=-0.79640448093414, dy=-0.60291218757629, name="fps", fov=45, mode=0, dz=0.047204066067934, oldHeight=290.76232910156},1)
- end
Advertisement
Add Comment
Please, Sign In to add comment