├── example ├── icon.png ├── assets │ ├── ball.png │ ├── font │ │ └── ui.ttf │ ├── grass_bkg.png │ ├── ball.png.import │ └── grass_bkg.png.import ├── addons │ ├── TBP_GrassPath2D │ │ ├── icon.png │ │ ├── noise.png │ │ ├── assets │ │ │ ├── grass0.png │ │ │ ├── grass1.png │ │ │ ├── grass10.png │ │ │ ├── grass11.png │ │ │ ├── grass12.png │ │ │ ├── grass13.png │ │ │ ├── grass14.png │ │ │ ├── grass15.png │ │ │ ├── grass16.png │ │ │ ├── grass17.png │ │ │ ├── grass18.png │ │ │ ├── grass19.png │ │ │ ├── grass2.png │ │ │ ├── grass3.png │ │ │ ├── grass4.png │ │ │ ├── grass5.png │ │ │ ├── grass6.png │ │ │ ├── grass7.png │ │ │ ├── grass8.png │ │ │ ├── grass9.png │ │ │ ├── grass0.png.import │ │ │ ├── grass1.png.import │ │ │ ├── grass10.png.import │ │ │ ├── grass11.png.import │ │ │ ├── grass12.png.import │ │ │ ├── grass13.png.import │ │ │ ├── grass14.png.import │ │ │ ├── grass15.png.import │ │ │ ├── grass16.png.import │ │ │ ├── grass17.png.import │ │ │ ├── grass18.png.import │ │ │ ├── grass19.png.import │ │ │ ├── grass2.png.import │ │ │ ├── grass3.png.import │ │ │ ├── grass4.png.import │ │ │ ├── grass5.png.import │ │ │ ├── grass6.png.import │ │ │ ├── grass7.png.import │ │ │ ├── grass8.png.import │ │ │ └── grass9.png.import │ │ ├── plugin.cfg │ │ ├── shader_blur.tres │ │ ├── load.gd │ │ ├── icon.png.import │ │ ├── noise.png.import │ │ ├── blur.shader │ │ ├── TBP_GrassLeaf.gd │ │ └── TBP_GrassPath2D.gd │ └── analog_controller │ │ ├── icon.png │ │ ├── big_circle_DIRECTION_4.png │ │ ├── big_circle_DIRECTION_8.png │ │ ├── big_circle_DIRECTION_2_H.png │ │ ├── big_circle_DIRECTION_2_V.png │ │ ├── small_circle_DIRECTION_2.png │ │ ├── small_circle_DIRECTION_4.png │ │ ├── small_circle_DIRECTION_8.png │ │ ├── plugin.cfg │ │ ├── analog_plugin.gd │ │ ├── analog.tres │ │ ├── icon.png.import │ │ ├── big_circle.png.import │ │ ├── small_circle.png.import │ │ ├── big_circle_DIRECTION_2.png.import │ │ ├── big_circle_DIRECTION_4.png.import │ │ ├── big_circle_DIRECTION_8.png.import │ │ ├── big_circle_DIRECTION_2_H.png.import │ │ ├── big_circle_DIRECTION_2_V.png.import │ │ ├── small_circle_DIRECTION_2.png.import │ │ ├── small_circle_DIRECTION_4.png.import │ │ ├── small_circle_DIRECTION_8.png.import │ │ └── analog.gd ├── scripts │ ├── main.gd │ └── player.gd ├── .gitignore ├── default_env.tres ├── icon.png.import ├── scenes │ ├── player.tscn │ ├── exemploAnimation1.tscn │ └── main.tscn └── project.godot ├── addons └── TBP_GrassPath2D │ ├── icon.png │ ├── noise.png │ ├── assets │ ├── grass0.png │ ├── grass1.png │ ├── grass10.png │ ├── grass11.png │ ├── grass12.png │ ├── grass13.png │ ├── grass14.png │ ├── grass15.png │ ├── grass16.png │ ├── grass17.png │ ├── grass18.png │ ├── grass19.png │ ├── grass2.png │ ├── grass3.png │ ├── grass4.png │ ├── grass5.png │ ├── grass6.png │ ├── grass7.png │ ├── grass8.png │ ├── grass9.png │ ├── grass0.png.import │ ├── grass1.png.import │ ├── grass2.png.import │ ├── grass3.png.import │ ├── grass4.png.import │ ├── grass5.png.import │ ├── grass6.png.import │ ├── grass7.png.import │ ├── grass8.png.import │ ├── grass9.png.import │ ├── grass10.png.import │ ├── grass11.png.import │ ├── grass12.png.import │ ├── grass13.png.import │ ├── grass14.png.import │ ├── grass15.png.import │ ├── grass16.png.import │ ├── grass17.png.import │ ├── grass18.png.import │ └── grass19.png.import │ ├── plugin.cfg │ ├── shader_blur.tres │ ├── load.gd │ ├── icon.png.import │ ├── noise.png.import │ ├── blur.shader │ ├── TBP_GrassLeaf.gd │ └── TBP_GrassPath2D.gd ├── .gitignore ├── .github └── FUNDING.yml ├── LICENSE ├── README.md └── README_PT-BR.md /example/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/icon.png -------------------------------------------------------------------------------- /example/assets/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/assets/ball.png -------------------------------------------------------------------------------- /example/assets/font/ui.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/assets/font/ui.ttf -------------------------------------------------------------------------------- /example/assets/grass_bkg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/assets/grass_bkg.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/icon.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/noise.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/icon.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass0.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass1.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass10.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass11.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass12.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass13.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass14.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass15.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass16.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass17.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass18.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass19.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass2.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass3.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass4.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass5.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass6.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass7.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass8.png -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/addons/TBP_GrassPath2D/assets/grass9.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/noise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/noise.png -------------------------------------------------------------------------------- /example/addons/analog_controller/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/icon.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass0.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass1.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass10.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass11.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass12.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass13.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass14.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass15.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass16.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass17.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass18.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass19.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass2.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass3.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass4.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass5.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass6.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass7.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass8.png -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/TBP_GrassPath2D/assets/grass9.png -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/big_circle_DIRECTION_4.png -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/big_circle_DIRECTION_8.png -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_2_H.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/big_circle_DIRECTION_2_H.png -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_2_V.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/big_circle_DIRECTION_2_V.png -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/small_circle_DIRECTION_2.png -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/small_circle_DIRECTION_4.png -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thrbr84/godot_TBP_GrassPath2D/HEAD/example/addons/analog_controller/small_circle_DIRECTION_8.png -------------------------------------------------------------------------------- /example/addons/analog_controller/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="AnalogController" 4 | description="Analog Controller" 5 | author="Thiago Bruno" 6 | version="1.0" 7 | script="analog_plugin.gd" 8 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="TBP_GrassPath2D" 4 | description="Generate a interactive Grass with Path2D" 5 | author="Thiago Bruno" 6 | version="1.0.0" 7 | script="load.gd" 8 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/plugin.cfg: -------------------------------------------------------------------------------- 1 | [plugin] 2 | 3 | name="TBP_GrassPath2D" 4 | description="Generate a interactive Grass with Path2D" 5 | author="Thiago Bruno" 6 | version="1.0.0" 7 | script="load.gd" 8 | -------------------------------------------------------------------------------- /example/scripts/main.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | const TIMER_LIMIT = 2 4 | var timer = 0.0 5 | 6 | func _process(delta): 7 | timer += delta 8 | if timer > TIMER_LIMIT: # Prints every 2 seconds 9 | timer = 0.0 10 | $UI/fpsLabel.text = "FPS: " + str(Engine.get_frames_per_second()) 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | export.cfg 5 | export_presets.cfg 6 | 7 | # Imported translations (automatically generated from CSV files) 8 | *.translation 9 | 10 | # Mono-specific ignores 11 | .mono/ 12 | data_*/ 13 | 14 | # System/tool-specific ignores 15 | .directory 16 | *~ 17 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Godot-specific ignores 3 | .import/ 4 | export.cfg 5 | export_presets.cfg 6 | 7 | # Imported translations (automatically generated from CSV files) 8 | *.translation 9 | 10 | # Mono-specific ignores 11 | .mono/ 12 | data_*/ 13 | 14 | # System/tool-specific ignores 15 | .directory 16 | *~ 17 | -------------------------------------------------------------------------------- /example/addons/analog_controller/analog_plugin.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorPlugin 3 | 4 | func _enter_tree(): 5 | add_custom_type("AnalogController", "Node2D", preload("res://addons/analog_controller/analog.gd"), preload("res://addons/analog_controller/icon.png")) 6 | 7 | func _exit_tree(): 8 | remove_custom_type("AnalogController") 9 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/shader_blur.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://addons/TBP_GrassPath2D/noise.png" type="Texture" id=1] 4 | [ext_resource path="res://addons/TBP_GrassPath2D/blur.shader" type="Shader" id=2] 5 | 6 | [resource] 7 | shader = ExtResource( 2 ) 8 | shader_param/angle_degrees = 45.0 9 | shader_param/samples = 8 10 | shader_param/strength = 0.2234 11 | shader_param/noise = ExtResource( 1 ) 12 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/shader_blur.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="ShaderMaterial" load_steps=3 format=2] 2 | 3 | [ext_resource path="res://addons/TBP_GrassPath2D/noise.png" type="Texture" id=1] 4 | [ext_resource path="res://addons/TBP_GrassPath2D/blur.shader" type="Shader" id=2] 5 | 6 | [resource] 7 | shader = ExtResource( 2 ) 8 | shader_param/angle_degrees = 45.0 9 | shader_param/samples = 8 10 | shader_param/strength = 0.2234 11 | shader_param/noise = ExtResource( 1 ) 12 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/load.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorPlugin 3 | 4 | func _enter_tree(): 5 | # Initialization of the plugin goes here 6 | # Add the new type with a name, a parent type, a script and an icon 7 | add_custom_type("TBP_GrassPath2D", "Path2D", preload("TBP_GrassPath2D.gd"), preload("icon.png")) 8 | 9 | func _exit_tree(): 10 | # Clean-up of the plugin goes here 11 | # Always remember to remove it from the engine when deactivated 12 | remove_custom_type("TBP_GrassPath2D") 13 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/load.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends EditorPlugin 3 | 4 | func _enter_tree(): 5 | # Initialization of the plugin goes here 6 | # Add the new type with a name, a parent type, a script and an icon 7 | add_custom_type("TBP_GrassPath2D", "Path2D", preload("TBP_GrassPath2D.gd"), preload("icon.png")) 8 | 9 | func _exit_tree(): 10 | # Clean-up of the plugin goes here 11 | # Always remember to remove it from the engine when deactivated 12 | remove_custom_type("TBP_GrassPath2D") 13 | -------------------------------------------------------------------------------- /example/addons/analog_controller/analog.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Animation" format=2] 2 | 3 | [resource] 4 | resource_name = "alpha_in" 5 | length = 0.5 6 | tracks/0/type = "value" 7 | tracks/0/path = NodePath(".:modulate") 8 | tracks/0/interp = 1 9 | tracks/0/loop_wrap = true 10 | tracks/0/imported = false 11 | tracks/0/enabled = true 12 | tracks/0/keys = { 13 | "times": PoolRealArray( 0, 0.4 ), 14 | "transitions": PoolRealArray( 1, 1 ), 15 | "update": 0, 16 | "values": [ Color( 1, 1, 1, 0 ), Color( 1, 1, 1, 1 ) ] 17 | } 18 | -------------------------------------------------------------------------------- /example/default_env.tres: -------------------------------------------------------------------------------- 1 | [gd_resource type="Environment" load_steps=2 format=2] 2 | 3 | [sub_resource type="ProceduralSky" id=1] 4 | sky_top_color = Color( 0.0470588, 0.454902, 0.976471, 1 ) 5 | sky_horizon_color = Color( 0.556863, 0.823529, 0.909804, 1 ) 6 | sky_curve = 0.25 7 | ground_bottom_color = Color( 0.101961, 0.145098, 0.188235, 1 ) 8 | ground_horizon_color = Color( 0.482353, 0.788235, 0.952941, 1 ) 9 | ground_curve = 0.01 10 | sun_energy = 16.0 11 | 12 | [resource] 13 | background_mode = 2 14 | background_sky = SubResource( 1 ) 15 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2] 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: thiagobruno 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ['https://picpay.me/thiagobrun0'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] 13 | -------------------------------------------------------------------------------- /example/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://icon.png" 13 | dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/assets/ball.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/ball.png-ca93c4f2e7b7f8325cbd933673092ff4.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/ball.png" 13 | dest_files=[ "res://.import/ball.png-ca93c4f2e7b7f8325cbd933673092ff4.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/assets/grass_bkg.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass_bkg.png-9b2ce773505eb1dd0a68900408f92f8a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://assets/grass_bkg.png" 13 | dest_files=[ "res://.import/grass_bkg.png-9b2ce773505eb1dd0a68900408f92f8a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=1 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-7b41dfb853707d484f9f330ef774ac98.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/icon.png" 13 | dest_files=[ "res://.import/icon.png-7b41dfb853707d484f9f330ef774ac98.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/noise.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/noise.png-2ee5353d5a821013b216754d40aed14b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/noise.png" 13 | dest_files=[ "res://.import/noise.png-2ee5353d5a821013b216754d40aed14b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-7b41dfb853707d484f9f330ef774ac98.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/icon.png" 13 | dest_files=[ "res://.import/icon.png-7b41dfb853707d484f9f330ef774ac98.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/noise.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/noise.png-2ee5353d5a821013b216754d40aed14b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/noise.png" 13 | dest_files=[ "res://.import/noise.png-2ee5353d5a821013b216754d40aed14b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/icon.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/icon.png-e304b08143be6f4fb1c52517782f5244.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/icon.png" 13 | dest_files=[ "res://.import/icon.png-e304b08143be6f4fb1c52517782f5244.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/scenes/player.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=3 format=2] 2 | 3 | [ext_resource path="res://scripts/player.gd" type="Script" id=1] 4 | 5 | [sub_resource type="RectangleShape2D" id=1] 6 | extents = Vector2( 40, 100 ) 7 | 8 | [node name="player" type="KinematicBody2D"] 9 | script = ExtResource( 1 ) 10 | 11 | [node name="collision" type="CollisionShape2D" parent="."] 12 | position = Vector2( 0, -100 ) 13 | z_index = 1 14 | shape = SubResource( 1 ) 15 | 16 | [node name="ColorRect" type="ColorRect" parent="."] 17 | margin_left = -40.0 18 | margin_top = -200.0 19 | margin_right = 40.0 20 | rect_pivot_offset = Vector2( 40, 200 ) 21 | color = Color( 0.239216, 0.470588, 0.713726, 0.878431 ) 22 | __meta__ = { 23 | "_edit_use_anchors_": false 24 | } 25 | 26 | [node name="Camera2D" type="Camera2D" parent="."] 27 | current = true 28 | limit_top = 0 29 | limit_bottom = 720 30 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass0.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass0.png-88d158001e2688ccb14c943f77df58a0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass0.png" 13 | dest_files=[ "res://.import/grass0.png-88d158001e2688ccb14c943f77df58a0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass1.png-c1fb7aad5cd1b4b5707dd5305869e0a8.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass1.png" 13 | dest_files=[ "res://.import/grass1.png-c1fb7aad5cd1b4b5707dd5305869e0a8.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass2.png-09c9b1b05ddfa03657ba214798cdeb10.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass2.png" 13 | dest_files=[ "res://.import/grass2.png-09c9b1b05ddfa03657ba214798cdeb10.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass3.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass3.png-ec88615fe0b2dd0a9c86fd85de61f4b5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass3.png" 13 | dest_files=[ "res://.import/grass3.png-ec88615fe0b2dd0a9c86fd85de61f4b5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass4.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass4.png-8b1179c7ee78a5b12abb18b9fa0a504d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass4.png" 13 | dest_files=[ "res://.import/grass4.png-8b1179c7ee78a5b12abb18b9fa0a504d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass5.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass5.png-905078fe5b7f663d2ddeb3bfe506e5e8.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass5.png" 13 | dest_files=[ "res://.import/grass5.png-905078fe5b7f663d2ddeb3bfe506e5e8.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass6.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass6.png-5238a11771784ffae00581b011610af6.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass6.png" 13 | dest_files=[ "res://.import/grass6.png-5238a11771784ffae00581b011610af6.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass7.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass7.png-dd4badf48a4ecaaf48caa025d8cd34c5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass7.png" 13 | dest_files=[ "res://.import/grass7.png-dd4badf48a4ecaaf48caa025d8cd34c5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass8.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass8.png-d8f15dc0ac78bb15a186e9df2cdd931d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass8.png" 13 | dest_files=[ "res://.import/grass8.png-d8f15dc0ac78bb15a186e9df2cdd931d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass9.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass9.png-271be797d68770a134f9acea83ae9a74.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass9.png" 13 | dest_files=[ "res://.import/grass9.png-271be797d68770a134f9acea83ae9a74.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass10.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass10.png-51d60f2d534a6f3ee59e83bf6aecf98b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass10.png" 13 | dest_files=[ "res://.import/grass10.png-51d60f2d534a6f3ee59e83bf6aecf98b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass11.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass11.png-ed2f9433df53567f92a63223ba8ae7cd.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass11.png" 13 | dest_files=[ "res://.import/grass11.png-ed2f9433df53567f92a63223ba8ae7cd.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass12.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass12.png-ec5f929bcc700ae0ae1a965788cec389.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass12.png" 13 | dest_files=[ "res://.import/grass12.png-ec5f929bcc700ae0ae1a965788cec389.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass13.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass13.png-db54749439b66ddc69547d4804dfb15a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass13.png" 13 | dest_files=[ "res://.import/grass13.png-db54749439b66ddc69547d4804dfb15a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass14.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass14.png-eb140f92b7b0f7b8ff0121a3c2012885.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass14.png" 13 | dest_files=[ "res://.import/grass14.png-eb140f92b7b0f7b8ff0121a3c2012885.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass15.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass15.png-3b0b62c178ef33764fc17cdbde52dabd.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass15.png" 13 | dest_files=[ "res://.import/grass15.png-3b0b62c178ef33764fc17cdbde52dabd.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass16.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass16.png-c627b8e5cab2d509eae6db64ee3adad1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass16.png" 13 | dest_files=[ "res://.import/grass16.png-c627b8e5cab2d509eae6db64ee3adad1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass17.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass17.png-01defe027b2134655a6e4dd7ab9a30a1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass17.png" 13 | dest_files=[ "res://.import/grass17.png-01defe027b2134655a6e4dd7ab9a30a1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass18.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass18.png-311b4d5fdba017d4a2da57029578b993.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass18.png" 13 | dest_files=[ "res://.import/grass18.png-311b4d5fdba017d4a2da57029578b993.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/assets/grass19.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass19.png-84d1f355a24c08b2bd06cc29a504ce2d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass19.png" 13 | dest_files=[ "res://.import/grass19.png-84d1f355a24c08b2bd06cc29a504ce2d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass0.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass0.png-88d158001e2688ccb14c943f77df58a0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass0.png" 13 | dest_files=[ "res://.import/grass0.png-88d158001e2688ccb14c943f77df58a0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass1.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass1.png-c1fb7aad5cd1b4b5707dd5305869e0a8.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass1.png" 13 | dest_files=[ "res://.import/grass1.png-c1fb7aad5cd1b4b5707dd5305869e0a8.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass10.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass10.png-51d60f2d534a6f3ee59e83bf6aecf98b.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass10.png" 13 | dest_files=[ "res://.import/grass10.png-51d60f2d534a6f3ee59e83bf6aecf98b.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass11.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass11.png-ed2f9433df53567f92a63223ba8ae7cd.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass11.png" 13 | dest_files=[ "res://.import/grass11.png-ed2f9433df53567f92a63223ba8ae7cd.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass12.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass12.png-ec5f929bcc700ae0ae1a965788cec389.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass12.png" 13 | dest_files=[ "res://.import/grass12.png-ec5f929bcc700ae0ae1a965788cec389.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass13.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass13.png-db54749439b66ddc69547d4804dfb15a.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass13.png" 13 | dest_files=[ "res://.import/grass13.png-db54749439b66ddc69547d4804dfb15a.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass14.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass14.png-eb140f92b7b0f7b8ff0121a3c2012885.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass14.png" 13 | dest_files=[ "res://.import/grass14.png-eb140f92b7b0f7b8ff0121a3c2012885.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass15.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass15.png-3b0b62c178ef33764fc17cdbde52dabd.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass15.png" 13 | dest_files=[ "res://.import/grass15.png-3b0b62c178ef33764fc17cdbde52dabd.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass16.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass16.png-c627b8e5cab2d509eae6db64ee3adad1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass16.png" 13 | dest_files=[ "res://.import/grass16.png-c627b8e5cab2d509eae6db64ee3adad1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass17.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass17.png-01defe027b2134655a6e4dd7ab9a30a1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass17.png" 13 | dest_files=[ "res://.import/grass17.png-01defe027b2134655a6e4dd7ab9a30a1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass18.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass18.png-311b4d5fdba017d4a2da57029578b993.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass18.png" 13 | dest_files=[ "res://.import/grass18.png-311b4d5fdba017d4a2da57029578b993.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass19.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass19.png-84d1f355a24c08b2bd06cc29a504ce2d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass19.png" 13 | dest_files=[ "res://.import/grass19.png-84d1f355a24c08b2bd06cc29a504ce2d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass2.png-09c9b1b05ddfa03657ba214798cdeb10.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass2.png" 13 | dest_files=[ "res://.import/grass2.png-09c9b1b05ddfa03657ba214798cdeb10.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass3.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass3.png-ec88615fe0b2dd0a9c86fd85de61f4b5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass3.png" 13 | dest_files=[ "res://.import/grass3.png-ec88615fe0b2dd0a9c86fd85de61f4b5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass4.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass4.png-8b1179c7ee78a5b12abb18b9fa0a504d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass4.png" 13 | dest_files=[ "res://.import/grass4.png-8b1179c7ee78a5b12abb18b9fa0a504d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass5.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass5.png-905078fe5b7f663d2ddeb3bfe506e5e8.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass5.png" 13 | dest_files=[ "res://.import/grass5.png-905078fe5b7f663d2ddeb3bfe506e5e8.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass6.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass6.png-5238a11771784ffae00581b011610af6.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass6.png" 13 | dest_files=[ "res://.import/grass6.png-5238a11771784ffae00581b011610af6.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass7.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass7.png-dd4badf48a4ecaaf48caa025d8cd34c5.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass7.png" 13 | dest_files=[ "res://.import/grass7.png-dd4badf48a4ecaaf48caa025d8cd34c5.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass8.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass8.png-d8f15dc0ac78bb15a186e9df2cdd931d.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass8.png" 13 | dest_files=[ "res://.import/grass8.png-d8f15dc0ac78bb15a186e9df2cdd931d.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/assets/grass9.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/grass9.png-271be797d68770a134f9acea83ae9a74.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/TBP_GrassPath2D/assets/grass9.png" 13 | dest_files=[ "res://.import/grass9.png-271be797d68770a134f9acea83ae9a74.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=1 18 | compress/lossy_quality=0.68 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=false 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle.png-8e1df57959b3fe614146ea3064fe81e4.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle.png" 13 | dest_files=[ "res://.import/big_circle.png-8e1df57959b3fe614146ea3064fe81e4.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/small_circle.png-6b3a0258d39e2f48a9d8212a99890295.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/small_circle.png" 13 | dest_files=[ "res://.import/small_circle.png-6b3a0258d39e2f48a9d8212a99890295.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle_DIRECTION_2.png-fd72c64ba7d0946b7c6448d0da6f9fbe.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle_DIRECTION_2.png" 13 | dest_files=[ "res://.import/big_circle_DIRECTION_2.png-fd72c64ba7d0946b7c6448d0da6f9fbe.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_4.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle_DIRECTION_4.png-917f0e212fd2ec67544f8c8800f38503.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle_DIRECTION_4.png" 13 | dest_files=[ "res://.import/big_circle_DIRECTION_4.png-917f0e212fd2ec67544f8c8800f38503.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_8.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle_DIRECTION_8.png-4cd1c102915dd8bcf67b0bc0be67f87c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle_DIRECTION_8.png" 13 | dest_files=[ "res://.import/big_circle_DIRECTION_8.png-4cd1c102915dd8bcf67b0bc0be67f87c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_2_H.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle_DIRECTION_2_H.png-a8c2e0bfd4c462227a0aaeb9ba12a53c.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle_DIRECTION_2_H.png" 13 | dest_files=[ "res://.import/big_circle_DIRECTION_2_H.png-a8c2e0bfd4c462227a0aaeb9ba12a53c.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/big_circle_DIRECTION_2_V.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/big_circle_DIRECTION_2_V.png-63ff0287eb3ac729b7678b80a84c9c66.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/big_circle_DIRECTION_2_V.png" 13 | dest_files=[ "res://.import/big_circle_DIRECTION_2_V.png-63ff0287eb3ac729b7678b80a84c9c66.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_2.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/small_circle_DIRECTION_2.png-9e8092e072c044cefa31435ac2b657a1.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/small_circle_DIRECTION_2.png" 13 | dest_files=[ "res://.import/small_circle_DIRECTION_2.png-9e8092e072c044cefa31435ac2b657a1.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_4.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/small_circle_DIRECTION_4.png-8078b37708e69615e76b4923b2effee0.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/small_circle_DIRECTION_4.png" 13 | dest_files=[ "res://.import/small_circle_DIRECTION_4.png-8078b37708e69615e76b4923b2effee0.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /example/addons/analog_controller/small_circle_DIRECTION_8.png.import: -------------------------------------------------------------------------------- 1 | [remap] 2 | 3 | importer="texture" 4 | type="StreamTexture" 5 | path="res://.import/small_circle_DIRECTION_8.png-3a60fe851b4df30b5468555e2516e763.stex" 6 | metadata={ 7 | "vram_texture": false 8 | } 9 | 10 | [deps] 11 | 12 | source_file="res://addons/analog_controller/small_circle_DIRECTION_8.png" 13 | dest_files=[ "res://.import/small_circle_DIRECTION_8.png-3a60fe851b4df30b5468555e2516e763.stex" ] 14 | 15 | [params] 16 | 17 | compress/mode=0 18 | compress/lossy_quality=0.7 19 | compress/hdr_mode=0 20 | compress/bptc_ldr=0 21 | compress/normal_map=0 22 | flags/repeat=0 23 | flags/filter=true 24 | flags/mipmaps=false 25 | flags/anisotropic=false 26 | flags/srgb=2 27 | process/fix_alpha_border=true 28 | process/premult_alpha=false 29 | process/HDR_as_SRGB=false 30 | process/invert_color=false 31 | stream=false 32 | size_limit=0 33 | detect_3d=true 34 | svg/scale=1.0 35 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/blur.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode blend_mix; 3 | 4 | uniform float angle_degrees ; 5 | uniform sampler2D noise; 6 | uniform int samples = 8; //MUST BE A MULTIPLE OF 2 7 | uniform float strength : hint_range(0,1.0, 0.0001); 8 | 9 | vec4 DirectionalBlur(in vec2 uv, in vec2 MotionVector, in sampler2D Texture) 10 | { 11 | vec4 Color = vec4(0.0); 12 | float Noise = texture(noise,uv*20.0).x-0.485; 13 | 14 | for (int i=1; i<=samples/2; i++) 15 | { 16 | Color += texture(Texture,uv+ (float(i)*MotionVector ) /float(samples/2)*Noise*2.0); 17 | Color += texture(Texture,uv- (float(i)*MotionVector ) /float(samples/2)*Noise*2.0); 18 | } 19 | return Color/(float(samples)); 20 | } 21 | 22 | 23 | void fragment(){ 24 | vec2 blur_vector = vec2(cos(radians(angle_degrees)),sin(radians(angle_degrees)))*strength; 25 | COLOR=DirectionalBlur(UV, blur_vector*strength, TEXTURE); 26 | } 27 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/blur.shader: -------------------------------------------------------------------------------- 1 | shader_type canvas_item; 2 | render_mode blend_mix; 3 | 4 | uniform float angle_degrees ; 5 | uniform sampler2D noise; 6 | uniform int samples = 8; //MUST BE A MULTIPLE OF 2 7 | uniform float strength : hint_range(0,1.0, 0.0001); 8 | 9 | vec4 DirectionalBlur(in vec2 uv, in vec2 MotionVector, in sampler2D Texture) 10 | { 11 | vec4 Color = vec4(0.0); 12 | float Noise = texture(noise,uv*20.0).x-0.485; 13 | 14 | for (int i=1; i<=samples/2; i++) 15 | { 16 | Color += texture(Texture,uv+ (float(i)*MotionVector ) /float(samples/2)*Noise*2.0); 17 | Color += texture(Texture,uv- (float(i)*MotionVector ) /float(samples/2)*Noise*2.0); 18 | } 19 | return Color/(float(samples)); 20 | } 21 | 22 | 23 | void fragment(){ 24 | vec2 blur_vector = vec2(cos(radians(angle_degrees)),sin(radians(angle_degrees)))*strength; 25 | COLOR=DirectionalBlur(UV, blur_vector*strength, TEXTURE); 26 | } 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 thiagobruno 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /example/project.godot: -------------------------------------------------------------------------------- 1 | ; Engine configuration file. 2 | ; It's best edited using the editor UI and not directly, 3 | ; since the parameters that go here are not all obvious. 4 | ; 5 | ; Format: 6 | ; [section] ; section goes between [] 7 | ; param=value ; assign values to parameters 8 | 9 | config_version=4 10 | 11 | _global_script_classes=[ ] 12 | _global_script_class_icons={ 13 | 14 | } 15 | 16 | [application] 17 | 18 | config/name="Godot GrassPath2D" 19 | run/main_scene="res://scenes/main.tscn" 20 | config/icon="res://icon.png" 21 | 22 | [display] 23 | 24 | window/size/width=1280 25 | window/size/height=720 26 | window/size/test_width=640 27 | window/size/test_height=360 28 | window/stretch/mode="2d" 29 | window/stretch/aspect="keep" 30 | 31 | [editor_plugins] 32 | 33 | enabled=PoolStringArray( "TBP_GrassPath2D", "analog_controller" ) 34 | 35 | [rendering] 36 | 37 | quality/driver/driver_name="GLES2" 38 | quality/2d/gles2_use_nvidia_rect_flicker_workaround=true 39 | quality/intended_usage/framebuffer_allocation=0 40 | quality/intended_usage/framebuffer_allocation.mobile=1 41 | quality/2d/use_pixel_snap=true 42 | vram_compression/import_etc=true 43 | environment/default_clear_color=Color( 0.517647, 0.682353, 0.737255, 1 ) 44 | environment/default_environment="res://default_env.tres" 45 | -------------------------------------------------------------------------------- /example/scripts/player.gd: -------------------------------------------------------------------------------- 1 | extends KinematicBody2D 2 | 3 | var run_speed = 150 4 | var jump_speed = -600 5 | var gravity = 2500 6 | var jumpQtd = 0 7 | var jumpQtdMax = 1 8 | export var sleeping = false 9 | var analogPressed = false 10 | 11 | var velocity = Vector2() 12 | 13 | func get_input(): 14 | if !analogPressed: 15 | velocity.x = 0 16 | var right = Input.is_action_pressed('ui_right') 17 | var left = Input.is_action_pressed('ui_left') 18 | 19 | if right: 20 | velocity.x += run_speed 21 | if left: 22 | velocity.x -= run_speed 23 | 24 | if is_on_floor(): 25 | jumpQtd = 0 26 | 27 | func _jump(): 28 | if jumpQtd < jumpQtdMax: 29 | velocity.y = jump_speed 30 | jumpQtd += 1 31 | 32 | func _physics_process(delta): 33 | if sleeping: return 34 | velocity.y += gravity * delta 35 | get_input() 36 | velocity = move_and_slide(velocity, Vector2(0, -1)) 37 | 38 | func _on_AnalogController_analogChange(force, pos): 39 | if pos is String: 40 | velocity.x = ((force) * (2 * scale) * run_speed).x 41 | else: 42 | velocity.x = ((pos * force) * run_speed).x 43 | 44 | func _on_AnalogController_analogRelease(): 45 | analogPressed = false 46 | velocity = Vector2.ZERO 47 | 48 | func _input(event): 49 | if event.is_action_pressed("ui_accept"): 50 | _jump() 51 | 52 | if event is InputEventScreenTouch: 53 | if event.index == 1: 54 | _jump() 55 | 56 | 57 | func _on_AnalogController_analogPressed(): 58 | analogPressed = true 59 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Godot - TBP_GrassPath2D 2 | 3 | - Developed and tested on Godot 3.2 4 | - [Portuguese documentation](README_PT-BR.md) 5 | - Tested with GLES2 and GLES3 (PC and Android) 6 | - FPS varies a lot according to the configuration of the interval between the "leafs" and the parameter "maxProcess" which is the maximum number of physics processes for the grass segment. 7 | 8 | Interactive grass generator through a Path2D (Curve). 9 | 10 | ### Plugin parameters 11 | ------ 12 | CAUTION!!! 13 | interval: this parameter if less than 15 can significantly lose performance in conjunction with the "interactive" parameter if enabled. 14 | 15 | For better performance, increase the value of "interval", which is the interval between the "leafs", and adjust the process limit to "maxProcess" physics 16 | ------ 17 | - ```interval```: Space between "leafs" 18 | - ```interactive```: If enabled, interact with objects in the group "groupInteractive" 19 | - ```maxProcess```: Maximum processes for leaf physics that interact at the same time 20 | 21 | 22 | - ```colorGrass```: Color array for "leafs" - Textures reported in "grassTextures" must be white 23 | - ```blur_samples```: Blur sample 24 | - ```blur_strength```: Blur strength - 0 à 1 25 | - ```colorTerrain```: Terrain color, if generated 26 | - ```generateTerrain```: Generates a StaticBody terrain with collision 27 | - ```maxHeightTerrain```: Maximum height in pixels for the generated terrain 28 | - ```interactiveArea```: A pixel "width" for the "leaf" area to interact with the object 29 | - ```followAngle```: Whether the "leaf" should follow the rotation of the terrain curve 30 | - ```heightGrass```: Grass height 31 | - ```randomGrassMin```: Minimum range to randomize leaf rotation 32 | - ```randomGrassMax```: Maximum range to randomize leaf rotation 33 | - ```windForce```: Power to the wind 34 | - ```windDirection```: Wind direction, -1 to the left and 1 to the right 35 | - ```grassZIndex```: Index for the Z Index of the leafs 36 | - ```grassYOffset```: Y offset for leafs 37 | - ```maxLeafRotateDegree```: Maximum (º) degree for leaf rotation 38 | - ```grassTextures```: Array that will be randomized between leafs 39 | - ```groupInteractive```: String array with the name of the group that the "leaf" should interact with, that same group must be in the object 40 | 41 | ---------- 42 | 43 | ### Demonstration Video (PT-BR) 44 | - https://www.youtube.com/watch?v=6wFHC3af164 45 | 46 | [![Demonstration](https://img.youtube.com/vi/6wFHC3af164/0.jpg)](https://www.youtube.com/watch?v=6wFHC3af164) 47 | 48 | ---------- 49 | 50 | ##### Example 51 | - In the project example, I show how to use the plugin, to move the "player" on the PC, use the arrows keys, and the space to jump. 52 | - It is also possible to run on Android, just click and drag to move the "player", and with the analog stick tap with a second finger to jump. 53 | 54 | ---------- 55 | 56 | ##### Configure the Addon 57 | - Download the folder [addons/TBP_GrassPath2D](addons/TBP_GrassPath2D) 58 | - Put it in your project's "addons" folder 59 | - Go to Project Settings > Plugin and enable the "TBP_GrassPath2D" plugin 60 | 61 | ---------- 62 | 63 | ##### AnimationPlayer 64 | 65 | You can use an AnimationPlayer or GDScript to change some parameters at run time, for now, you can change the following parameters: 66 | 67 | - heightGrass 68 | - windDirection 69 | - windForce 70 | 71 | ---------- 72 | 73 | ### ... 74 | Will you use this code commercially? Rest assured you can use it freely and without having to mention anything, of course I will be happy if you at least remember the help and share it with friends, lol. If you feel at heart, consider buying me a coffee heart -> https://ko-fi.com/thsbruno 75 | 76 | -------------------------------------------------------------------------------- /README_PT-BR.md: -------------------------------------------------------------------------------- 1 | # Godot - TBP_GrassPath2D 2 | 3 | - Desenvolvido e testado na Godot 3.2 4 | - [English documentation](README.md) 5 | - Testado com GLES2 e GLES3 (PC e Android) 6 | - FPS varia bastante de acordo com a configuração do intervalo entre as folhas e o parâmetro "maxProcess" que é o número máximo de processos de física para o segmento de grama. 7 | 8 | Gerador de grama interativa através de um Path2D(Curve). 9 | 10 | ### Parâmetros do Plugin 11 | ------ 12 | CUIDADO!!! 13 | interval: esse parâmetro se menor que 15 pode perder consideravelmente a performance em conjunto com o parâmetro "interactive" se habilitado. 14 | 15 | Para uma melhor performance, aumente o valor de "interval" que é o intervalo entre as folhas, e ajuste o limite dos processos para a física "maxProcess" 16 | ------ 17 | - ```interval```: Espaço entre as folhas 18 | - ```interactive```: Se habilitado, interage com os objetos no grupo "groupInteractive" 19 | - ```maxProcess```: Máximo de processos para a física das folhas que interagem ao mesmo tempo 20 | 21 | 22 | - ```colorGrass```: Array de cores para as gramas - As texturas informadas em "grassTextures" precisam ser de cor branca 23 | - ```blur_samples```: Amostras para o blur 24 | - ```blur_strength```: Força do blur, sendo de 0 à 1 25 | - ```colorTerrain```: Cor do terreno, se ele for gerado 26 | - ```generateTerrain```: Gera um terreno StaticBody com colisão 27 | - ```maxHeightTerrain```: Altura máxima em pixels para o terreno gerado 28 | - ```interactiveArea```: Uma largura em pixel para a área da folha interagir com o objeto 29 | - ```followAngle```: Se as folhas devem seguir a rotação da curva do terreno 30 | - ```heightGrass```: Altura da grama 31 | - ```randomGrassMin```: Range mínimo para randomizar a rotação da folha 32 | - ```randomGrassMax```: Range máximo para randomizar a rotação da folha 33 | - ```windForce```: Força para o vento 34 | - ```windDirection```: Direção do vento, sendo -1 para a esquerda, e 1 para a direita 35 | - ```grassZIndex```: Indice para o Z Index das folhas 36 | - ```grassYOffset```: Offset em Y para as folhas 37 | - ```maxLeafRotateDegree```: Grau(º) máximo para a rotação das folhas 38 | - ```grassTextures```: Array que será randomizado entre as folhas 39 | - ```groupInteractive```: Array de Strings com o nome do grupo que a folha deve interagir, esse mesmo grupo deve estar no objeto 40 | 41 | ---------- 42 | 43 | ### Demonstração (PT-BR) 44 | - https://www.youtube.com/watch?v=6wFHC3af164 45 | 46 | [![Demonstração](https://img.youtube.com/vi/6wFHC3af164/0.jpg)](https://www.youtube.com/watch?v=6wFHC3af164) 47 | 48 | ---------- 49 | 50 | ##### Exemplo 51 | - No projeto exemplo, mostro como utilizar o plugin, para movimentar o "player" no PC, use as setas, e o espaço para pular. 52 | - É possível também executar no Android, basta clicar e arrastar para movimentar o "player", e com o analógico pressionado toque com um segundo dedo para pular. 53 | 54 | ---------- 55 | 56 | ##### Configurar o Addon 57 | - Faça download do diretório [addons/TBP_GrassPath2D](addons/TBP_GrassPath2D) 58 | - Coloque na pasta "addons" do seu projeto 59 | - Acesse as Configurações do Projeto > Plugin e habilite o plugin "TBP_GrassPath2D" 60 | 61 | ---------- 62 | 63 | ##### AnimationPlayer 64 | 65 | Você pode usar um AnimationPlayer ou via GDScript para mudar alguns parâmetros em tempo de execução, por enquanto, é possível alterar os seguintes parâmentros: 66 | 67 | - heightGrass 68 | - windDirection 69 | - windForce 70 | 71 | ---------- 72 | 73 | ### ... 74 | Vai utilizar esse código de forma comercial? Fique tranquilo pode usar de forma livre e sem precisar mencionar nada, claro que vou ficar contente se pelo menos lembrar da ajuda e compartilhar com os amigos, rs. Caso sinta no coração, considere me pagar um cafezinho :heart: -> https://ko-fi.com/thsbruno 75 | 76 | -------------------------------------------------------------------------------- /example/scenes/exemploAnimation1.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=17 format=2] 2 | 3 | [ext_resource path="res://addons/TBP_GrassPath2D/TBP_GrassPath2D.gd" type="Script" id=1] 4 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass0.png" type="Texture" id=2] 5 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass4.png" type="Texture" id=3] 6 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass8.png" type="Texture" id=4] 7 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass9.png" type="Texture" id=5] 8 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass10.png" type="Texture" id=6] 9 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass11.png" type="Texture" id=7] 10 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass13.png" type="Texture" id=8] 11 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass14.png" type="Texture" id=9] 12 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass15.png" type="Texture" id=10] 13 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass17.png" type="Texture" id=12] 14 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass18.png" type="Texture" id=13] 15 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass19.png" type="Texture" id=14] 16 | 17 | [sub_resource type="Curve2D" id=1] 18 | _data = { 19 | "points": PoolVector2Array( 0, 0, 0, 0, 0, 670, 0, 0, 0, 0, 1280, 670 ) 20 | } 21 | 22 | [sub_resource type="Animation" id=2] 23 | resource_name = "start" 24 | length = 10.0 25 | loop = true 26 | tracks/0/type = "value" 27 | tracks/0/path = NodePath("TBP_GrassPath2D:heightGrass") 28 | tracks/0/interp = 1 29 | tracks/0/loop_wrap = true 30 | tracks/0/imported = false 31 | tracks/0/enabled = true 32 | tracks/0/keys = { 33 | "times": PoolRealArray( 0, 5 ), 34 | "transitions": PoolRealArray( 1, 1 ), 35 | "update": 0, 36 | "values": [ 1.0, 0.0 ] 37 | } 38 | 39 | [sub_resource type="Animation" id=3] 40 | resource_name = "start" 41 | length = 50.0 42 | loop = true 43 | tracks/0/type = "value" 44 | tracks/0/path = NodePath("TBP_GrassPath2D:windDirection") 45 | tracks/0/interp = 1 46 | tracks/0/loop_wrap = true 47 | tracks/0/imported = false 48 | tracks/0/enabled = true 49 | tracks/0/keys = { 50 | "times": PoolRealArray( 0, 6, 10, 15, 20, 30 ), 51 | "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ), 52 | "update": 0, 53 | "values": [ 0.323, 0.323, -0.981, -0.981, 1.0, 1.0 ] 54 | } 55 | tracks/1/type = "value" 56 | tracks/1/path = NodePath("TBP_GrassPath2D:windForce") 57 | tracks/1/interp = 1 58 | tracks/1/loop_wrap = true 59 | tracks/1/imported = false 60 | tracks/1/enabled = true 61 | tracks/1/keys = { 62 | "times": PoolRealArray( 0, 6, 12, 20, 26.1, 37 ), 63 | "transitions": PoolRealArray( 1, 1, 1, 1, 1, 1 ), 64 | "update": 0, 65 | "values": [ 0.241, 0.241, 0.719, 0.748, 0.803, 0.296 ] 66 | } 67 | 68 | [node name="ExemploAnimation1" type="Node2D"] 69 | 70 | [node name="TBP_GrassPath2DBackground" type="Path2D" parent="."] 71 | curve = SubResource( 1 ) 72 | script = ExtResource( 1 ) 73 | blur_strength = 0.703 74 | colorTerrain = Color( 0, 0, 0, 1 ) 75 | interval = 3.0 76 | interactive = false 77 | randomGrassMin = -0.945 78 | randomGrassMax = 1.0 79 | windForce = 0.803 80 | windDirection = 1.0 81 | grassYOffset = 0.0 82 | maxLeafRotateDegree = 90.0 83 | 84 | [node name="TBP_GrassPath2D" type="Path2D" parent="."] 85 | position = Vector2( 0, -64 ) 86 | curve = SubResource( 1 ) 87 | script = ExtResource( 1 ) 88 | blur_strength = 0.081 89 | colorTerrain = Color( 0, 0, 0, 1 ) 90 | interval = 3.0 91 | interactive = false 92 | randomGrassMin = -0.945 93 | randomGrassMax = 1.0 94 | windForce = 0.803 95 | windDirection = 1.0 96 | grassYOffset = 10.0 97 | maxLeafRotateDegree = 90.0 98 | grassTextures = [ ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ), ExtResource( 6 ), ExtResource( 7 ), ExtResource( 8 ), ExtResource( 9 ), ExtResource( 10 ), ExtResource( 12 ), ExtResource( 13 ), ExtResource( 14 ), ExtResource( 2 ) ] 99 | 100 | [node name="heighGrass" type="AnimationPlayer" parent="."] 101 | anims/start = SubResource( 2 ) 102 | 103 | [node name="windDirection" type="AnimationPlayer" parent="."] 104 | autoplay = "start" 105 | anims/start = SubResource( 3 ) 106 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/TBP_GrassLeaf.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | const TIMER_LIMIT = .02 4 | 5 | export(bool) var interactive = false 6 | export(float) var windForce = 0 7 | export(float) var windDirection = 0 8 | export(float) var followAngle = 0 9 | export(float) var heightGrass = 1 setget _setHeightGrass 10 | export(float) var grassYOffset = 20 11 | export(float, 60, 150) var interactiveArea = 90 12 | export(float) var maxRotate = 45.0 13 | export(int, 1, 100) var maxProcess = 50 14 | export(ShaderMaterial) var leafMaterial 15 | export(Vector2) var randomGrass = Vector2.ZERO 16 | export(Array) var groupInteractive:Array = ["interact_grass"] 17 | 18 | var timerDelta:float = 0.0 19 | var direction:float = 1 20 | var dirWind:float = 1 21 | var rotWindMin:float = 0 22 | var rotWindMax:float = 0 23 | var interact_object 24 | var speed:float = 0.08 25 | var texture: Texture 26 | var windTime = 0 27 | var timer 28 | var flag = 'MIN' 29 | var rnd = RandomNumberGenerator.new() 30 | 31 | func _ready() -> void: 32 | # Add the leaf to group 33 | add_to_group("TBP_GrassLeaf") 34 | 35 | rnd.randomize() 36 | 37 | # Create a sprite to texture 38 | var sprite = Sprite.new() 39 | sprite.name = "Sprite" 40 | sprite.texture = texture 41 | sprite.material = leafMaterial 42 | sprite.centered = false 43 | var s = sprite.texture.get_size() 44 | var h = s.y 45 | 46 | # Create a control to crop de sprite 47 | var g = Control.new() 48 | g.name = "Control" 49 | g.rect_min_size = s 50 | g.rect_size = s 51 | g.rect_position.x = -s.x / 2 52 | g.rect_position.y = -s.y + grassYOffset 53 | g.rect_pivot_offset.x = s.x / 2 54 | g.rect_pivot_offset.y = s.y + grassYOffset 55 | g.rect_clip_content = true 56 | 57 | # adjust the heighGrass 58 | sprite.offset.y = (1.0 - heightGrass) * h 59 | 60 | # settings the wind rotations and wind direction 61 | _configure(g) 62 | 63 | # If interactive 64 | if interactive: 65 | # create Area with collision to contact 66 | var area = Area2D.new() 67 | var collision = CollisionShape2D.new() 68 | var cshape = RectangleShape2D.new() 69 | 70 | # connect signals 71 | area.connect("body_entered", self, "_on_area_body_entered") 72 | area.connect("body_exited", self, "_on_area_body_exited") 73 | 74 | # setting the shape and collision 75 | cshape.extents.x = interactiveArea 76 | cshape.extents.y = (heightGrass * h) - grassYOffset 77 | collision.shape = cshape 78 | collision.position.y = -(heightGrass * h) - grassYOffset 79 | collision.rotation = followAngle 80 | call_deferred("add_child", area) 81 | area.call_deferred("add_child", collision) 82 | 83 | g.call_deferred("add_child", sprite) 84 | call_deferred("add_child", g) 85 | 86 | # set physics off 87 | set_physics_process(false) 88 | 89 | # if exists wind force 90 | if windForce != 0: 91 | windTime = g.rect_rotation 92 | 93 | # create a timer 94 | timer = Timer.new() 95 | timer.wait_time = .01 96 | timer.autostart = true 97 | timer.one_shot = false 98 | timer.connect("timeout", self, "_on_timer_wind") 99 | add_child(timer) 100 | 101 | func _physics_process(delta) -> void: 102 | if !interactive: return 103 | 104 | # limite the physics process to increase fps 105 | timerDelta += delta 106 | if timerDelta > TIMER_LIMIT: 107 | timerDelta = 0.0 108 | 109 | var per = 0 110 | if interact_object != null: 111 | if weakref(interact_object).get_ref(): 112 | # calculates the collision percentage 113 | var percent = interactiveArea 114 | var s = self.global_position.distance_to(interact_object.global_position) 115 | per = 1.0 - clamp(s * 100.0 / percent, 0, 100.0) / 100.0 116 | 117 | # rotates the leaf according to the object that collided 118 | rotation = lerp(rotation, clamp(per, 0, deg2rad(maxRotate)) * direction, speed) 119 | 120 | func _configure(control)->void: 121 | # settings the wind rotations and wind direction 122 | rotWindMin = rnd.randf_range(deg2rad(maxRotate) * randomGrass.x, deg2rad(maxRotate) * randomGrass.y) 123 | rotWindMax = deg2rad(maxRotate) 124 | 125 | control.rect_rotation = rad2deg(rotWindMin + followAngle) 126 | 127 | if windForce > 0: 128 | rotWindMin *= windDirection 129 | rotWindMax *= windDirection 130 | control.rect_rotation = (rad2deg(abs(rotWindMax - rotWindMin)) * (windForce)) - 0 131 | 132 | if windForce != 0: 133 | windTime = control.rect_rotation 134 | 135 | func _on_area_body_entered(body) -> void: 136 | # if the collided object is in the group 137 | if _checkGroup(body) and interactive: 138 | interact_object = body 139 | # get the direction of the collision 140 | direction = -sign(interact_object.global_position.x - self.global_position.x) 141 | # checks how many physics are being precessed for the leafs, and validates that it is within the limit 142 | if get_parent().grassProcess < maxProcess: 143 | get_parent().grassProcess += 1 144 | set_physics_process(true) 145 | 146 | func _on_area_body_exited(body) -> void: 147 | if _checkGroup(body): 148 | interact_object = null 149 | 150 | yield(get_tree().create_timer(.2), "timeout") 151 | set_physics_process(false) 152 | 153 | if get_parent().grassProcess > 0: 154 | get_parent().grassProcess -= 1 155 | 156 | func _on_timer_wind() -> void: 157 | # moves the leafs according to the wind 158 | var minn = (rad2deg(abs(rotWindMax-rotWindMin)) * (windForce)) - 0 159 | var total = rad2deg(abs(rotWindMax-rotWindMin)) 160 | 161 | if windTime <= total and flag == 'MIN': 162 | windTime += rnd.randf() * windForce 163 | if windTime > total: 164 | flag = 'MAX' 165 | 166 | if windTime >= minn and flag == 'MAX': 167 | windTime -= rnd.randf() * windForce 168 | if windTime < minn: 169 | flag = 'MIN' 170 | 171 | $Control.rect_rotation = lerp($Control.rect_rotation, windTime * windDirection, .1 * windForce) 172 | 173 | # validates the group and if the object has global_position 174 | func _checkGroup(body) -> bool: 175 | for g in groupInteractive: 176 | if body.is_in_group(g) and body.get("global_position") != null: 177 | return true 178 | break 179 | return false 180 | 181 | # setget to change heighGrass 182 | func _setHeightGrass(newHeight) -> void: 183 | heightGrass = newHeight 184 | 185 | if Engine.editor_hint: return 186 | var sprite = $Control/Sprite 187 | if sprite == null: return 188 | if weakref(sprite).get_ref(): 189 | var h = sprite.texture.get_size().y 190 | sprite.offset.y = ((1.0 - heightGrass) * h) 191 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/TBP_GrassLeaf.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | const TIMER_LIMIT = .02 4 | 5 | export(bool) var interactive = false 6 | export(float) var windForce = 0 7 | export(float) var windDirection = 0 8 | export(float) var followAngle = 0 9 | export(float) var heightGrass = 1 setget _setHeightGrass 10 | export(float) var grassYOffset = 20 11 | export(float, 60, 150) var interactiveArea = 90 12 | export(float) var maxRotate = 45.0 13 | export(int, 1, 100) var maxProcess = 50 14 | export(ShaderMaterial) var leafMaterial 15 | export(Vector2) var randomGrass = Vector2.ZERO 16 | export(Array) var groupInteractive:Array = ["interact_grass"] 17 | 18 | var timerDelta:float = 0.0 19 | var direction:float = 1 20 | var dirWind:float = 1 21 | var rotWindMin:float = 0 22 | var rotWindMax:float = 0 23 | var interact_object 24 | var speed:float = 0.08 25 | var texture: Texture 26 | var windTime = 0 27 | var timer 28 | var flag = 'MIN' 29 | var rnd = RandomNumberGenerator.new() 30 | 31 | func _ready() -> void: 32 | # Add the leaf to group 33 | add_to_group("TBP_GrassLeaf") 34 | 35 | rnd.randomize() 36 | 37 | # Create a sprite to texture 38 | var sprite = Sprite.new() 39 | sprite.name = "Sprite" 40 | sprite.texture = texture 41 | sprite.material = leafMaterial 42 | sprite.centered = false 43 | var s = sprite.texture.get_size() 44 | var h = s.y 45 | 46 | # Create a control to crop de sprite 47 | var g = Control.new() 48 | g.name = "Control" 49 | g.rect_min_size = s 50 | g.rect_size = s 51 | g.rect_position.x = -s.x / 2 52 | g.rect_position.y = -s.y + grassYOffset 53 | g.rect_pivot_offset.x = s.x / 2 54 | g.rect_pivot_offset.y = s.y + grassYOffset 55 | g.rect_clip_content = true 56 | 57 | # adjust the heighGrass 58 | sprite.offset.y = (1.0 - heightGrass) * h 59 | 60 | # settings the wind rotations and wind direction 61 | _configure(g) 62 | 63 | # If interactive 64 | if interactive: 65 | # create Area with collision to contact 66 | var area = Area2D.new() 67 | var collision = CollisionShape2D.new() 68 | var cshape = RectangleShape2D.new() 69 | 70 | # connect signals 71 | area.connect("body_entered", self, "_on_area_body_entered") 72 | area.connect("body_exited", self, "_on_area_body_exited") 73 | 74 | # setting the shape and collision 75 | cshape.extents.x = interactiveArea 76 | cshape.extents.y = (heightGrass * h) - grassYOffset 77 | collision.shape = cshape 78 | collision.position.y = -(heightGrass * h) - grassYOffset 79 | collision.rotation = followAngle 80 | call_deferred("add_child", area) 81 | area.call_deferred("add_child", collision) 82 | 83 | g.call_deferred("add_child", sprite) 84 | call_deferred("add_child", g) 85 | 86 | # set physics off 87 | set_physics_process(false) 88 | 89 | # if exists wind force 90 | if windForce != 0: 91 | windTime = g.rect_rotation 92 | 93 | # create a timer 94 | timer = Timer.new() 95 | timer.wait_time = .01 96 | timer.autostart = true 97 | timer.one_shot = false 98 | timer.connect("timeout", self, "_on_timer_wind") 99 | add_child(timer) 100 | 101 | func _physics_process(delta) -> void: 102 | if !interactive: return 103 | 104 | # limite the physics process to increase fps 105 | timerDelta += delta 106 | if timerDelta > TIMER_LIMIT: 107 | timerDelta = 0.0 108 | 109 | var per = 0 110 | if interact_object != null: 111 | if weakref(interact_object).get_ref(): 112 | # calculates the collision percentage 113 | var percent = interactiveArea 114 | var s = self.global_position.distance_to(interact_object.global_position) 115 | per = 1.0 - clamp(s * 100.0 / percent, 0, 100.0) / 100.0 116 | 117 | # rotates the leaf according to the object that collided 118 | rotation = lerp(rotation, clamp(per, 0, deg2rad(maxRotate)) * direction, speed) 119 | 120 | func _configure(control)->void: 121 | # settings the wind rotations and wind direction 122 | rotWindMin = rnd.randf_range(deg2rad(maxRotate) * randomGrass.x, deg2rad(maxRotate) * randomGrass.y) 123 | rotWindMax = deg2rad(maxRotate) 124 | 125 | control.rect_rotation = rad2deg(rotWindMin + followAngle) 126 | 127 | if windForce > 0: 128 | rotWindMin *= windDirection 129 | rotWindMax *= windDirection 130 | control.rect_rotation = (rad2deg(abs(rotWindMax - rotWindMin)) * (windForce)) - 0 131 | 132 | if windForce != 0: 133 | windTime = control.rect_rotation 134 | 135 | func _on_area_body_entered(body) -> void: 136 | # if the collided object is in the group 137 | if _checkGroup(body) and interactive: 138 | interact_object = body 139 | # get the direction of the collision 140 | direction = -sign(interact_object.global_position.x - self.global_position.x) 141 | # checks how many physics are being precessed for the leafs, and validates that it is within the limit 142 | if get_parent().grassProcess < maxProcess: 143 | get_parent().grassProcess += 1 144 | set_physics_process(true) 145 | 146 | func _on_area_body_exited(body) -> void: 147 | if _checkGroup(body): 148 | interact_object = null 149 | 150 | yield(get_tree().create_timer(.2), "timeout") 151 | set_physics_process(false) 152 | 153 | if get_parent().grassProcess > 0: 154 | get_parent().grassProcess -= 1 155 | 156 | func _on_timer_wind() -> void: 157 | # moves the leafs according to the wind 158 | var minn = (rad2deg(abs(rotWindMax-rotWindMin)) * (windForce)) - 0 159 | var total = rad2deg(abs(rotWindMax-rotWindMin)) 160 | 161 | if windTime <= total and flag == 'MIN': 162 | windTime += rnd.randf() * windForce 163 | if windTime > total: 164 | flag = 'MAX' 165 | 166 | if windTime >= minn and flag == 'MAX': 167 | windTime -= rnd.randf() * windForce 168 | if windTime < minn: 169 | flag = 'MIN' 170 | 171 | $Control.rect_rotation = lerp($Control.rect_rotation, windTime * windDirection, .1 * windForce) 172 | 173 | # validates the group and if the object has global_position 174 | func _checkGroup(body) -> bool: 175 | for g in groupInteractive: 176 | if body.is_in_group(g) and body.get("global_position") != null: 177 | return true 178 | break 179 | return false 180 | 181 | # setget to change heighGrass 182 | func _setHeightGrass(newHeight) -> void: 183 | heightGrass = newHeight 184 | 185 | if Engine.editor_hint: return 186 | var sprite = $Control/Sprite 187 | if sprite == null: return 188 | if weakref(sprite).get_ref(): 189 | var h = sprite.texture.get_size().y 190 | sprite.offset.y = ((1.0 - heightGrass) * h) 191 | -------------------------------------------------------------------------------- /example/scenes/main.tscn: -------------------------------------------------------------------------------- 1 | [gd_scene load_steps=35 format=2] 2 | 3 | [ext_resource path="res://scripts/main.gd" type="Script" id=1] 4 | [ext_resource path="res://assets/grass_bkg.png" type="Texture" id=2] 5 | [ext_resource path="res://scenes/player.tscn" type="PackedScene" id=3] 6 | [ext_resource path="res://icon.png" type="Texture" id=4] 7 | [ext_resource path="res://assets/font/ui.ttf" type="DynamicFontData" id=5] 8 | [ext_resource path="res://addons/analog_controller/analog.gd" type="Script" id=6] 9 | [ext_resource path="res://addons/analog_controller/big_circle_DIRECTION_2_H.png" type="Texture" id=7] 10 | [ext_resource path="res://addons/analog_controller/small_circle_DIRECTION_4.png" type="Texture" id=8] 11 | [ext_resource path="res://assets/ball.png" type="Texture" id=9] 12 | [ext_resource path="res://addons/TBP_GrassPath2D/TBP_GrassPath2D.gd" type="Script" id=10] 13 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass17.png" type="Texture" id=11] 14 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass18.png" type="Texture" id=12] 15 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass13.png" type="Texture" id=13] 16 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass19.png" type="Texture" id=14] 17 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass16.png" type="Texture" id=15] 18 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass14.png" type="Texture" id=16] 19 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass15.png" type="Texture" id=17] 20 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass2.png" type="Texture" id=18] 21 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass1.png" type="Texture" id=19] 22 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass3.png" type="Texture" id=20] 23 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass4.png" type="Texture" id=21] 24 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass5.png" type="Texture" id=22] 25 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass0.png" type="Texture" id=23] 26 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass10.png" type="Texture" id=24] 27 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass11.png" type="Texture" id=25] 28 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass9.png" type="Texture" id=26] 29 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass12.png" type="Texture" id=27] 30 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass6.png" type="Texture" id=28] 31 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass7.png" type="Texture" id=29] 32 | [ext_resource path="res://addons/TBP_GrassPath2D/assets/grass8.png" type="Texture" id=30] 33 | 34 | [sub_resource type="DynamicFont" id=1] 35 | size = 30 36 | font_data = ExtResource( 5 ) 37 | 38 | [sub_resource type="PhysicsMaterial" id=2] 39 | bounce = 0.5 40 | 41 | [sub_resource type="CircleShape2D" id=3] 42 | radius = 48.6775 43 | 44 | [sub_resource type="Curve2D" id=4] 45 | _data = { 46 | "points": PoolVector2Array( -283.387, -375.039, 283.387, 375.039, -583.527, 552.507, -531.203, 517.107, 531.203, -517.107, 2076.82, 464.628 ) 47 | } 48 | 49 | [node name="main" type="Node2D"] 50 | script = ExtResource( 1 ) 51 | 52 | [node name="grass_bkg" type="Sprite" parent="."] 53 | visible = false 54 | position = Vector2( 621.327, 606.183 ) 55 | scale = Vector2( 0.406832, 0.406832 ) 56 | texture = ExtResource( 2 ) 57 | 58 | [node name="player" parent="." groups=[ 59 | "interact_grass", 60 | ] instance=ExtResource( 3 )] 61 | position = Vector2( 640, 360 ) 62 | 63 | [node name="UI" type="CanvasLayer" parent="."] 64 | 65 | [node name="header" type="ColorRect" parent="UI"] 66 | margin_right = 1280.0 67 | margin_bottom = 200.0 68 | color = Color( 0.282353, 0.52549, 0.223529, 1 ) 69 | __meta__ = { 70 | "_edit_use_anchors_": false 71 | } 72 | 73 | [node name="icon" type="Sprite" parent="UI/header"] 74 | position = Vector2( 640, 100 ) 75 | scale = Vector2( 0.17056, 0.17056 ) 76 | texture = ExtResource( 4 ) 77 | 78 | [node name="fpsLabel" type="Label" parent="UI"] 79 | anchor_right = 1.0 80 | margin_left = 17.0 81 | margin_top = 16.0 82 | margin_right = -957.0 83 | margin_bottom = 188.0 84 | custom_fonts/font = SubResource( 1 ) 85 | text = "FPS: ?" 86 | valign = 1 87 | __meta__ = { 88 | "_edit_use_anchors_": false 89 | } 90 | 91 | [node name="AnalogController" type="Node2D" parent="UI"] 92 | script = ExtResource( 6 ) 93 | isDynamicallyShowing = true 94 | typeAnalogic = 0 95 | bigBallTexture = ExtResource( 7 ) 96 | smallBallTexture = ExtResource( 8 ) 97 | 98 | [node name="ball1" type="RigidBody2D" parent="." groups=[ 99 | "ball", 100 | ]] 101 | position = Vector2( -459.767, 254.029 ) 102 | physics_material_override = SubResource( 2 ) 103 | gravity_scale = 10.0 104 | 105 | [node name="icon" type="Sprite" parent="ball1"] 106 | texture = ExtResource( 9 ) 107 | 108 | [node name="CollisionShape2D" type="CollisionShape2D" parent="ball1"] 109 | shape = SubResource( 3 ) 110 | 111 | [node name="ball2" type="RigidBody2D" parent="." groups=[ 112 | "ball", 113 | ]] 114 | position = Vector2( 1380.02, 307.905 ) 115 | physics_material_override = SubResource( 2 ) 116 | gravity_scale = 10.0 117 | sleeping = true 118 | 119 | [node name="icon" type="Sprite" parent="ball2"] 120 | texture = ExtResource( 9 ) 121 | 122 | [node name="CollisionShape2D" type="CollisionShape2D" parent="ball2"] 123 | shape = SubResource( 3 ) 124 | 125 | [node name="TBP_GrassPath2D" type="Path2D" parent="."] 126 | position = Vector2( 0, -169.528 ) 127 | curve = SubResource( 4 ) 128 | script = ExtResource( 10 ) 129 | colorGrass = [ Color( 0.1, 0.25, 0.02, 1 ), Color( 0.09, 0.18, 0.05, 1 ), Color( 0.12, 0.29, 0.03, 1 ), Color( 0.24, 0.31, 0.08, 1 ), Color( 0.34, 0.46, 0.09, 1 ) ] 130 | blur_samples = 8 131 | blur_strength = 0.0 132 | colorTerrain = Color( 0.07, 0.03, 0, 1 ) 133 | generateTerrain = true 134 | maxHeightTerrain = 500.0 135 | interval = 15.0 136 | interactive = true 137 | maxProcess = 20 138 | interactiveArea = 100.0 139 | followAngle = true 140 | heightGrass = 1.0 141 | randomGrassMin = -0.3 142 | randomGrassMax = 0.3 143 | windForce = 0.3 144 | windDirection = 0.6 145 | grassZIndex = 0.0 146 | grassYOffset = 20.0 147 | maxLeafRotateDegree = 45.0 148 | grassTextures = [ ExtResource( 23 ), ExtResource( 19 ), ExtResource( 18 ), ExtResource( 20 ), ExtResource( 21 ), ExtResource( 22 ), ExtResource( 28 ), ExtResource( 29 ), ExtResource( 30 ), ExtResource( 26 ), ExtResource( 24 ), ExtResource( 25 ), ExtResource( 27 ), ExtResource( 13 ), ExtResource( 16 ), ExtResource( 17 ), ExtResource( 15 ), ExtResource( 11 ), ExtResource( 12 ), ExtResource( 14 ) ] 149 | groupInteractive = [ "interact_grass", "ball" ] 150 | [connection signal="analogChange" from="UI/AnalogController" to="player" method="_on_AnalogController_analogChange"] 151 | [connection signal="analogPressed" from="UI/AnalogController" to="player" method="_on_AnalogController_analogPressed"] 152 | [connection signal="analogRelease" from="UI/AnalogController" to="player" method="_on_AnalogController_analogRelease"] 153 | -------------------------------------------------------------------------------- /addons/TBP_GrassPath2D/TBP_GrassPath2D.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Path2D 3 | 4 | # EXPORTS 5 | export(Array, Color) var colorGrass: Array = [ 6 | Color(.1, .25, .02, 1), 7 | Color(.09, .18, .05, 1), 8 | Color(.12, .29, .03, 1), 9 | Color(.24, .31, .08, 1), 10 | Color(.34, .46, .09, 1), 11 | ] 12 | 13 | export(int) var blur_samples: int = 8 # blur sample 14 | export(float, 0, 1) var blur_strength: float = 0 # blur strenght 15 | export(Color) var colorTerrain: Color = Color(0.07, 0.03, 0, 1) # terrain color 16 | export(bool) var generateTerrain = true # generate static terrain with collision? 17 | export(float) var maxHeightTerrain = 500 # generate static terrain with collision? 18 | 19 | """ 20 | CAUTION 21 | interval: this parameter if far below 15 can make it slow enough if 'interactive' is active. 22 | 23 | For better performance, increase the space between the sheets, 24 | and together you can limit the number of processes in 'maxProcess' 25 | """ 26 | export(float, 2, 500) var interval = 15 # space between leafs 27 | export(bool) var interactive = true # interacts leafs with objects in the "groupInteractive" 28 | export(int, 1, 100) var maxProcess = 20 # maximum physics processes at the same time for that leaf segment 29 | 30 | 31 | export(float, 60, 150) var interactiveArea = 100 # total pixels "width" to interactive area with the object 32 | export(bool) var followAngle = true # should the leafs follow the curve of the terrain? 33 | export(float, 0.0 , 1.0) var heightGrass = 1 setget _setHeightGrass # grass height 34 | export(float, -1, 1) var randomGrassMin = -.3 # minimum range to randomize leaf rotation 35 | export(float, -1, 1) var randomGrassMax = .3 # maximum range to randomize leaf rotation 36 | export(float, 0, 1) var windForce = .3 setget _setWindForce # wind force 37 | export(float, -1, 1) var windDirection = .6 setget _setWindDirection # wind direction (-1: left) -> (1: right) 38 | export(float) var grassZIndex = 0 39 | export(float) var grassYOffset = 20 40 | export(float, 0, 90) var maxLeafRotateDegree = 45.0 41 | export(Array, Texture) var grassTextures: Array = [ 42 | preload("res://addons/TBP_GrassPath2D/assets/grass0.png"), 43 | preload("res://addons/TBP_GrassPath2D/assets/grass1.png"), 44 | preload("res://addons/TBP_GrassPath2D/assets/grass2.png"), 45 | preload("res://addons/TBP_GrassPath2D/assets/grass3.png"), 46 | preload("res://addons/TBP_GrassPath2D/assets/grass4.png"), 47 | preload("res://addons/TBP_GrassPath2D/assets/grass5.png"), 48 | preload("res://addons/TBP_GrassPath2D/assets/grass6.png"), 49 | preload("res://addons/TBP_GrassPath2D/assets/grass7.png"), 50 | preload("res://addons/TBP_GrassPath2D/assets/grass8.png"), 51 | preload("res://addons/TBP_GrassPath2D/assets/grass9.png"), 52 | preload("res://addons/TBP_GrassPath2D/assets/grass10.png"), 53 | preload("res://addons/TBP_GrassPath2D/assets/grass11.png"), 54 | preload("res://addons/TBP_GrassPath2D/assets/grass12.png"), 55 | preload("res://addons/TBP_GrassPath2D/assets/grass13.png"), 56 | preload("res://addons/TBP_GrassPath2D/assets/grass14.png"), 57 | preload("res://addons/TBP_GrassPath2D/assets/grass15.png"), 58 | preload("res://addons/TBP_GrassPath2D/assets/grass16.png"), 59 | preload("res://addons/TBP_GrassPath2D/assets/grass17.png"), 60 | preload("res://addons/TBP_GrassPath2D/assets/grass18.png"), 61 | preload("res://addons/TBP_GrassPath2D/assets/grass19.png"), 62 | ] 63 | 64 | # group to collide 65 | export(Array, String) var groupInteractive: Array = [ 66 | "interact_grass" 67 | ] 68 | 69 | # LOCAL 70 | var grassProcess = 0 71 | var grassLoaded = [] 72 | var rnd = RandomNumberGenerator.new() 73 | 74 | func _setWindDirection(newDirection) -> void: 75 | windDirection = newDirection 76 | 77 | if !Engine.editor_hint: 78 | for g in grassLoaded: 79 | g.windDirection = windDirection 80 | 81 | func _setWindForce(newForce) -> void: 82 | windForce = newForce 83 | 84 | if !Engine.editor_hint: 85 | for g in grassLoaded: 86 | g.windForce = windForce 87 | 88 | func _setHeightGrass(newHeight) -> void: 89 | heightGrass = newHeight 90 | 91 | if !Engine.editor_hint: 92 | for g in grassLoaded: 93 | g.heightGrass = heightGrass 94 | 95 | func _ready() -> void: 96 | if curve.get_baked_points().size() <= 0: 97 | var screenSize = get_viewport_rect().size 98 | curve.add_point(Vector2.ZERO + Vector2(0,screenSize.y - 50)) 99 | curve.add_point(Vector2.ZERO + Vector2(screenSize.x,screenSize.y - 50)) 100 | 101 | if Engine.editor_hint: return 102 | if curve == null: return # if no curve 103 | if curve.get_baked_points().size() <= 0: return # if no curve drawn 104 | 105 | self.curve.bake_interval = interval 106 | _generateGrass() 107 | 108 | if generateTerrain: 109 | _generateTerrain() 110 | 111 | func _generateGrass() -> void: 112 | if Engine.editor_hint: return 113 | if grassTextures.size() <= 0: return # if no textures selected 114 | 115 | # if no color grass selected, append a green color 116 | if colorGrass.size() <= 0: 117 | colorGrass.append(Color(.1, .25, .02, 1)) 118 | 119 | # local randomize 120 | rnd.randomize() 121 | 122 | # load the noise texture to blur shader 123 | var img = Image.new() 124 | img.load("res://addons/TBP_GrassPath2D/noise.png") 125 | 126 | var tx = ImageTexture.new() 127 | tx.create_from_image(img, 0) 128 | 129 | # load the blur shader 130 | var smat = ShaderMaterial.new() 131 | smat.shader = preload("res://addons/TBP_GrassPath2D/blur.shader") 132 | smat.set_shader_param("angle_degrees", maxLeafRotateDegree) 133 | smat.set_shader_param("samples", blur_samples) 134 | smat.set_shader_param("strength", blur_strength) 135 | smat.set_shader_param("noise", tx) 136 | 137 | var idx = 0 138 | var total = curve.get_baked_points().size() 139 | for x in curve.get_baked_points(): 140 | if idx == total: return 141 | 142 | var ang = 0 143 | if followAngle: 144 | if idx < ( total - 1 ): 145 | # obtains the angle between the points of the curve 146 | var current_point = curve.get_baked_points()[idx] 147 | var next_point = curve.get_baked_points()[idx + 1] 148 | ang = current_point.angle_to_point(next_point) 149 | ang += PI 150 | 151 | if windForce > 0: 152 | followAngle = false 153 | idx+=1 154 | 155 | # create the leaf 156 | var grass = load("res://addons/TBP_GrassPath2D/TBP_GrassLeaf.gd").new() 157 | grass.interactive = interactive 158 | grass.groupInteractive = groupInteractive 159 | grass.maxProcess = maxProcess 160 | grass.interactiveArea = interactiveArea 161 | grass.randomGrass = Vector2(randomGrassMin, randomGrassMax) 162 | grass.maxRotate = maxLeafRotateDegree 163 | grass.windForce = windForce 164 | grass.windDirection = windDirection 165 | grass.heightGrass = heightGrass 166 | grass.grassYOffset = grassYOffset 167 | grass.leafMaterial = smat 168 | grass.texture = grassTextures[rnd.randi() % grassTextures.size()] 169 | grass.global_position = x 170 | grass.modulate = colorGrass[rnd.randi() % colorGrass.size()] 171 | grass.followAngle = ang 172 | grass.z_index = grassZIndex 173 | grassLoaded.append(grass) 174 | call_deferred("add_child", grass) 175 | 176 | func _generateTerrain() -> void: 177 | if Engine.editor_hint: return 178 | var arr: PoolVector2Array = [] 179 | var f = null 180 | var l = null 181 | 182 | # get the curve points 183 | if curve and curve.get_baked_points().size() > 0: 184 | for x in curve.get_baked_points(): 185 | if f == null: 186 | f = x 187 | arr.append(x) 188 | else: 189 | arr.append(x) 190 | l = x 191 | 192 | # connect end to start 193 | arr.append(l + Vector2(0, maxHeightTerrain)) 194 | arr.append(f + Vector2(0, maxHeightTerrain)) 195 | 196 | # create the polygon 197 | var poly = Polygon2D.new() 198 | poly.polygon = arr 199 | poly.color = colorTerrain 200 | 201 | # create the collision polygon 202 | var staticCollision = CollisionPolygon2D.new() 203 | staticCollision.polygon = arr 204 | 205 | # create the static body 206 | var staticBody = StaticBody2D.new() 207 | staticBody.call_deferred("add_child", staticCollision) 208 | 209 | call_deferred("add_child", staticBody) 210 | call_deferred("add_child", poly) 211 | 212 | # TODO: preview in editor 213 | #func _draw(): 214 | # if Engine.editor_hint: 215 | # prints(1) 216 | -------------------------------------------------------------------------------- /example/addons/TBP_GrassPath2D/TBP_GrassPath2D.gd: -------------------------------------------------------------------------------- 1 | tool 2 | extends Path2D 3 | 4 | # EXPORTS 5 | export(Array, Color) var colorGrass: Array = [ 6 | Color(.1, .25, .02, 1), 7 | Color(.09, .18, .05, 1), 8 | Color(.12, .29, .03, 1), 9 | Color(.24, .31, .08, 1), 10 | Color(.34, .46, .09, 1), 11 | ] 12 | 13 | export(int) var blur_samples: int = 8 # blur sample 14 | export(float, 0, 1) var blur_strength: float = 0 # blur strenght 15 | export(Color) var colorTerrain: Color = Color(0.07, 0.03, 0, 1) # terrain color 16 | export(bool) var generateTerrain = true # generate static terrain with collision? 17 | export(float) var maxHeightTerrain = 500 # generate static terrain with collision? 18 | 19 | """ 20 | CAUTION 21 | interval: this parameter if far below 15 can make it slow enough if 'interactive' is active. 22 | 23 | For better performance, increase the space between the sheets, 24 | and together you can limit the number of processes in 'maxProcess' 25 | """ 26 | export(float, 2, 500) var interval = 15 # space between leafs 27 | export(bool) var interactive = true # interacts leafs with objects in the "groupInteractive" 28 | export(int, 1, 100) var maxProcess = 20 # maximum physics processes at the same time for that leaf segment 29 | 30 | 31 | export(float, 60, 150) var interactiveArea = 100 # total pixels "width" to interactive area with the object 32 | export(bool) var followAngle = true # should the leafs follow the curve of the terrain? 33 | export(float, 0.0 , 1.0) var heightGrass = 1 setget _setHeightGrass # grass height 34 | export(float, -1, 1) var randomGrassMin = -.3 # minimum range to randomize leaf rotation 35 | export(float, -1, 1) var randomGrassMax = .3 # maximum range to randomize leaf rotation 36 | export(float, 0, 1) var windForce = .3 setget _setWindForce # wind force 37 | export(float, -1, 1) var windDirection = .6 setget _setWindDirection # wind direction (-1: left) -> (1: right) 38 | export(float) var grassZIndex = 0 39 | export(float) var grassYOffset = 20 40 | export(float, 0, 90) var maxLeafRotateDegree = 45.0 41 | export(Array, Texture) var grassTextures: Array = [ 42 | preload("res://addons/TBP_GrassPath2D/assets/grass0.png"), 43 | preload("res://addons/TBP_GrassPath2D/assets/grass1.png"), 44 | preload("res://addons/TBP_GrassPath2D/assets/grass2.png"), 45 | preload("res://addons/TBP_GrassPath2D/assets/grass3.png"), 46 | preload("res://addons/TBP_GrassPath2D/assets/grass4.png"), 47 | preload("res://addons/TBP_GrassPath2D/assets/grass5.png"), 48 | preload("res://addons/TBP_GrassPath2D/assets/grass6.png"), 49 | preload("res://addons/TBP_GrassPath2D/assets/grass7.png"), 50 | preload("res://addons/TBP_GrassPath2D/assets/grass8.png"), 51 | preload("res://addons/TBP_GrassPath2D/assets/grass9.png"), 52 | preload("res://addons/TBP_GrassPath2D/assets/grass10.png"), 53 | preload("res://addons/TBP_GrassPath2D/assets/grass11.png"), 54 | preload("res://addons/TBP_GrassPath2D/assets/grass12.png"), 55 | preload("res://addons/TBP_GrassPath2D/assets/grass13.png"), 56 | preload("res://addons/TBP_GrassPath2D/assets/grass14.png"), 57 | preload("res://addons/TBP_GrassPath2D/assets/grass15.png"), 58 | preload("res://addons/TBP_GrassPath2D/assets/grass16.png"), 59 | preload("res://addons/TBP_GrassPath2D/assets/grass17.png"), 60 | preload("res://addons/TBP_GrassPath2D/assets/grass18.png"), 61 | preload("res://addons/TBP_GrassPath2D/assets/grass19.png"), 62 | ] 63 | 64 | # group to collide 65 | export(Array, String) var groupInteractive: Array = [ 66 | "interact_grass" 67 | ] 68 | 69 | # LOCAL 70 | var grassProcess = 0 71 | var grassLoaded = [] 72 | var rnd = RandomNumberGenerator.new() 73 | 74 | func _setWindDirection(newDirection) -> void: 75 | windDirection = newDirection 76 | 77 | if !Engine.editor_hint: 78 | for g in grassLoaded: 79 | g.windDirection = windDirection 80 | 81 | func _setWindForce(newForce) -> void: 82 | windForce = newForce 83 | 84 | if !Engine.editor_hint: 85 | for g in grassLoaded: 86 | g.windForce = windForce 87 | 88 | func _setHeightGrass(newHeight) -> void: 89 | heightGrass = newHeight 90 | 91 | if !Engine.editor_hint: 92 | for g in grassLoaded: 93 | g.heightGrass = heightGrass 94 | 95 | func _ready() -> void: 96 | if curve.get_baked_points().size() <= 0: 97 | var screenSize = get_viewport_rect().size 98 | curve.add_point(Vector2.ZERO + Vector2(0,screenSize.y - 50)) 99 | curve.add_point(Vector2.ZERO + Vector2(screenSize.x,screenSize.y - 50)) 100 | 101 | if Engine.editor_hint: return 102 | if curve == null: return # if no curve 103 | if curve.get_baked_points().size() <= 0: return # if no curve drawn 104 | 105 | self.curve.bake_interval = interval 106 | _generateGrass() 107 | 108 | if generateTerrain: 109 | _generateTerrain() 110 | 111 | func _generateGrass() -> void: 112 | if Engine.editor_hint: return 113 | if grassTextures.size() <= 0: return # if no textures selected 114 | 115 | # if no color grass selected, append a green color 116 | if colorGrass.size() <= 0: 117 | colorGrass.append(Color(.1, .25, .02, 1)) 118 | 119 | # local randomize 120 | rnd.randomize() 121 | 122 | # load the noise texture to blur shader 123 | var img = Image.new() 124 | img.load("res://addons/TBP_GrassPath2D/noise.png") 125 | 126 | var tx = ImageTexture.new() 127 | tx.create_from_image(img, 0) 128 | 129 | # load the blur shader 130 | var smat = ShaderMaterial.new() 131 | smat.shader = preload("res://addons/TBP_GrassPath2D/blur.shader") 132 | smat.set_shader_param("angle_degrees", maxLeafRotateDegree) 133 | smat.set_shader_param("samples", blur_samples) 134 | smat.set_shader_param("strength", blur_strength) 135 | smat.set_shader_param("noise", tx) 136 | 137 | var idx = 0 138 | var total = curve.get_baked_points().size() 139 | for x in curve.get_baked_points(): 140 | if idx == total: return 141 | 142 | var ang = 0 143 | if followAngle: 144 | if idx < ( total - 1 ): 145 | # obtains the angle between the points of the curve 146 | var current_point = curve.get_baked_points()[idx] 147 | var next_point = curve.get_baked_points()[idx + 1] 148 | ang = current_point.angle_to_point(next_point) 149 | ang += PI 150 | 151 | if windForce > 0: 152 | followAngle = false 153 | idx+=1 154 | 155 | # create the leaf 156 | var grass = load("res://addons/TBP_GrassPath2D/TBP_GrassLeaf.gd").new() 157 | grass.interactive = interactive 158 | grass.groupInteractive = groupInteractive 159 | grass.maxProcess = maxProcess 160 | grass.interactiveArea = interactiveArea 161 | grass.randomGrass = Vector2(randomGrassMin, randomGrassMax) 162 | grass.maxRotate = maxLeafRotateDegree 163 | grass.windForce = windForce 164 | grass.windDirection = windDirection 165 | grass.heightGrass = heightGrass 166 | grass.grassYOffset = grassYOffset 167 | grass.leafMaterial = smat 168 | grass.texture = grassTextures[rnd.randi() % grassTextures.size()] 169 | grass.global_position = x 170 | grass.modulate = colorGrass[rnd.randi() % colorGrass.size()] 171 | grass.followAngle = ang 172 | grass.z_index = grassZIndex 173 | grassLoaded.append(grass) 174 | call_deferred("add_child", grass) 175 | 176 | func _generateTerrain() -> void: 177 | if Engine.editor_hint: return 178 | var arr: PoolVector2Array = [] 179 | var f = null 180 | var l = null 181 | 182 | # get the curve points 183 | if curve and curve.get_baked_points().size() > 0: 184 | for x in curve.get_baked_points(): 185 | if f == null: 186 | f = x 187 | arr.append(x) 188 | else: 189 | arr.append(x) 190 | l = x 191 | 192 | # connect end to start 193 | arr.append(l + Vector2(0, maxHeightTerrain)) 194 | arr.append(f + Vector2(0, maxHeightTerrain)) 195 | 196 | # create the polygon 197 | var poly = Polygon2D.new() 198 | poly.polygon = arr 199 | poly.color = colorTerrain 200 | 201 | # create the collision polygon 202 | var staticCollision = CollisionPolygon2D.new() 203 | staticCollision.polygon = arr 204 | 205 | # create the static body 206 | var staticBody = StaticBody2D.new() 207 | staticBody.call_deferred("add_child", staticCollision) 208 | 209 | call_deferred("add_child", staticBody) 210 | call_deferred("add_child", poly) 211 | 212 | # TODO: preview in editor 213 | #func _draw(): 214 | # if Engine.editor_hint: 215 | # prints(1) 216 | -------------------------------------------------------------------------------- /example/addons/analog_controller/analog.gd: -------------------------------------------------------------------------------- 1 | extends Node2D 2 | 3 | enum typesAnalog { DIRECTION_2_H, DIRECTION_2_V, DIRECTION_4, DIRECTION_8, DIRECTION_360 } 4 | 5 | onready var ball = Sprite.new() 6 | onready var ballAnalogicoBall = Sprite.new() 7 | onready var bg = Sprite.new() 8 | onready var bgAnalogicoBase = Sprite.new() 9 | 10 | const INACTIVE = -1 11 | 12 | var initialized = false 13 | var initial_position = Vector2.ZERO 14 | var local_paused = false 15 | var isDragging = false 16 | var directions = ["right", "down_right", "down", "down_left", "left", "up_left", "up", "up_right"] 17 | var parent 18 | var listenerNode 19 | var released = false 20 | var currentForce2:float = 0.0 21 | var centerPoint = Vector2(0,0) 22 | var currentForce = Vector2(0,0) 23 | var halfSize = Vector2() 24 | var ballPos = Vector2() 25 | var squaredHalfSizeLenght = 0 26 | var currentPointerIDX = INACTIVE 27 | 28 | export(bool) var isDynamicallyShowing = false 29 | export(typesAnalog) var typeAnalogic = typesAnalog.DIRECTION_8 30 | export(float,0.00,1.0) var smoothClick = 0.02 31 | export(float,0.00,1.0) var smoothRelease = 0.02 32 | export(Vector2) var scaleBall = Vector2(1,1) 33 | export(Texture) var bigBallTexture = ResourceLoader.load("res://addons/analog_controller/big_circle_DIRECTION_8.png") 34 | export(Texture) var smallBallTexture = ResourceLoader.load("res://addons/analog_controller/small_circle_DIRECTION_8.png") 35 | export(Dictionary) var directionsResult = { 36 | "right":"right", 37 | "down_right":"down_right", 38 | "down":"down", 39 | "down_left":"down_left", 40 | "left":"left", 41 | "up_left":"up_left", 42 | "up":"up", 43 | "up_right":"up_right" 44 | } 45 | 46 | signal analogChange(force, pos) 47 | signal analogPressed 48 | signal analogRelease 49 | 50 | func _ready() -> void: 51 | initial_position = global_position 52 | _configAnalog() 53 | initialized = true 54 | scale = Vector2(1,1) 55 | 56 | func _configAnalog(): 57 | set_process_input(true) 58 | 59 | if !initialized: 60 | add_child(bg) 61 | bg.add_child(bgAnalogicoBase) 62 | bg.scale = scaleBall 63 | bg.texture = bigBallTexture 64 | 65 | add_child(ball) 66 | ball.add_child(ballAnalogicoBall) 67 | ball.scale = scaleBall 68 | ball.texture = smallBallTexture 69 | 70 | parent = get_parent(); 71 | 72 | halfSize = bg.texture.get_size()/2; 73 | squaredHalfSizeLenght = halfSize.x*halfSize.y; 74 | 75 | if isDynamicallyShowing: 76 | modulate.a = 0 77 | else: 78 | yield(get_tree().create_timer(.2), "timeout") 79 | position = initial_position 80 | modulate.a = 1 81 | show() 82 | 83 | func _convertType(pos): 84 | if local_paused:return 85 | var angle = Vector2(pos.x, -pos.y).angle() + .5 86 | if angle < 0: 87 | angle += 2 * PI 88 | var index = round(angle / PI * 4) 89 | var animation = directions[index-1] 90 | return animation 91 | 92 | func get_force(): 93 | if local_paused:return 94 | return currentForce 95 | 96 | func _input(event): 97 | if local_paused:return 98 | 99 | var incomingPointer = extractPointerIdx(event) 100 | if incomingPointer == INACTIVE: 101 | return 102 | 103 | if need2ChangeActivePointer(event): 104 | if !isDragging: return 105 | if (currentPointerIDX != incomingPointer) and event.is_pressed(): 106 | currentPointerIDX = incomingPointer; 107 | if event is InputEventMouseMotion or event is InputEventMouseButton: 108 | showAtPos(event.position) 109 | 110 | var theSamePointer = currentPointerIDX == incomingPointer 111 | if isActive() and theSamePointer: 112 | process_input(event) 113 | 114 | func need2ChangeActivePointer(event): 115 | if local_paused:return 116 | var mouseButton = event is InputEventMouseButton 117 | var touch = event is InputEventScreenTouch 118 | 119 | if event is InputEventMouseMotion or event is InputEventMouseButton: 120 | var mouse_event_pos = event.position 121 | if mouseButton or touch: 122 | isDragging = true 123 | if isDynamicallyShowing: 124 | return mouse_event_pos 125 | else: 126 | var lenght = (get_global_position() - Vector2(mouse_event_pos.x, mouse_event_pos.y)).length_squared(); 127 | return lenght < squaredHalfSizeLenght 128 | else: 129 | return false 130 | else: 131 | return false 132 | 133 | func isActive(): 134 | if local_paused:return 135 | return currentPointerIDX != INACTIVE 136 | 137 | func extractPointerIdx(event): 138 | if local_paused:return 139 | var touch = event is InputEventScreenTouch 140 | var drag = event is InputEventScreenDrag 141 | var mouseButton = event is InputEventMouseButton 142 | var mouseMove = event is InputEventMouseMotion 143 | 144 | if touch or drag: 145 | return event.index 146 | elif mouseButton or mouseMove: 147 | return 0 148 | else: 149 | return INACTIVE 150 | 151 | func process_input(event): 152 | if local_paused:return 153 | var mouseButton = event is InputEventMouseButton 154 | var mouseMove = event is InputEventMouseMotion 155 | 156 | if mouseMove or mouseButton: 157 | calculateForce(event.position.x - self.get_global_position().x, event.position.y - self.get_global_position().y) 158 | updateBallPos() 159 | 160 | var isReleased = isReleased(event) 161 | if isReleased: 162 | reset() 163 | else: 164 | emit_signal("analogPressed") 165 | 166 | var _force = 0 167 | var _pos = Vector2.ZERO 168 | if typeAnalogic == typesAnalog.DIRECTION_360: 169 | _force = currentForce2 170 | _pos = currentForce.normalized() * Vector2(1, -1) 171 | 172 | emit_signal("analogChange", _force, _pos) 173 | return 174 | 175 | elif typeAnalogic == typesAnalog.DIRECTION_2_H: 176 | 177 | _force = currentForce2 178 | var converted = _convertType(currentForce) 179 | _pos = directionsResult[converted] 180 | 181 | match _pos: 182 | "right": _force = Vector2(1, 0) * _force 183 | "left": _force = Vector2(-1, 0) * _force 184 | 185 | _: _force = Vector2.ZERO 186 | 187 | if _force is Vector2: 188 | _force = _force.normalized() 189 | 190 | emit_signal("analogChange", _force * currentForce2, _pos) 191 | 192 | elif typeAnalogic == typesAnalog.DIRECTION_2_V: 193 | 194 | _force = currentForce2 195 | var converted = _convertType(currentForce) 196 | _pos = directionsResult[converted] 197 | 198 | match _pos: 199 | "up": _force = Vector2(0, -1) * _force 200 | "down": _force = Vector2(0, 1) * _force 201 | _: _force = Vector2.ZERO 202 | 203 | if _force is Vector2: 204 | _force = _force.normalized() 205 | 206 | emit_signal("analogChange", _force * currentForce2, _pos) 207 | 208 | 209 | elif typeAnalogic == typesAnalog.DIRECTION_4: 210 | 211 | _force = currentForce2 212 | var converted = _convertType(currentForce) 213 | _pos = directionsResult[converted] 214 | 215 | match _pos: 216 | "right": _force = Vector2(1, 0) * _force 217 | "left": _force = Vector2(-1, 0) * _force 218 | "up": _force = Vector2(0, -1) * _force 219 | "down": _force = Vector2(0, 1) * _force 220 | _: _force = Vector2.ZERO 221 | 222 | if _force is Vector2: 223 | _force = _force.normalized() 224 | 225 | emit_signal("analogChange", _force * currentForce2, _pos) 226 | 227 | 228 | elif typeAnalogic == typesAnalog.DIRECTION_8: 229 | 230 | _force = currentForce2 231 | var converted = _convertType(currentForce) 232 | _pos = directionsResult[converted] 233 | 234 | match _pos: 235 | "right": _force = Vector2(1, 0) * _force 236 | "down_right": _force = Vector2(1, 1) * _force 237 | "up_right": _force = Vector2(1, -1) * _force 238 | "left": _force = Vector2(-1, 0) * _force 239 | "down_left": _force = Vector2(-1, 1) * _force 240 | "up_left": _force = Vector2(-1, -1) * _force 241 | "up": _force = Vector2(0, -1) * _force 242 | "down": _force = Vector2(0, 1) * _force 243 | _: _force = Vector2.ZERO 244 | 245 | if _force is Vector2: 246 | _force = _force.normalized() 247 | 248 | emit_signal("analogChange", _force * currentForce2, _pos) 249 | 250 | func reset() -> void: 251 | emit_signal("analogRelease") 252 | currentPointerIDX = INACTIVE 253 | calculateForce(0, 0) 254 | 255 | if isDynamicallyShowing: 256 | hide() 257 | else: 258 | updateBallPos() 259 | 260 | func showAtPos(pos) -> void: 261 | if local_paused: return 262 | if !isDynamicallyShowing: return 263 | 264 | self.set_global_position(pos) 265 | while self.modulate.a < 1.0 and isActive(): 266 | yield(get_tree().create_timer(smoothClick), "timeout") 267 | self.modulate.a += .1 268 | 269 | if !isActive(): 270 | self.modulate.a = 0 271 | 272 | func hide() -> void: 273 | while self.modulate.a > 0.0 and !isActive(): 274 | yield(get_tree().create_timer(smoothRelease), "timeout") 275 | self.modulate.a -= .1 276 | 277 | emit_signal("analogRelease") 278 | 279 | func updateBallPos() -> void: 280 | if local_paused:return 281 | 282 | if typeAnalogic != typesAnalog.DIRECTION_2_V: 283 | ballPos.x = halfSize.x * currentForce.x 284 | 285 | if typeAnalogic != typesAnalog.DIRECTION_2_H: 286 | ballPos.y = halfSize.y * -currentForce.y 287 | 288 | ballPos *= scaleBall 289 | ball.set_position(ballPos) 290 | 291 | var bigBallSize = (bg.texture.get_size().x / 2) * scaleBall.x 292 | currentForce2 = (centerPoint.distance_to(ballPos) * 100.0 / bigBallSize) / 100.0 293 | currentForce2 = stepify(currentForce2, .001) 294 | currentForce2 = clamp(currentForce2, -1.0, 1.0) 295 | 296 | 297 | func calculateForce(var x, var y) -> void: 298 | if local_paused:return 299 | if typeAnalogic != typesAnalog.DIRECTION_2_V: 300 | currentForce.x = (x - centerPoint.x)/halfSize.x 301 | 302 | if typeAnalogic != typesAnalog.DIRECTION_2_H: 303 | currentForce.y = -(y - centerPoint.y)/halfSize.y 304 | 305 | if currentForce.length_squared()>1: 306 | currentForce=currentForce/currentForce.length() 307 | 308 | func isPressed(event): 309 | if local_paused:return 310 | if event is InputEventMouseMotion: 311 | return (event.button_mask==1) 312 | elif event is InputEventScreenTouch: 313 | isDragging = true 314 | return event.pressed 315 | 316 | func isReleased(event): 317 | if event is InputEventScreenTouch: 318 | return !event.pressed 319 | elif event is InputEventMouseButton: 320 | return !event.pressed 321 | 322 | func pause() -> void: 323 | local_paused = true 324 | hide() 325 | 326 | func unpause() -> void: 327 | local_paused = false 328 | --------------------------------------------------------------------------------