This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ScreenAnchor as tweeted by @the_duriel: https://x.com/the_duriel/status/1712183527477809452?s=20 | |
@tool | |
extends MarginContainer | |
class_name ScreenAnchor | |
## Control which can be anchored to a relative screen position | |
@export var offset: Vector2 = Vector2(0.5, 0.5): | |
set(value): offset = value; _update_position() | |
enum ORIGIN {CENTER, TOP_LEFT, TOP_RIGHT, BOT_LEFT, BOT_RIGHT} |