reflection
A simple-ish component that reflects the icons of movables on the parent like a mirror. Sadly, there's no easy way to make the SOUTH dir reflection flip the visual so that you can see the back NORTH dir of a target while it's facing SOUTH beside adding the VIS_INHERIT_DIR flag to the target movable, which I'm not doing to spare eventual issues with other vis overlays in the future.
Vars | |
alpha | the transparency channel value of the reflection holder. |
---|---|
can_reflect | A callback used check to know which movables should be reflected and which not. |
reflected_dir | The direction from which the component gets its visual overlays. The visuals are also flipped horizontally or vertically based on it. |
reflected_movables | A lazy assoc list that keeps track of which movables are being reflected and the associated reflections. |
reflection_filter | the filter data added to reflection holder. |
reflection_holder | the movable which the reflected movables are attached to, in turn added to the vis contents of the parent. |
reflection_matrix | the base matrix used by reflections |
update_signals | A list of signals that when sent to the parent, will force the comp to recalculate the reflected movables. |
Procs | |
check_can_reflect | Checks if the target movable can be reflected or not. |
get_reflection_targets | Unsets the old reflected movables and sets it with new ones. |
on_dir_change | Called when the parent changes its direction. |
on_movable_entered_or_initialized | Called when a movable enters a turf within the connected range |
on_movable_exited | Called when a movable exits a turf within the connected range |
set_reflected | Sets up a visual overlay of the target movables, which is added to the parent's vis contents. |
set_reflection | Turns the allowed reflected direction alongside the parent's dir. then calls get_reflection_targets. |
Var Details
alpha
the transparency channel value of the reflection holder.
can_reflect
A callback used check to know which movables should be reflected and which not.
reflected_dir
The direction from which the component gets its visual overlays. The visuals are also flipped horizontally or vertically based on it.
reflected_movables
A lazy assoc list that keeps track of which movables are being reflected and the associated reflections.
reflection_filter
the filter data added to reflection holder.
reflection_holder
the movable which the reflected movables are attached to, in turn added to the vis contents of the parent.
reflection_matrix
the base matrix used by reflections
update_signals
A list of signals that when sent to the parent, will force the comp to recalculate the reflected movables.
Proc Details
check_can_reflect
Checks if the target movable can be reflected or not.
get_reflection_targets
Unsets the old reflected movables and sets it with new ones.
on_dir_change
Called when the parent changes its direction.
on_movable_entered_or_initialized
Called when a movable enters a turf within the connected range
on_movable_exited
Called when a movable exits a turf within the connected range
set_reflected
Sets up a visual overlay of the target movables, which is added to the parent's vis contents.
set_reflection
Turns the allowed reflected direction alongside the parent's dir. then calls get_reflection_targets.