mirror of
https://github.com/litruv/PNGTuber-Plus.git
synced 2026-07-24 02:26:02 +10:00
InitCommit
update 1.4.2 source code
This commit is contained in:
28
ui_scenes/spriteEditMenu/chain.gd
Normal file
28
ui_scenes/spriteEditMenu/chain.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Node2D
|
||||
|
||||
@onready var line = $Line2D
|
||||
@onready var plug = $Plug
|
||||
|
||||
func _ready():
|
||||
Global.chain = self
|
||||
|
||||
func _process(delta):
|
||||
ohYeah()
|
||||
|
||||
|
||||
func ohYeah():
|
||||
if Global.heldSprite != null:
|
||||
global_position = Global.heldSprite.global_position
|
||||
line.clear_points()
|
||||
line.add_point(Vector2.ZERO)
|
||||
line.add_point(to_local(get_global_mouse_position()))
|
||||
|
||||
plug.position = get_local_mouse_position()
|
||||
|
||||
plug.look_at(global_position)
|
||||
plug.rotation_degrees += 180
|
||||
|
||||
func enable(enabled):
|
||||
ohYeah()
|
||||
set_process(enabled)
|
||||
visible = enabled
|
||||
Reference in New Issue
Block a user