>>103294306
>>103294992
For the pan-image amount changes I do it like this:
local default = 0.05
mp.register_script_message("adjust-pan", function (increment)
default = default + increment
end)
mp.register_script_message('pan-image', function (direction, amount)
local axis, effective_amount
if direction == "up" then
axis, effective_amount = "y", -(amount or default)
elseif direction == "down" then
axis, effective_amount = "y", amount or default
elseif direction == "left" then
axis, effective_amount = "x", amount or default
elseif direction == "right" then
axis, effective_amount = "x", -(amount or default)
end
local dims = mp.get_property_native('osd-dimensions')
local dimension = (axis == 'x' and dims.w or dims.h) - (axis == 'x' and (dims.ml + dims.mr) or (dims.mt + dims.mb))
local osd_dimension = (axis == 'x' and dims.w or dims.h)
if dimension > osd_dimension then
mp.commandv('add', 'video-align-' .. axis, effective_amount * 2 * osd_dimension / (dimension - osd_dimension))
end
end)
Could probably be done more efficiently (maybe using some user-data for the amount) but so far it works enough for me