Skip to content

Instantly share code, notes, and snippets.

@MageJohn
Last active August 30, 2019 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MageJohn/1ead3c1d58e65cec0a5fced1618e1139 to your computer and use it in GitHub Desktop.
Save MageJohn/1ead3c1d58e65cec0a5fced1618e1139 to your computer and use it in GitHub Desktop.
GuiButtonSizeAnim
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/button.png-234620e182281afdeb4aab4d2ed4f8a7.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://button.png"
dest_files=[ "res://.import/button.png-234620e182281afdeb4aab4d2ed4f8a7.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
[gd_scene load_steps=4 format=2]
[ext_resource path="res://button.png" type="Texture" id=1]
[ext_resource path="res://button_hover.png" type="Texture" id=2]
[ext_resource path="res://button_anim.gd" type="Script" id=3]
[node name="TextureButton" type="TextureButton"]
margin_right = 256.0
margin_bottom = 64.0
texture_normal = ExtResource( 1 )
texture_hover = ExtResource( 2 )
script = ExtResource( 3 )
extends TextureButton
const SCALE = Vector2(1.2,1.2)
const DURATION = 0.2
onready var _initial_scale = get_scale()
var _scale_tween = null
func _ready():
self.connect("mouse_entered", self, "_on_mouse_enter")
self.connect("mouse_exited", self, "_on_mouse_exit")
_scale_tween = Tween.new()
add_child(_scale_tween)
func _on_mouse_enter():
_scale_tween.interpolate_property(self, "rect_scale", \
self.get_scale(), _initial_scale*SCALE, DURATION, Tween.TRANS_QUAD, Tween.EASE_OUT)
_scale_tween.start()
func _on_mouse_exit():
_scale_tween.interpolate_property(self, "rect_scale", \
self.get_scale(), _initial_scale, DURATION, Tween.TRANS_QUAD, Tween.EASE_OUT)
_scale_tween.start()
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/button_hover.png-2b31de553b79e9199dc9cedc3ed05f54.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://button_hover.png"
dest_files=[ "res://.import/button_hover.png-2b31de553b79e9199dc9cedc3ed05f54.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )
[application]
name="GuiButtonSizeAnim"
main_scene="res://main.tscn"
icon="res://icon.png"
gen_mipmaps=false
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ ]
_global_script_class_icons={
}
[application]
config/name="GuiButtonSizeAnim"
run/main_scene="res://button.tscn"
config/icon="res://icon.png"
[rendering]
environment/default_environment="res://default_env.tres"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment