- GitHub Staff
- http://jshorty.com
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
extends Sprite | |
# This dictates the size of the viewport used for the "snapshot". | |
export var source_image_size : Vector2 | |
export var polygon : PoolVector2Array | |
func _ready(): | |
var viewport_container = ViewportContainer.new() | |
viewport_container.set_size(source_image_size) | |
add_child(viewport_container) |
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
var _flicker_timer | |
func _ready(): | |
_flicker_timer = get_tree().create_timer(0.0) | |
# n: number of times to flicker | |
# s: time (sec) each flicker takes | |
func flicker(n = 0, s = 0.1): | |
var toggles = int(n * 2) | |
if toggles % 2 == 0: |