MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ on_scroll()

Wiring & MayaFlux::Nexus::Wiring::on_scroll ( std::shared_ptr< Core::Window window,
std::function< void(double, double)>  fn 
)

Fire the entity on each mouse scroll event from a window.

The scroll delta (dx, dy) is passed directly to the emitter's fn via a shared glm::vec2 written before invoke(). No new InfluenceContext fields are added; read the delta through the captured shared_ptr in your fn.

Parameters
windowSource window.
fnCalled with (dx, dy) on each scroll event.

Definition at line 97 of file Wiring.cpp.

99{
100 m_trigger = ScrollTrigger { .window = std::move(window), .fn = std::move(fn) };
101 return *this;
102}

References m_trigger, and MayaFlux::Nexus::Wiring::ScrollTrigger::window.