Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions doc/classes/Mode7Sprite2D.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@
Re-resolve the follow target from [member mode7_region_follow_target] and store it in the internal follow cache. Useful after a scene reload when you need to refresh the tracked target without waiting for [constant Node.NOTIFICATION_ENTER_TREE].
</description>
</method>
<method name="mode7_transform_point" qualifiers="const">
<return type="Variant" />
<param index="0" name="point" type="Vector2" />
<param index="1" name="visible_area_only" type="bool" default="false" />
<description>
Provide a (Vector2) position, which should be the "real" position on the un-transformed sprite (Mode 7 disabled).
The function will return a position, which will be that same place on the sprite after the Mode 7 transformations are applied.
This can be used to place/move an object on the sprite consistent with the Mode 7 transformation.

This is the CPU-side inverse of the shader's per-pixel sampling: it finds where on the (drawn) sprite the given texel ends up, exactly matching the on-screen result.
It works whether or not a region is enabled, and handles None/Lerp (any number of scanline overrides) and Projection interpolation.

With [member mode7_tiling] enabled, a point that lies outside the sprite's own UV space (on a repeated tile) is resolved to the correct position on that tile, taking global rotation into account.

[b]visible_area_only:[/b] When [code]true[/code], the method returns [code]null[/code] if the point has no drawn destination (for example, it falls in the area the Mode 7 warp does not cover, such as the "blank" band a projection leaves when tiling is off).
When [code]false[/code] (default), it always returns the correct transformed location even if that area is not currently drawn, so you can still position objects there.
</description>
</method>
</methods>
<members>
<member name="mode7_bottom_horizon_mask_amount" type="float" setter="set_mode7_bottom_horizon_mask_amount" getter="get_mode7_bottom_horizon_mask_amount" default="0.0">
Expand Down
Loading
Loading