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 Node | |
#You need to set "console" and "stats" keys to input map | |
#The video about how to implement to your project https://youtu.be/klaxiaQ94Zc | |
#UI | |
var canvaslayer | |
var color_rect#black background | |
var debug_output | |
var debug_tween | |
var left_label |
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
shader_type canvas_item; | |
uniform vec4 outline_color:hint_color = vec4(1.0,1.0,0.0,1.0); | |
uniform float inner_circle=0.45; | |
uniform float outer_circle=0.5; | |
const vec4 alpha_color= vec4(0,0,0,0); | |
uniform float smoothness=0.01; |
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 lastUpdate = Date.now(); | |
var lastFixed = Date.now(); | |
var fixedTimer=0.02; | |
var updateInterval = setInterval(tick, 0); | |
var fixedInterval = setInterval(fixedTick,fixedTimer); | |
function tick() { | |
var now = Date.now(); |
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
shader_type canvas_item; | |
uniform vec2 size; | |
uniform vec2 scale; | |
uniform vec2 position; | |
vec2 uv(vec2 uv) { | |
vec2 s = vec2(size.x / scale.x, size.x / scale.y); | |
vec2 p = vec2(position.x / (size.x / s.x), position.y / (size.y / s.y)); | |
vec2 result = vec2(uv.x * s.x - p.x, uv.y * s.y - p.y); |