From fa013e2360ae77826d0f3a1e56e8462a8efd7731 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 19 Feb 2020 16:45:26 +0100 Subject: [PATCH] Experiments with the icon creation tool. --- game/data/icons/ parts/circles.svg | 81 ++++++++++++++ game/data/icons/ parts/circles.svg.import | 34 ++++++ .../icons/Naturalist/AspectOfScorpions.png | Bin 0 -> 349 bytes .../Naturalist/AspectOfScorpions.png.import | 34 ++++++ .../icons/Naturalist/AspectOfScorpions.tscn | 103 ++++++++++++++++++ .../spells/12_aspect_of_wolves_rank_1.tres | 2 +- game/texture_tools/LayeredTextureMaker.gd | 8 +- 7 files changed, 258 insertions(+), 4 deletions(-) create mode 100644 game/data/icons/ parts/circles.svg create mode 100644 game/data/icons/ parts/circles.svg.import create mode 100644 game/data/icons/Naturalist/AspectOfScorpions.png create mode 100644 game/data/icons/Naturalist/AspectOfScorpions.png.import create mode 100644 game/data/icons/Naturalist/AspectOfScorpions.tscn diff --git a/game/data/icons/ parts/circles.svg b/game/data/icons/ parts/circles.svg new file mode 100644 index 00000000..9dc3f8ac --- /dev/null +++ b/game/data/icons/ parts/circles.svg @@ -0,0 +1,81 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/game/data/icons/ parts/circles.svg.import b/game/data/icons/ parts/circles.svg.import new file mode 100644 index 00000000..d70a215f --- /dev/null +++ b/game/data/icons/ parts/circles.svg.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/circles.svg-a608c87b0b2cc8a88ef0f4bda018782e.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://data/icons/ parts/circles.svg" +dest_files=[ "res://.import/circles.svg-a608c87b0b2cc8a88ef0f4bda018782e.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=1 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/game/data/icons/Naturalist/AspectOfScorpions.png b/game/data/icons/Naturalist/AspectOfScorpions.png new file mode 100644 index 0000000000000000000000000000000000000000..de41ad0dea8c217f89d3b30853c140b1427dce50 GIT binary patch literal 349 zcmV-j0iyniP)Px$7fD1xR49?9P_a$|K@^;2H*kk?*N~W)fZbk*1$X?9jV2Zpwi==pm5r^5Bz}ee z!6j4>TFoUI6KLE6jE^Bs}P^_`E#qKbdhDc9x>gJ@|tt4RExy}O3(X!b7}s<4d<2{z{hO%vrHa1 zb{qgwN{=zcf5W=N5&&?>n9c(Lv9FQ`-qZB7;&q2Zb5?iV_Ucd?>jjU^W|F4&qmgP- vcioH4x^@7-T@W0VN&v0~gQb*zG}!~+foe@1RJPs#00000NkvXXu0mjfKuneR literal 0 HcmV?d00001 diff --git a/game/data/icons/Naturalist/AspectOfScorpions.png.import b/game/data/icons/Naturalist/AspectOfScorpions.png.import new file mode 100644 index 00000000..09d3fb24 --- /dev/null +++ b/game/data/icons/Naturalist/AspectOfScorpions.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/AspectOfScorpions.png-adf67f2bd67362e6adc1d97dee5a7344.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://data/icons/Naturalist/AspectOfScorpions.png" +dest_files=[ "res://.import/AspectOfScorpions.png-adf67f2bd67362e6adc1d97dee5a7344.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=2 +flags/repeat=0 +flags/filter=false +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=false +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=false +svg/scale=1.0 diff --git a/game/data/icons/Naturalist/AspectOfScorpions.tscn b/game/data/icons/Naturalist/AspectOfScorpions.tscn new file mode 100644 index 00000000..96c8af3f --- /dev/null +++ b/game/data/icons/Naturalist/AspectOfScorpions.tscn @@ -0,0 +1,103 @@ +[gd_scene load_steps=6 format=2] + +[ext_resource path="res://texture_tools/LayeredTextureMaker.gd" type="Script" id=1] +[ext_resource path="res://data/icons/Naturalist/AspectOfScorpions.png" type="Texture" id=2] +[ext_resource path="res://data/icons/ parts/circles.svg" type="Texture" id=3] +[ext_resource path="res://data/icons/icons.png" type="Texture" id=4] + +[sub_resource type="Gradient" id=1] +offsets = PoolRealArray( 0, 0.166667, 1 ) +colors = PoolColorArray( 0, 0, 0, 1, 0.871094, 0.871094, 0.871094, 1, 1, 1, 1, 1 ) + +[node name="LayeredTextureMaker" type="Node2D"] +script = ExtResource( 1 ) +__meta__ = { +"_edit_lock_": true +} +texture = ExtResource( 2 ) + +[node name="Sprite" type="Sprite" parent="."] +modulate = Color( 0, 0, 0, 1 ) +self_modulate = Color( 0, 0, 0, 1 ) +position = Vector2( 22.1815, 14.0857 ) +scale = Vector2( 0.85584, 0.746345 ) +texture = ExtResource( 4 ) + +[node name="circles" type="Sprite" parent="."] +visible = false +modulate = Color( 0.427451, 0.0588235, 0.0588235, 1 ) +self_modulate = Color( 0.772549, 0.458824, 0.458824, 1 ) +position = Vector2( 5.77751, 5.69682 ) +scale = Vector2( 0.0683068, 0.0707925 ) +texture = ExtResource( 3 ) + +[node name="CPUParticles2D" type="CPUParticles2D" parent="."] +modulate = Color( 0.662745, 0.207843, 0.207843, 1 ) +position = Vector2( 6.35167, 10.2869 ) +scale = Vector2( 0.05, 0.05 ) +amount = 24 +texture = ExtResource( 3 ) +direction = Vector2( 0.5, 0.5 ) +spread = 108.36 +gravity = Vector2( 0, 0 ) +initial_velocity = 40.0 +linear_accel = 3.2 +linear_accel_random = 0.21 +color_ramp = SubResource( 1 ) +hue_variation_random = 0.02 + +[node name="CPUParticles2D2" type="CPUParticles2D" parent="."] +modulate = Color( 0.662745, 0.207843, 0.207843, 1 ) +position = Vector2( 4.59298, 2.6762 ) +scale = Vector2( 0.02, 0.02 ) +amount = 20 +lifetime = 0.74 +explosiveness = 0.14 +randomness = 0.59 +lifetime_randomness = 0.38 +texture = ExtResource( 3 ) +direction = Vector2( 0.5, 0.5 ) +spread = 108.36 +gravity = Vector2( 0, 0 ) +initial_velocity = 40.0 +linear_accel = 3.2 +linear_accel_random = 0.21 +color_ramp = SubResource( 1 ) + +[node name="CPUParticles2D3" type="CPUParticles2D" parent="."] +modulate = Color( 0.662745, 0.207843, 0.207843, 1 ) +position = Vector2( 10.675, 2.7188 ) +scale = Vector2( 0.02, 0.02 ) +amount = 20 +lifetime = 0.74 +preprocess = 14.4 +explosiveness = 0.14 +randomness = 0.59 +lifetime_randomness = 0.38 +texture = ExtResource( 3 ) +direction = Vector2( 0.5, 0.5 ) +spread = 108.36 +gravity = Vector2( 0, 0 ) +initial_velocity = 40.0 +linear_accel = 3.2 +linear_accel_random = 0.21 +color_ramp = SubResource( 1 ) + +[node name="CPUParticles2D4" type="CPUParticles2D" parent="."] +modulate = Color( 0.662745, 0.207843, 0.207843, 1 ) +position = Vector2( 13.4834, 6.60399 ) +scale = Vector2( 0.02, 0.02 ) +amount = 20 +lifetime = 0.74 +preprocess = 9.6 +explosiveness = 0.14 +randomness = 0.59 +lifetime_randomness = 0.38 +texture = ExtResource( 3 ) +direction = Vector2( 0.5, 0.5 ) +spread = 108.36 +gravity = Vector2( 0, 0 ) +initial_velocity = 40.0 +linear_accel = 3.2 +linear_accel_random = 0.21 +color_ramp = SubResource( 1 ) diff --git a/game/data/spells/12_aspect_of_wolves_rank_1.tres b/game/data/spells/12_aspect_of_wolves_rank_1.tres index f5fb9867..2494375b 100644 --- a/game/data/spells/12_aspect_of_wolves_rank_1.tres +++ b/game/data/spells/12_aspect_of_wolves_rank_1.tres @@ -1,7 +1,7 @@ [gd_resource type="Spell" load_steps=4 format=2] [ext_resource path="res://scripts/spells/gd_spell_script.gd" type="Script" id=1] -[ext_resource path="res://data/icons/naturalist/aspect_of_wolves.tres" type="Texture" id=2] +[ext_resource path="res://data/icons/Naturalist/AspectOfScorpions.png" type="Texture" id=2] [ext_resource path="res://data/auras/12_aspect_of_wolves_rank_1.tres" type="Aura" id=3] [resource] diff --git a/game/texture_tools/LayeredTextureMaker.gd b/game/texture_tools/LayeredTextureMaker.gd index 9cf916fd..64889a56 100644 --- a/game/texture_tools/LayeredTextureMaker.gd +++ b/game/texture_tools/LayeredTextureMaker.gd @@ -79,17 +79,19 @@ func _process(delta): if get_children().has(preview_node) and get_child(get_child_count() - 1) != preview_node: move_child(preview_node, get_child_count() - 1) - queued_save = true + #queued_save = true func save() -> void: - queued_save = false + #queued_save = false if texture == null: #print("LayeredTextureMaker: Set a target texture!") return - texture.set_data(viewport.get_texture().get_data()) + #texture.set_data(viewport.get_texture().get_data()) + viewport.get_texture().get_data().save_png(texture.resource_path) +# texture.property_list_changed_notify() func preview_refresh() -> void: for ch in viewport.get_children():