Add sources

This commit is contained in:
Alice Gaudon 2020-08-16 08:50:04 +02:00
commit 1c4873e103
88 changed files with 5487 additions and 0 deletions

15
.gitignore vendored Normal file
View File

@ -0,0 +1,15 @@
.idea/
### Godot ###
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# Imported translations (automatically generated from CSV files)
*.translation
# Mono-specific ignores
.mono/
data_*/

View File

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2020 Hector Margittay
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -0,0 +1,174 @@
tool
extends Node
class_name AsepriteImportData
enum Error{
OK,
ERR_JSON_PARSE_ERROR,
ERR_INVALID_JSON_DATA,
}
const FRAME_TEMPLATE = {
frame = {
x = TYPE_INT,
y = TYPE_INT,
w = TYPE_INT,
h = TYPE_INT,
},
spriteSourceSize = {
x = TYPE_INT,
y = TYPE_INT,
w = TYPE_INT,
h = TYPE_INT,
},
sourceSize = {
w = TYPE_INT,
h = TYPE_INT,
},
duration = TYPE_INT,
}
const META_TEMPLATE = {
frameTags = [
{
name = TYPE_STRING,
from = TYPE_INT,
to = TYPE_INT,
direction = TYPE_STRING
},
],
size = {
w = TYPE_INT,
h = TYPE_INT,
},
}
var json_filepath : String
var json_data : Dictionary
func load(filepath : String) -> int:
var file := File.new()
var error := file.open(filepath, File.READ)
if error != OK:
return error
var file_text = file.get_as_text()
file.close()
var json := JSON.parse(file_text)
if json.error != OK:
return Error.ERR_JSON_PARSE_ERROR
if not _validate_json(json):
return Error.ERR_INVALID_JSON_DATA
json_filepath = filepath
json_data = json.result
return OK
func get_frame_array() -> Array:
if not json_data:
return []
var frame_data = json_data.frames
if frame_data is Dictionary:
return frame_data.values()
return frame_data
func get_image_filename() -> String:
if not (json_data and json_data.meta.has("image")):
return ""
return json_data.meta.image
func get_image_size() -> Vector2:
if not json_data:
return Vector2.ZERO
var image_size : Dictionary = json_data.meta.size
return Vector2(
image_size.w,
image_size.h
)
func get_tag(tag_idx : int) -> Dictionary:
var tags := get_tags()
if tag_idx >= 0 and tag_idx < tags.size():
return tags[tag_idx]
return {}
func get_tags() -> Array:
if not json_data:
return []
return json_data.meta.frameTags
static func _validate_json(json : JSONParseResult) -> bool:
var data : Dictionary = json.result
if not (data is Dictionary and data.has_all(["frames", "meta"])):
return false
# "frames" validation
var frames = data.frames
var is_hash := frames is Dictionary
for frame in frames:
if is_hash:
frame = frames[frame]
if not _match_template(frame, FRAME_TEMPLATE):
return false
# "meta" validation
return _match_template(data.meta, META_TEMPLATE)
"""
This helper function recursively walks an Array or a Dictionary checking if each
children's type matches the template
"""
static func _match_template(data, template) -> bool:
match typeof(template):
TYPE_INT:
# When parsed, the JSON interprets integer values as floats
if template == TYPE_INT and typeof(data) == TYPE_REAL:
return true
return typeof(data) == template
TYPE_DICTIONARY:
if typeof(data) != TYPE_DICTIONARY:
return false
if not data.has_all(template.keys()):
return false
for key in template:
if not _match_template(data[key], template[key]):
return false
TYPE_ARRAY:
if typeof(data) != TYPE_ARRAY:
return false
if data.empty():
return false
for element in data:
if not _match_template(element, template[0]):
return false
return true

View File

@ -0,0 +1,153 @@
tool
extends Node
class_name AsepriteImporter
enum Error{
OK,
INVALID_JSON_DATA,
MISSING_JSON_DATA,
MISSING_ANIMATION_PLAYER,
MISSING_SPRITE,
NO_TAGS_SELECTED,
DUPLICATE_TAG_NAME,
MISSING_TEXTURE,
}
static func generate_animations(import_data : AsepriteImportData, selected_tags : Array,
animation_player : AnimationPlayer, sprite : Node, texture : Texture) -> int:
if not(import_data and import_data.json_data):
return Error.MISSING_JSON_DATA
var frame_tags : Array = import_data.get_tags()
if not selected_tags:
return Error.NO_TAGS_SELECTED
else:
var tag_names := []
for tag_idx in selected_tags:
var tag_name : String = frame_tags[tag_idx].name
if tag_names.has(tag_name):
return Error.DUPLICATE_TAG_NAME
else:
tag_names.append(tag_name)
if not animation_player:
return Error.MISSING_ANIMATION_PLAYER
if not(sprite is Sprite or sprite is Sprite3D):
return Error.MISSING_SPRITE
if texture == null:
return Error.MISSING_TEXTURE
var animation_root_path := animation_player.root_node
var animation_root_node := animation_player.get_node(animation_root_path)
var sprite_relative_path := str(animation_root_node.get_path_to(sprite))
# These are tracks that will be used
var tracks := {
"region" : {
path = (sprite_relative_path + ":region_rect"),
},
"offset" : {
path = (sprite_relative_path + ":offset")
}
}
var frames := import_data.get_frame_array()
var is_sprite3d := sprite is Sprite3D
# Iterate over each tag (animation)
for tag_idx in selected_tags:
var tag : Dictionary = frame_tags[tag_idx]
var animation : Animation
# Check if the animation already exists
if animation_player.has_animation(tag.name):
animation = animation_player.get_animation(tag.name)
else:
# If it doesn't, adds a new one
animation = Animation.new()
# warning-ignore:return_value_discarded
animation_player.add_animation(tag.name, animation)
# Setup the animation tracks
for track_name in tracks:
var track : Dictionary = tracks[track_name]
track.idx = animation.find_track(track.path)
# Checks if the track doesn't exist
if track.idx == -1:
# Create a new_track
track.idx = animation.add_track(Animation.TYPE_VALUE)
animation.track_set_path(track.idx, track.path)
else:
# Remove all existing keys from the track
for key_idx in range(animation.track_get_key_count(track.idx)):
animation.track_remove_key(track.idx, 0)
# Set the track Interpolation Mode to Nearest
animation.track_set_interpolation_type(track.idx, Animation.INTERPOLATION_NEAREST)
#Enable the track
animation.track_set_enabled(track.idx, true)
var time := 0.0
var frame_idxs := range(tag.from, tag.to + 1)
# Modify the frame order based on the tag's direction
match tag.direction:
"reverse":
frame_idxs.invert()
"pingpong":
var pong_frame_idxs := range(tag.from + 1, tag.to)
pong_frame_idxs.invert()
frame_idxs += pong_frame_idxs
# Insert the new keys
for i in frame_idxs:
var frame : Dictionary = frames[i]
# Get the region of the spritesheet that has the frame
var rect = frame.frame
var region = Rect2(rect.x, rect.y, rect.w, rect.h)
# Insert the new key for the region track
animation.track_insert_key(tracks.region.idx, time, region)
# Get the center of the frame in the original size
var source_size : Dictionary = frame.sourceSize
var source_center_x : float = source_size.w / 2
var source_center_y : float = source_size.h / 2
# Get the center of the trimmed frame in the spritesheet
var trim_rect : Dictionary = frame.spriteSourceSize
var trim_rect_center_x : float = trim_rect.x + (trim_rect.w / 2)
var trim_rect_center_y : float = trim_rect.y + (trim_rect.h / 2)
# Calculate the offset between the trimmed frame center and original frame center
var offset_x := trim_rect_center_x - source_center_x
var offset_y := trim_rect_center_y - source_center_y
# Invert the vertical offset when the selected sprite is a Sprite3D
if is_sprite3d:
offset_y *= -1
# Insert the new key for the offset track
animation.track_insert_key(tracks.offset.idx, time, Vector2(offset_x, offset_y))
# Add up the current frame's duration for the next key position
time += frame.duration / 1000
# Set the animation length equal to the sum of all frame's durations
animation.length = time
sprite.texture = texture
sprite.region_enabled = true
sprite.centered = true
return OK

View File

@ -0,0 +1,26 @@
tool
extends Node
class_name EditorTheme
var _theme : Theme
func _init(theme : Theme) -> void:
_theme = theme
func get_color(color_name : String, color_list := "Editor") -> Color:
return _theme.get_color(color_name, color_list)
func get_font(font_name : String, font_list := "EditorFonts") -> Font:
return _theme.get_font(font_name, font_list)
func get_icon(icon_name : String, icon_list := "EditorIcons") -> Texture:
return _theme.get_icon(icon_name, icon_list)
func get_stylebox(stylebox_name : String, stylebox_list := "EditorStyles") -> StyleBox:
return _theme.get_stylebox(stylebox_name, stylebox_list)

View File

@ -0,0 +1,156 @@
tool
extends PanelContainer
onready var import_menu : Container = $Body/ImportMenu
onready var steps : Container = import_menu.get_node("Steps")
onready var json_import_menu : Container = steps.get_node("JSONImportMenu")
onready var tags_menu : Container = steps.get_node("TagsMenu")
onready var select_animation_player_menu = steps.get_node("SelectAnimationPlayerMenu")
onready var select_sprite_menu = steps.get_node("SelectSpriteMenu")
onready var generate_button : Button = steps.get_node("GenerateButton")
onready var spritesheet_inspector : Container = $Body/SpritesheetInspector
onready var alert_dialog : AcceptDialog = $AlertDialog
const ERROR_MSG := {
AsepriteImporter.Error.MISSING_JSON_DATA : "Missing JSON Data!",
AsepriteImporter.Error.MISSING_ANIMATION_PLAYER : "Select an AnimationPlayer node!",
AsepriteImporter.Error.MISSING_SPRITE : "Select a Sprite node!",
AsepriteImporter.Error.NO_TAGS_SELECTED : "No tags selected to import!",
AsepriteImporter.Error.DUPLICATE_TAG_NAME : "Two or more of the selected tags share the same name\nSelect only tags with distinct names",
AsepriteImporter.Error.MISSING_TEXTURE: "No texture selected!",
}
const IMPORT_MENU_INITIAL_WIDTH := 300
var import_data : AsepriteImportData
var _is_ready := false
signal animations_generated(animation_player)
func _ready() -> void:
import_menu.rect_size.x = IMPORT_MENU_INITIAL_WIDTH
alert_dialog.set_as_toplevel(true)
json_import_menu.connect("data_imported", self, "_on_JSONImportMenu_data_imported")
json_import_menu.connect("data_cleared", self, "_on_JSONImportMenu_data_cleared")
tags_menu.connect("frame_selected", self, "_on_TagSelectMenu_frame_selected")
tags_menu.connect("tag_selected", self, "_on_TagSelectMenu_tag_selected")
generate_button.connect("pressed", self, "_on_GenerateButton_pressed")
func get_state() -> Dictionary:
var state := {
"import_data" : import_data,
"tags_menu" : tags_menu.get_state(),
"select_sprite_menu" : select_sprite_menu.get_state(),
"select_animation_player_menu" : select_animation_player_menu.get_state(),
"spritesheet_inspector" : spritesheet_inspector.get_state(),
}
return state
func set_state(new_state : Dictionary) -> void:
var json_filepath := ""
var tags := []
var selected_tags := []
if new_state.get("import_data", false):
import_data = new_state.import_data
json_filepath = import_data.json_filepath
tags = import_data.get_tags()
spritesheet_inspector.frames = import_data.get_frame_array()
# var selected_tag := import_data.get_tag(tag_name)
# if selected_tag:
# spritesheet_inspector.select_frames(range(selected_tag.from, selected_tag.to + 1))
else:
import_data = null
new_state.erase("tags_menu")
# new_state.erase("spritesheet_inspector")
json_import_menu.set_json_filepath(json_filepath)
select_sprite_menu.set_state(new_state.get("select_sprite_menu", {}))
select_animation_player_menu.set_state(new_state.get("select_animation_player_menu", {}))
spritesheet_inspector.set_state(new_state.get("spritesheet_inspector", {}))
tags_menu.load_tags(tags)
tags_menu.set_state(new_state.get("tags_menu", {}))
func _show_alert(message : String) -> void:
alert_dialog.dialog_text = message
alert_dialog.popup_centered()
func _update_theme(editor_theme : EditorTheme) -> void:
generate_button.icon = editor_theme.get_icon("ImportCheck")
# Signal Callbacks
func _on_GenerateButton_pressed() -> void:
var selected_tags : Array = tags_menu.get_selected_tags()
var animation_player : AnimationPlayer = select_animation_player_menu.animation_player
var sprite : Node = select_sprite_menu.sprite
var texture : Texture = spritesheet_inspector.get_texture()
var error := AsepriteImporter.generate_animations(import_data, selected_tags, animation_player, sprite, texture)
if error != OK:
var error_msg : String
if ERROR_MSG.has(error):
error_msg = ERROR_MSG[error]
else:
error_msg = "An error ocurred!"
_show_alert(error_msg)
else:
emit_signal("animations_generated", animation_player)
func _on_JSONImportMenu_data_imported(new_import_data : AsepriteImportData) -> void:
import_data = new_import_data
var tags : Array = import_data.get_tags()
tags_menu.load_tags(tags)
var json_filepath := import_data.json_filepath
var json_dir_path := json_filepath.rsplit("/", true, 1)[0]
var image_filepath := ""
var image_filename := import_data.get_image_filename()
image_filepath = str(json_dir_path, "/", image_filename)
spritesheet_inspector.texture_size = import_data.get_image_size()
spritesheet_inspector.frames = import_data.get_frame_array()
spritesheet_inspector.load_texture(image_filepath)
func _on_JSONImportMenu_data_cleared() -> void:
import_data = null
spritesheet_inspector.clear_texture()
tags_menu.clear_options()
func _on_TagSelectMenu_frame_selected(idx : int) -> void:
spritesheet_inspector.select_frames([idx])
func _on_TagSelectMenu_tag_selected(tag_idx : int) -> void:
var selected_tag := import_data.get_tag(tag_idx)
spritesheet_inspector.select_frames(range(selected_tag.from, selected_tag.to + 1))

View File

@ -0,0 +1,100 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/Main.gd" type="Script" id=1]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectAnimationPlayerMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/JSONImportMenu.tscn" type="PackedScene" id=3]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/TagsMenu.tscn" type="PackedScene" id=4]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectSpriteMenu.tscn" type="PackedScene" id=5]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.tscn" type="PackedScene" id=6]
[sub_resource type="Image" id=3]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 229, 127, 0, 113, 241, 127, 0, 113, 240, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 229, 127, 0, 114, 229, 127, 20, 113, 241, 127, 184, 113, 240, 127, 144, 113, 240, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 229, 127, 0, 114, 229, 127, 20, 114, 241, 127, 210, 115, 242, 128, 255, 114, 241, 127, 170, 114, 241, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 229, 127, 0, 114, 229, 127, 20, 114, 241, 126, 209, 115, 242, 128, 255, 114, 241, 127, 210, 109, 230, 121, 21, 109, 230, 121, 0, 0, 0, 0, 0, 113, 240, 127, 0, 113, 241, 127, 0, 114, 229, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 235, 123, 0, 114, 229, 127, 20, 114, 241, 127, 208, 115, 242, 128, 255, 114, 241, 127, 210, 104, 231, 127, 22, 106, 230, 124, 0, 0, 0, 0, 0, 113, 240, 127, 0, 113, 240, 127, 144, 113, 241, 127, 184, 114, 229, 127, 20, 114, 229, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 240, 123, 0, 107, 241, 120, 19, 114, 241, 126, 207, 115, 242, 128, 255, 114, 241, 126, 211, 104, 231, 127, 22, 104, 231, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 114, 241, 127, 0, 114, 241, 127, 170, 115, 242, 128, 255, 114, 241, 127, 210, 114, 229, 127, 20, 114, 229, 127, 0, 113, 240, 127, 0, 113, 240, 127, 18, 114, 241, 126, 207, 115, 242, 128, 255, 114, 241, 127, 212, 104, 231, 127, 22, 104, 231, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 109, 230, 121, 0, 109, 230, 121, 21, 114, 241, 127, 210, 115, 242, 128, 255, 114, 241, 126, 209, 114, 229, 127, 20, 113, 240, 127, 18, 114, 241, 126, 207, 115, 242, 128, 255, 114, 241, 126, 213, 104, 231, 127, 22, 104, 231, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 230, 124, 0, 104, 231, 127, 22, 114, 241, 127, 210, 115, 242, 128, 255, 114, 241, 126, 207, 113, 241, 127, 206, 115, 242, 128, 255, 114, 241, 126, 213, 110, 232, 121, 23, 107, 231, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 231, 127, 0, 104, 231, 127, 22, 114, 241, 127, 212, 115, 242, 128, 255, 115, 242, 128, 255, 114, 241, 126, 213, 106, 233, 127, 24, 108, 232, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 231, 127, 0, 104, 231, 127, 22, 113, 241, 127, 186, 114, 241, 126, 187, 106, 233, 127, 24, 106, 233, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104, 231, 127, 0, 113, 241, 127, 0, 114, 241, 126, 0, 106, 233, 127, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="Main" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Body" type="HSplitContainer" parent="."]
margin_left = 7.0
margin_top = 7.0
margin_right = 1017.0
margin_bottom = 593.0
size_flags_vertical = 3
[node name="ImportMenu" type="ScrollContainer" parent="Body"]
margin_right = 300.0
margin_bottom = 586.0
rect_min_size = Vector2( 300, 0 )
size_flags_vertical = 3
follow_focus = true
scroll_horizontal_enabled = false
scroll_horizontal = 100
[node name="Steps" type="VBoxContainer" parent="Body/ImportMenu"]
margin_right = 300.0
margin_bottom = 586.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 12
[node name="JSONImportMenu" parent="Body/ImportMenu/Steps" instance=ExtResource( 3 )]
margin_right = 300.0
[node name="TagsMenu" parent="Body/ImportMenu/Steps" instance=ExtResource( 4 )]
margin_top = 50.0
margin_right = 300.0
margin_bottom = 432.0
[node name="SelectAnimationPlayerMenu" parent="Body/ImportMenu/Steps" instance=ExtResource( 2 )]
margin_top = 444.0
margin_right = 300.0
margin_bottom = 484.0
[node name="SelectSpriteMenu" parent="Body/ImportMenu/Steps" instance=ExtResource( 5 )]
margin_top = 496.0
margin_right = 300.0
margin_bottom = 536.0
[node name="HSeparator" type="HSeparator" parent="Body/ImportMenu/Steps"]
margin_top = 548.0
margin_right = 300.0
margin_bottom = 552.0
[node name="GenerateButton" type="Button" parent="Body/ImportMenu/Steps"]
margin_top = 564.0
margin_right = 300.0
margin_bottom = 586.0
hint_tooltip = "Generate the animations in the selected AnimationPlayer node"
size_flags_horizontal = 3
text = "Generate Animations"
icon = SubResource( 2 )
[node name="SpritesheetInspector" parent="Body" instance=ExtResource( 6 )]
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 312.0
margin_right = 1010.0
margin_bottom = 586.0
[node name="AlertDialog" type="AcceptDialog" parent="."]
margin_right = 83.0
margin_bottom = 58.0
popup_exclusive = true

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/dark_icon.png-bd7f807ed17ce703bf3818e1cafe2892.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/aseprite_importer/interface/icons/dark_icon.png"
dest_files=[ "res://.import/dark_icon.png-bd7f807ed17ce703bf3818e1cafe2892.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/light_icon.png-7736224c34e6f06ad3ecf9b37cd89cab.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/aseprite_importer/interface/icons/light_icon.png"
dest_files=[ "res://.import/light_icon.png-7736224c34e6f06ad3ecf9b37cd89cab.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -0,0 +1,75 @@
tool
extends Container
onready var import_button : Button = $InputContainer/ImportButton
onready var clear_button : Button = $InputContainer/ClearButton
onready var file_dialog : FileDialog = $FileDialog
onready var alert_dialog : AcceptDialog = $AlertDialog
const IMPORT_BUTTON_DEFAULT_TEXT = "Import JSON"
signal data_imported(import_data)
signal data_cleared
func _ready():
clear_button.hide()
alert_dialog.set_as_toplevel(true)
import_button.connect("pressed", self, "_on_ImportButton_pressed")
clear_button.connect("pressed", self, "_on_ClearButton_pressed")
file_dialog.connect("file_selected", self, "_on_FileDialog_file_selected")
func set_json_filepath(new_filepath : String) -> void:
if new_filepath:
import_button.text = new_filepath
clear_button.show()
else:
import_button.text = IMPORT_BUTTON_DEFAULT_TEXT
clear_button.hide()
func _update_theme(editor_theme : EditorTheme) -> void:
import_button.icon = editor_theme.get_icon("Load")
clear_button.icon = editor_theme.get_icon("Clear")
#Signal Callbacks
func _on_ImportButton_pressed() -> void:
file_dialog.popup_centered_ratio(0.5)
func _on_ClearButton_pressed() -> void:
set_json_filepath("")
emit_signal("data_cleared")
func _on_FileDialog_file_selected(path : String) -> void:
var import_data := AsepriteImportData.new()
var error := import_data.load(path)
if error != OK:
var error_msg : String
match error:
AsepriteImportData.Error.JSON_PARSE_ERROR:
error_msg = "Error parsing the file"
AsepriteImportData.Error.INVALID_JSON_DATA:
error_msg = "Invalid Aseprite JSON file"
var code:
error_msg = "An error occurred!\nerror code: %d" % code
set_json_filepath("")
yield(get_tree(), "idle_frame")
alert_dialog.dialog_text = error_msg
alert_dialog.popup_centered()
else:
set_json_filepath(path)
emit_signal("data_imported", import_data)

View File

@ -0,0 +1,78 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/JSONImportMenu.gd" type="Script" id=1]
[sub_resource type="Image" id=3]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 179, 223, 223, 223, 179, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 220, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 220, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 220, 0, 220, 220, 220, 59, 223, 223, 223, 201, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 200, 220, 220, 220, 59, 220, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 199, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 222, 222, 222, 198, 222, 222, 222, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 203, 223, 223, 223, 203, 223, 223, 223, 152, 223, 223, 223, 152, 222, 222, 222, 101, 222, 222, 222, 101, 219, 219, 219, 50, 219, 219, 219, 50, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 222, 222, 222, 0, 222, 222, 222, 0, 219, 219, 219, 0, 219, 219, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="JSONImport" type="VBoxContainer"]
margin_right = 91.0
margin_bottom = 38.0
size_flags_horizontal = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_right = 91.0
margin_bottom = 14.0
text = "JSON Data"
valign = 1
[node name="InputContainer" type="HBoxContainer" parent="."]
margin_top = 18.0
margin_right = 91.0
margin_bottom = 38.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ImportButton" type="Button" parent="InputContainer"]
margin_right = 91.0
margin_bottom = 20.0
hint_tooltip = "Import a Aseprite JSON file"
size_flags_horizontal = 3
text = "Import JSON"
[node name="ClearButton" type="Button" parent="InputContainer"]
visible = false
margin_left = 143.0
margin_top = -18.0
margin_right = 187.0
margin_bottom = 2.0
text = "Clear"
icon = SubResource( 2 )
[node name="FileDialog" type="FileDialog" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_bottom = 110.0
window_title = "Select the JSON file"
resizable = true
mode_overrides_title = false
mode = 0
filters = PoolStringArray( "*.json ; JSON Files" )
show_hidden_files = true
[node name="AlertDialog" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_top = 42.0
margin_right = 400.0
margin_bottom = 100.0
popup_exclusive = true

View File

@ -0,0 +1,64 @@
tool
extends Container
onready var select_button : Button = $Button
onready var select_node_dialog : WindowDialog = $SelectNodeDialog
const SELECT_BUTTON_DEFAULT_TEXT := "Select a Node"
var animation_player : AnimationPlayer setget set_animation_player
signal node_selected(animation_player)
func _ready():
select_node_dialog.class_filters = ["AnimationPlayer"]
select_button.connect("pressed", self, "_on_SelectButton_pressed")
select_node_dialog.connect("node_selected", self, "_on_SelectNodeDialog_node_selected")
func get_state() -> Dictionary:
var state := {}
if animation_player:
state.animation_player = animation_player
return state
func set_state(new_state : Dictionary) -> void:
var new_animation_player : Node = new_state.get("animation_player")
if new_animation_player != null :
self.animation_player = new_animation_player
else:
animation_player = null
select_button.text = SELECT_BUTTON_DEFAULT_TEXT
func _update_theme(editor_theme : EditorTheme) -> void:
select_button.icon = editor_theme.get_icon("AnimationPlayer")
# Setters and Getters
func set_animation_player(node : AnimationPlayer) -> void:
animation_player = node
var node_path := node.owner.get_parent().get_path_to(node)
select_button.text = node_path
# Signal Callbacks
func _on_SelectButton_pressed() -> void:
if select_node_dialog.initialize():
select_node_dialog.popup_centered_ratio(.5)
func _on_SelectNodeDialog_node_selected(selected_node : Node) -> void:
self.animation_player = selected_node
emit_signal("node_selected", selected_node)

View File

@ -0,0 +1,53 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectNodeDialog.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectAnimationPlayerMenu.gd" type="Script" id=2]
[sub_resource type="Image" id=1]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 206, 164, 241, 0, 204, 159, 235, 0, 0, 0, 0, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 164, 241, 0, 0, 0, 0, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 161, 238, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 162, 239, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 204, 159, 235, 40, 205, 161, 238, 0, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 255, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 255, 206, 164, 241, 0, 0, 0, 0, 0, 206, 164, 241, 0, 204, 159, 235, 0, 0, 0, 0, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 206, 164, 241, 0, 0, 0, 0, 0, 0, 0, 0, 0, 206, 164, 241, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 1 )
size = Vector2( 16, 16 )
[node name="SelectAnimationPlayer" type="VBoxContainer"]
margin_right = 148.0
margin_bottom = 38.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_right = 148.0
margin_bottom = 14.0
text = "Select AnimationPlayer"
[node name="Button" type="Button" parent="."]
margin_top = 18.0
margin_right = 148.0
margin_bottom = 40.0
hint_tooltip = "Select a AnimationPlayer node from the current scene"
text = "Select Node"
icon = SubResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SelectNodeDialog" parent="." instance=ExtResource( 1 )]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 42.0
margin_right = 245.0
margin_bottom = 43.0
window_title = "Select the AnimationPlayer Node"

View File

@ -0,0 +1,144 @@
tool
extends WindowDialog
onready var body : VBoxContainer = $MarginContainer/Body
onready var edited_scene_view : Container = body.get_node('EditedSceneView')
onready var scene_tree : Tree = edited_scene_view.get_node('SceneTree')
onready var footer : HBoxContainer = body.get_node('Footer')
onready var confirm_button : Button = footer.get_node('ConfirmButton')
onready var cancel_button : Button = footer.get_node('CancelButton')
onready var alert_dialog : AcceptDialog = $AlertDialog
enum Columns {
NAME,
PATH,
}
const MSG_EMPTY_SCENE = 'The current scene is empty!'
const MSG_UNSAVED_SCENE = 'The current scene is still not saved!'
const MSG_NO_FILTERED_NODES_IN_SCENE = "There aren't any %s nodes in the current scene"
const WINDOW_TITLE_DEFAULT = 'Select a Node'
const WINDOW_TITLE_WITH_FILTER = "Select the %s Node"
const DISABLED_ICON_MODULATE := Color(1, 1, 1, .5)
var class_filters : Array setget set_class_filters
var edited_scene_root : Node
var _editor_theme : EditorTheme
signal node_selected(selected_node)
func _ready():
self.class_filters = class_filters
scene_tree.columns = Columns.size()
scene_tree.set_column_expand(Columns.PATH, false)
alert_dialog.set_as_toplevel(true)
scene_tree.connect('item_activated', self, '_on_node_selected')
confirm_button.connect('pressed', self, '_on_node_selected')
cancel_button.connect('pressed', self, 'hide')
func initialize() -> bool:
edited_scene_root = get_tree().get_edited_scene_root()
if edited_scene_root == null:
_show_alert(MSG_EMPTY_SCENE)
return false
var scene_filename := edited_scene_root.filename
if not scene_filename:
_show_alert(MSG_UNSAVED_SCENE)
return false
scene_tree.clear()
var filtered_node_count := _add_node_to_scene_tree(edited_scene_root)
if class_filters and filtered_node_count == 0:
var filters_str := PoolStringArray(class_filters).join(" / ")
_show_alert(MSG_NO_FILTERED_NODES_IN_SCENE % filters_str)
return false
return true
func _add_node_to_scene_tree(node : Node, parent : TreeItem = null) -> int:
var tree_item := scene_tree.create_item(parent)
var node_class := node.get_class()
tree_item.set_icon(Columns.NAME, _editor_theme.get_icon(node_class))
tree_item.set_text(Columns.NAME, node.name)
tree_item.set_text(Columns.PATH, edited_scene_root.get_path_to(node))
var disabled_font_color := _editor_theme.get_color("disabled_font_color")
var filtered_node_count := 0
if class_filters:
var is_valid := false
for filter in class_filters:
if node.is_class(filter):
is_valid = true
filtered_node_count += 1
break
if not is_valid:
tree_item.set_selectable(Columns.NAME, false)
tree_item.set_icon_modulate(Columns.NAME, DISABLED_ICON_MODULATE)
tree_item.set_custom_color(Columns.NAME, disabled_font_color)
for child in node.get_children():
if child.owner == edited_scene_root:
filtered_node_count += _add_node_to_scene_tree(child, tree_item)
return filtered_node_count
func _show_alert(message : String) -> void:
alert_dialog.dialog_text = message
alert_dialog.popup_centered()
func _update_theme(editor_theme : EditorTheme) -> void:
_editor_theme = editor_theme
# Setters and Getters
func set_class_filters(filters : Array) -> void:
class_filters = filters
if class_filters != []:
var filters_str := PoolStringArray(class_filters).join(" / ")
window_title = WINDOW_TITLE_WITH_FILTER % filters_str
else:
window_title = WINDOW_TITLE_DEFAULT
# Signal Callbacks
func _on_node_selected() -> void:
var selected_item := scene_tree.get_selected()
if selected_item:
var node_path := selected_item.get_text(Columns.PATH)
var selected_node := edited_scene_root.get_node(node_path)
emit_signal('node_selected', selected_node)
hide()

View File

@ -0,0 +1,98 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectNodeDialog.gd" type="Script" id=1]
[node name="SelectNodeDialog" type="WindowDialog"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -150.0
margin_top = -100.0
margin_right = 150.0
margin_bottom = 100.0
rect_min_size = Vector2( 300, 200 )
size_flags_horizontal = 3
size_flags_vertical = 3
window_title = "Select a Node"
resizable = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 8
custom_constants/margin_top = 8
custom_constants/margin_left = 8
custom_constants/margin_bottom = 8
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Body" type="VBoxContainer" parent="MarginContainer"]
margin_left = 8.0
margin_top = 8.0
margin_right = 292.0
margin_bottom = 192.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="EditedSceneView" type="VBoxContainer" parent="MarginContainer/Body"]
margin_right = 284.0
margin_bottom = 160.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="MarginContainer/Body/EditedSceneView"]
margin_right = 284.0
margin_bottom = 14.0
size_flags_horizontal = 3
text = "Current Edited Scene:"
[node name="SceneTree" type="Tree" parent="MarginContainer/Body/EditedSceneView"]
margin_top = 18.0
margin_right = 284.0
margin_bottom = 160.0
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Footer" type="HBoxContainer" parent="MarginContainer/Body"]
margin_top = 164.0
margin_right = 284.0
margin_bottom = 184.0
size_flags_horizontal = 3
[node name="ConfirmButton" type="Button" parent="MarginContainer/Body/Footer"]
margin_left = 25.0
margin_right = 114.0
margin_bottom = 20.0
size_flags_horizontal = 6
text = "Select Node"
[node name="CancelButton" type="Button" parent="MarginContainer/Body/Footer"]
margin_left = 187.0
margin_right = 241.0
margin_bottom = 20.0
size_flags_horizontal = 6
text = "Cancel"
[node name="AlertDialog" type="AcceptDialog" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -41.5
margin_top = -29.0
margin_right = 41.5
margin_bottom = 29.0
popup_exclusive = true

View File

@ -0,0 +1,81 @@
tool
extends Container
onready var select_button : Button = $Button
onready var select_node_dialog : WindowDialog = $SelectNodeDialog
const SELECT_BUTTON_DEFAULT_TEXT := "Select a Node"
var sprite : Node setget set_sprite
var _sprite_icon : Texture
var _sprite3d_icon : Texture
signal node_selected(sprite)
func _ready():
select_node_dialog.class_filters = ["Sprite", "Sprite3D"]
select_button.connect("pressed", self, "_on_SelectButton_pressed")
select_node_dialog.connect("node_selected", self, "_on_SelectNodeDialog_node_selected")
func get_state() -> Dictionary:
var state := {}
if sprite:
state.sprite = sprite
return state
func set_state(new_state : Dictionary) -> void:
var new_sprite : Node = new_state.get("sprite")
if new_sprite != null:
self.sprite = new_sprite
else:
sprite = null
select_button.text = SELECT_BUTTON_DEFAULT_TEXT
select_button.icon = _sprite_icon
func _update_theme(editor_theme : EditorTheme) -> void:
var is_sprite3d := select_button.icon == _sprite3d_icon
_sprite_icon = editor_theme.get_icon("Sprite")
_sprite3d_icon = editor_theme.get_icon("Sprite3D")
if is_sprite3d:
select_button.icon = _sprite3d_icon
else:
select_button.icon = _sprite_icon
# Setters and Getters
func set_sprite(node : Node) -> void:
sprite = node
var node_path := node.owner.get_parent().get_path_to(node)
select_button.text = node_path
if node.is_class("Sprite"):
select_button.icon = _sprite_icon
elif node.is_class("Sprite3D"):
select_button.icon = _sprite3d_icon
# Signal Callbacks
func _on_SelectButton_pressed() -> void:
if select_node_dialog.initialize():
select_node_dialog.popup_centered_ratio(.5)
func _on_SelectNodeDialog_node_selected(selected_node : Node) -> void:
self.sprite = selected_node
emit_signal("node_selected", selected_node)

View File

@ -0,0 +1,43 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectNodeDialog.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/SelectSpriteMenu.gd" type="Script" id=2]
[sub_resource type="Image" id=3]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 163, 182, 236, 0, 164, 182, 242, 0, 164, 182, 242, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 164, 182, 242, 0, 164, 182, 242, 0, 160, 179, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 161, 180, 236, 0, 163, 182, 236, 28, 164, 182, 242, 169, 164, 182, 242, 229, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 229, 164, 182, 242, 169, 160, 179, 236, 27, 160, 179, 236, 0, 0, 0, 0, 0, 160, 179, 236, 0, 160, 179, 236, 27, 164, 182, 242, 236, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 236, 160, 179, 236, 27, 160, 179, 236, 0, 164, 181, 242, 0, 164, 181, 242, 164, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 181, 242, 163, 164, 181, 242, 0, 164, 182, 242, 0, 164, 182, 242, 225, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 225, 164, 182, 242, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 163, 182, 240, 70, 163, 182, 240, 70, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 163, 182, 240, 70, 163, 182, 240, 70, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 241, 0, 164, 182, 241, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 241, 0, 164, 182, 241, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 241, 0, 164, 182, 241, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 241, 0, 164, 182, 241, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 163, 182, 240, 70, 163, 182, 240, 70, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 163, 182, 240, 70, 163, 182, 240, 70, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 0, 164, 182, 242, 0, 164, 182, 242, 226, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 252, 163, 182, 241, 95, 163, 182, 241, 95, 164, 182, 242, 201, 164, 182, 242, 201, 163, 182, 241, 95, 163, 182, 241, 95, 164, 182, 242, 251, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 225, 164, 182, 242, 0, 164, 181, 242, 0, 164, 181, 242, 164, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 163, 182, 236, 28, 163, 182, 239, 0, 163, 177, 238, 0, 163, 177, 238, 0, 163, 181, 240, 0, 161, 178, 238, 30, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 181, 242, 164, 164, 181, 242, 0, 160, 179, 236, 0, 160, 179, 236, 27, 164, 182, 242, 237, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 226, 163, 182, 242, 84, 163, 173, 234, 25, 163, 173, 234, 25, 165, 183, 243, 85, 164, 182, 242, 226, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 237, 160, 179, 236, 27, 160, 179, 236, 0, 0, 0, 0, 0, 161, 180, 236, 0, 163, 182, 236, 28, 164, 182, 242, 169, 164, 182, 242, 229, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 165, 183, 243, 255, 164, 182, 242, 229, 164, 182, 242, 169, 160, 179, 236, 27, 160, 179, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 163, 182, 236, 0, 164, 182, 242, 0, 164, 182, 242, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 165, 183, 243, 0, 164, 182, 242, 0, 164, 182, 242, 0, 160, 179, 236, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 3 )
size = Vector2( 16, 16 )
[node name="SelectSprite" type="VBoxContainer"]
margin_right = 89.0
margin_bottom = 38.0
size_flags_horizontal = 3
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_right = 107.0
margin_bottom = 14.0
text = "Select Sprite"
[node name="Button" type="Button" parent="."]
margin_top = 18.0
margin_right = 107.0
margin_bottom = 40.0
hint_tooltip = "Select a Sprite node from the current scene"
text = "Select Node"
icon = SubResource( 2 )
[node name="SelectNodeDialog" parent="." instance=ExtResource( 1 )]

View File

@ -0,0 +1,202 @@
tool
extends Container
onready var select_all_button : CheckBox = find_node("SelectAllButton")
onready var options_list : VBoxContainer = find_node("OptionsList")
onready var tree : Tree = $Tree
enum Columns {
SELECTED,
NAME,
START,
END,
DIRECTION,
}
var _tree_root : TreeItem
var _options := []
var _toggling_option := false
signal frame_selected(idx)
signal selected_tags_changed(selected_tags)
signal tag_selected(tag_name)
func _ready():
clear_options()
tree.columns = Columns.size()
tree.set_column_expand(Columns.SELECTED, false)
tree.set_column_min_width(Columns.SELECTED, 32)
tree.set_column_title(Columns.NAME, "Name")
tree.set_column_expand(Columns.NAME, true)
tree.set_column_min_width(Columns.START, 48)
tree.set_column_title(Columns.START, "Start")
tree.set_column_expand(Columns.START, false)
tree.set_column_min_width(Columns.START, 48)
tree.set_column_title(Columns.END, "End")
tree.set_column_expand(Columns.END, false)
tree.set_column_min_width(Columns.END, 48)
tree.set_column_title(Columns.DIRECTION, "Direction")
tree.set_column_expand(Columns.DIRECTION, false)
tree.set_column_min_width(Columns.DIRECTION, 84)
tree.set_column_titles_visible(true)
select_all_button.connect("toggled", self, "_on_SelectAllButton_toggled")
tree.connect("cell_selected", self, "_on_Tree_cell_selected")
tree.connect("item_edited", self, "_on_Tree_item_edited")
func clear_options() -> void:
select_all_button.hide()
for option in _options:
option.free()
_options.clear()
tree.clear()
_tree_root = tree.create_item()
func load_tags(tags : Array) -> void:
clear_options()
if tags == []:
return
for tag in tags:
var new_tree_item := tree.create_item(_tree_root)
new_tree_item.set_cell_mode(Columns.SELECTED, TreeItem.CELL_MODE_CHECK)
new_tree_item.set_editable(Columns.SELECTED, true)
new_tree_item.set_checked(Columns.SELECTED, true)
new_tree_item.set_selectable(Columns.SELECTED, false)
new_tree_item.set_text(Columns.NAME, tag.name)
new_tree_item.set_text(Columns.START, str(floor(tag.from)))
new_tree_item.set_text_align(Columns.START, TreeItem.ALIGN_CENTER)
new_tree_item.set_text(Columns.END, str(floor(tag.to)))
new_tree_item.set_text_align(Columns.END, TreeItem.ALIGN_CENTER)
new_tree_item.set_text(Columns.DIRECTION, " %s" % tag.direction)
new_tree_item.set_selectable(Columns.DIRECTION, false)
_options.append(new_tree_item)
select_all_button.pressed = true
select_all_button.show()
func get_selected_tags() -> Array:
var selected_tags := []
for i in range(_options.size()):
var item : TreeItem = _options[i]
if item.is_checked(Columns.SELECTED):
selected_tags.append(i)
return selected_tags
func get_state() -> Dictionary:
var state := {
selected_tags = get_selected_tags()
}
var selected_item := tree.get_selected()
if selected_item != null:
var selected_column := tree.get_selected_column()
var item_idx := _options.find(selected_item)
state.selected_cell = Vector2(selected_column, item_idx)
return state
func set_state(new_state : Dictionary) -> void:
if new_state.has("selected_tags") and _options != []:
select_all_button.pressed = false
for tag in new_state.selected_tags:
_options[tag].set_checked(Columns.SELECTED, true)
if new_state.has("selected_cell"):
var selected_cell : Vector2 = new_state.selected_cell
var tree_item : TreeItem = _options[selected_cell.y]
var column : int = selected_cell.x
tree_item.select(column)
match column:
Columns.NAME:
emit_signal("tag_selected", selected_cell.y)
Columns.START, Columns.END:
emit_signal("frame_selected", int(tree_item.get_text(column)))
for option in _options:
if not option.is_checked(Columns.SELECTED):
return
_toggling_option = true
select_all_button.pressed = true
_toggling_option = false
# Signal Callbacks
func _on_SelectAllButton_toggled(button_pressed : bool) -> void:
if _toggling_option:
return
for option in _options:
option.set_checked(Columns.SELECTED, button_pressed)
emit_signal("selected_tags_changed", get_selected_tags())
func _on_Tree_cell_selected() -> void:
var selected_column := tree.get_selected_column()
var selected_item := tree.get_selected()
match selected_column:
Columns.NAME:
emit_signal("tag_selected", _options.find(selected_item))
Columns.START, Columns.END:
emit_signal("frame_selected", int(selected_item.get_text(selected_column)))
func _on_Tree_item_edited() -> void:
_toggling_option = true
if select_all_button.pressed:
for option in _options:
if option.is_checked(Columns.SELECTED):
select_all_button.pressed = false
break
else:
var is_all_selected := true
for option in _options:
if not option.is_checked(Columns.SELECTED):
is_all_selected = false
break
if is_all_selected:
select_all_button.pressed = true
_toggling_option = false
emit_signal("selected_tags_changed", get_selected_tags())

View File

@ -0,0 +1,41 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/import_menu/TagsMenu.gd" type="Script" id=1]
[node name="TagSelectMenu" type="VBoxContainer"]
rect_min_size = Vector2( 0, 120 )
size_flags_vertical = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Header" type="HBoxContainer" parent="."]
margin_right = 28.0
margin_bottom = 14.0
[node name="Label" type="Label" parent="Header"]
margin_right = 28.0
margin_bottom = 14.0
size_flags_horizontal = 3
text = "Tags"
valign = 1
[node name="SelectAllButton" type="CheckBox" parent="Header"]
visible = false
margin_left = 32.0
margin_right = 120.0
margin_bottom = 24.0
size_flags_horizontal = 8
text = "Select All"
[node name="Tree" type="Tree" parent="."]
margin_top = 18.0
margin_right = 28.0
margin_bottom = 120.0
size_flags_vertical = 3
columns = 5
hide_folding = true
hide_root = true

View File

@ -0,0 +1,95 @@
tool
extends Container
onready var label : Label = $Header/Label
onready var visibility_button: Button = $Header/VisibilityButton
onready var color_picker : ColorPickerButton = $ColorPicker
export var label_text := '' setget set_label_text
export var visibility := true setget set_visibility
export var show_visibility_button := true setget set_show_visibility_button
export var color_value := Color.black setget set_color_value
export var color_edit_alpha := true setget set_color_edit_alpha
export(String, MULTILINE) var color_picker_tooltip := "" setget set_color_picker_tooltip
var _visible_icon : Texture
var _hidden_icon : Texture
signal property_changed(color_menu_item)
func _ready():
self.label_text = label_text
self.visibility = visibility
self.show_visibility_button = show_visibility_button
self.color_value = color_value
self.color_edit_alpha = color_edit_alpha
self.color_picker_tooltip = color_picker_tooltip
visibility_button.connect('pressed', self, '_on_ViewButton_pressed')
color_picker.connect('color_changed', self, '_on_ColorPicker_color_changed')
func _update_theme(editor_theme : EditorTheme) -> void:
_visible_icon = editor_theme.get_icon('GuiVisibilityVisible')
_hidden_icon = editor_theme.get_icon('GuiVisibilityHidden')
self.visibility = visibility
# Setters and Getters
func set_color_picker_tooltip(text : String) -> void:
color_picker_tooltip = text
if color_picker:
color_picker.hint_tooltip = text
func set_color_value(color: Color) -> void:
color_value = color
if color_picker:
color_picker.color = color_value
func set_color_edit_alpha(value : bool) -> void:
color_edit_alpha = value
if color_picker:
color_picker.edit_alpha = color_edit_alpha
func set_label_text(text : String) -> void:
label_text = text
if label:
label.text = label_text
func set_show_visibility_button(show_button : bool) -> void:
show_visibility_button = show_button
if visibility_button:
visibility_button.visible = show_visibility_button
func set_visibility(value : bool) -> void:
visibility = value
if visibility_button:
if visibility:
visibility_button.icon = _visible_icon
visibility_button.modulate.a = 1
else:
visibility_button.icon = _hidden_icon
visibility_button.modulate.a = .5
# Signal Callbacks
func _on_ColorPicker_color_changed(color : Color) -> void:
color_value = color
emit_signal('property_changed', self)
func _on_ViewButton_pressed() -> void:
self.visibility = !visibility
emit_signal('property_changed', self)

View File

@ -0,0 +1,37 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/ColorMenuItem.gd" type="Script" id=1]
[node name="ColorMenuItem" type="VBoxContainer"]
margin_right = 103.0
margin_bottom = 46.0
size_flags_horizontal = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Header" type="HBoxContainer" parent="."]
margin_right = 116.0
margin_bottom = 22.0
rect_min_size = Vector2( 0, 22 )
[node name="Label" type="Label" parent="Header"]
margin_top = 4.0
margin_right = 100.0
margin_bottom = 18.0
size_flags_horizontal = 3
text = "ColorMenuItem"
[node name="VisibilityButton" type="ToolButton" parent="Header"]
margin_left = 104.0
margin_right = 116.0
margin_bottom = 22.0
hint_tooltip = "Toggle Visibility"
size_flags_horizontal = 8
shortcut_in_tooltip = false
[node name="ColorPicker" type="ColorPickerButton" parent="."]
margin_top = 26.0
margin_right = 116.0
margin_bottom = 46.0

View File

@ -0,0 +1,74 @@
tool
extends Container
onready var options : Container = $Options
const PROP_TO_COLOR_MENU := {
frame_border = "FrameBorder",
selection_border = "SelectionBorder",
texture_background = "TextureBackground",
inspector_background = "InspectorBackground",
}
const DEFAULT_SETTINGS :={
frame_border = {
color = Color("#808080"),
visibility = true,
},
selection_border = {
color = Color.yellow,
visibility = true,
},
texture_background = {
color = Color("#404040"),
visibility = true,
},
inspector_background = {
color = Color.black,
},
}
var settings := DEFAULT_SETTINGS.duplicate(true) setget set_settings
signal settings_changed(settings)
func _ready():
for property in PROP_TO_COLOR_MENU:
var node_name : String = PROP_TO_COLOR_MENU[property]
var color_menu = options.get_node(node_name)
color_menu.set_meta("property", property)
color_menu.connect("property_changed", self, "_on_ColorMenuItem_property_changed")
# Setters and Getters
func set_settings(new_settings : Dictionary) -> void:
if new_settings:
settings = new_settings
else:
settings = DEFAULT_SETTINGS.duplicate(true)
for property in PROP_TO_COLOR_MENU:
var node_name : String = PROP_TO_COLOR_MENU[property]
var color_menu = options.get_node(node_name)
color_menu.color_value = settings[property].color
color_menu.visibility = settings[property].get("visibility", false)
emit_signal("settings_changed", settings)
# Signal Callbacks
func _on_ColorMenuItem_property_changed(color_menu_item : Node) -> void:
var property : String = color_menu_item.get_meta("property")
settings[property]["color"] = color_menu_item.color_value
settings[property]["visibility"] = color_menu_item.visibility
emit_signal("settings_changed", settings)

View File

@ -0,0 +1,246 @@
tool
extends Container
onready var header : HBoxContainer= $Header
onready var filename_label : Label = header.find_node("Filename")
onready var settings_button : Button = header.find_node("SettingsButton")
onready var body : Container = $Body
onready var warning_message : Label = body.find_node("WarningMessage")
onready var search_file_button : Button = body.find_node("SearchFileButton")
onready var spritesheet_view : Container = body.find_node("SpritesheetView")
onready var settings_menu : Container = body.get_node("SettingsMenu")
onready var footer : HBoxContainer = $Footer
onready var frame_count : Label = footer.get_node("FrameCount")
onready var zoom_button : Button = footer.get_node("ZoomButton")
onready var zoom_slider : HSlider = footer.get_node("ZoomSlider")
onready var file_dialog : FileDialog = $FileDialog
const MSG_MISSING_IMAGE_PARAMETER = "The imported JSON doesn't contain the spritesheet file name"
const MSG_IMPORT_JSON = "Import a Aseprite JSON file to \npreview the spritesheet"
const MSG_INVALID_TEXTURE_SIZE = "The selected texture size %s doesn't match the JSON %s"
const MSG_LOAD_ERROR = "Error on loading the file!"
const MSG_SPRITESHEET_NOT_FOUND = "Spritesheet \"%s\" not found!"
var texture_size : Vector2 setget set_texture_size
var frames := []
var _zoom_update := false
func _ready() -> void:
clear_texture()
settings_button.pressed = false
warning_message.text = MSG_IMPORT_JSON
search_file_button.hide()
spritesheet_view.hide()
settings_menu.hide()
var settings = settings_menu.settings
spritesheet_view.load_settings(settings)
settings_button.connect("toggled", self, "_on_SettingsButton_toggled")
search_file_button.connect("pressed", self, "_on_SearchFileButton_pressed")
spritesheet_view.connect("zoom_changed", self, "_on_SpritesheetInspector_zoom_changed")
settings_menu.connect("settings_changed", self, "_on_SettingsMenu_settings_changed")
zoom_button.connect("pressed", self, "_on_ZoomButton_pressed")
zoom_slider.connect("value_changed", self, "_on_ZoomSlider_value_changed")
file_dialog.connect("file_selected", self, "_on_FileDialog_file_selected")
func clear_texture() -> void:
filename_label.text = ""
spritesheet_view.hide()
spritesheet_view.texture = null
warning_message.text = MSG_IMPORT_JSON
search_file_button.hide()
footer.hide()
func get_state() -> Dictionary:
var state := {}
if spritesheet_view.texture:
state.texture = spritesheet_view.texture
state.zoom = spritesheet_view.zoom
state.offset = spritesheet_view.offset
state.warning_msg = warning_message.text
state.search_file_button_visible =search_file_button.visible
state.settings = settings_menu.settings
return state
func get_texture() -> Texture:
return spritesheet_view.texture
func load_texture(path : String) -> int:
if not path:
_show_find_file_prompt(MSG_MISSING_IMAGE_PARAMETER)
return ERR_INVALID_DATA
clear_texture()
var split_path := path.rsplit("/", true, 1)
var dir_path := split_path[0]
var file_name := split_path[1]
if file_name == "":
_show_find_file_prompt(MSG_MISSING_IMAGE_PARAMETER)
file_dialog.current_dir = dir_path
return ERR_INVALID_DATA
var file := File.new()
if !file.file_exists(path):
_show_find_file_prompt(MSG_SPRITESHEET_NOT_FOUND % file_name)
file_dialog.current_dir = dir_path
return ERR_FILE_NOT_FOUND
var new_texture : Texture = load(path)
if new_texture == null:
_show_find_file_prompt(MSG_LOAD_ERROR)
return ERR_INVALID_DATA
var new_texture_size := new_texture.get_size()
if new_texture_size != texture_size:
var message := MSG_INVALID_TEXTURE_SIZE % [new_texture.get_size(), texture_size]
_show_find_file_prompt(message)
return ERR_INVALID_DATA
spritesheet_view.texture = new_texture
spritesheet_view.frames = frames
spritesheet_view.selected_frames = []
filename_label.text = file_name
_update_frames_count()
spritesheet_view.show()
footer.show()
return OK
func select_frames(selected_frames : Array) -> void:
spritesheet_view.selected_frames = selected_frames
func set_state(new_state : Dictionary) -> void:
if new_state.get("texture", false):
spritesheet_view.texture = new_state.texture
spritesheet_view.zoom = new_state.zoom
spritesheet_view.offset = new_state.offset
spritesheet_view.frames = frames
spritesheet_view.selected_frames = new_state.get("selected_frames", [])
filename_label.text = new_state.texture.resource_path
_update_frames_count()
spritesheet_view.show()
footer.show()
else:
clear_texture()
warning_message.text = new_state.get("warning_msg", MSG_IMPORT_JSON)
search_file_button.visible = new_state.get("search_file_button_visible", (warning_message.text != MSG_IMPORT_JSON))
settings_menu.settings = new_state.get("settings", {})
func _show_find_file_prompt(message : String) -> void:
clear_texture()
warning_message.text = message
search_file_button.show()
func _update_frames_count() -> void:
var frames_size := frames.size()
if frames_size <= 0:
frame_count.text = ""
return
frame_count.text = "%d frames" % frames_size
var distinct_regions := []
for frame in frames:
var region : Dictionary = frame.frame
var rect := Rect2(region.x, region.y, region.w, region.h)
if distinct_regions.find(rect) == -1:
distinct_regions.append(rect)
var distinct_frames_size := distinct_regions.size()
if frames_size > distinct_frames_size:
var merged_frames_count := frames_size - distinct_frames_size
frame_count.text += " (%d merged)" % merged_frames_count
func _update_theme(editor_theme : EditorTheme) -> void:
settings_button.icon = editor_theme.get_icon("Tools")
search_file_button.icon = editor_theme.get_icon("Load")
zoom_button.icon = editor_theme.get_icon("Zoom")
# Setters and Getters
func set_texture_size(value : Vector2) -> void:
texture_size = value
# Signal Callbacks
func _on_FileDialog_file_selected(path) -> void:
load_texture(path)
func _on_SearchFileButton_pressed() -> void:
file_dialog.popup_centered_ratio(.5)
func _on_SettingsButton_toggled(button_pressed : bool) -> void:
settings_menu.visible = button_pressed
func _on_SettingsMenu_settings_changed(settings : Dictionary) -> void:
spritesheet_view.load_settings(settings)
func _on_SpritesheetInspector_zoom_changed(new_zoom : int) -> void:
_zoom_update = true
zoom_button.text = "%d X" % new_zoom
zoom_slider.value = new_zoom
_zoom_update = false
func _on_ZoomButton_pressed() -> void:
zoom_slider.value = 1
func _on_ZoomSlider_value_changed(value : float) -> void:
if not _zoom_update:
spritesheet_view.zoom = round(value)

View File

@ -0,0 +1,255 @@
[gd_scene load_steps=14 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/ColorMenuItem.tscn" type="PackedScene" id=1]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetView.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/SettingsMenu.gd" type="Script" id=3]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetInspector.gd" type="Script" id=4]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_hover.png" type="Texture" id=5]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_normal.png" type="Texture" id=6]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_pressed.png" type="Texture" id=7]
[sub_resource type="Image" id=7]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 224, 224, 224, 0, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 221, 221, 221, 60, 224, 224, 224, 255, 221, 221, 221, 60, 221, 221, 221, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 112, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 112, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 189, 224, 224, 224, 255, 223, 223, 223, 189, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 122, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 223, 223, 223, 122, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 190, 224, 224, 224, 255, 222, 222, 222, 190, 222, 222, 222, 0, 223, 223, 223, 0, 223, 223, 223, 212, 224, 224, 224, 255, 223, 223, 223, 0, 223, 223, 223, 0, 224, 224, 224, 255, 223, 223, 223, 211, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 221, 221, 221, 61, 224, 224, 224, 255, 221, 221, 221, 61, 221, 221, 221, 0, 223, 223, 223, 0, 223, 223, 223, 212, 224, 224, 224, 255, 222, 222, 222, 70, 222, 222, 222, 70, 224, 224, 224, 255, 223, 223, 223, 212, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 224, 224, 224, 255, 222, 222, 222, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 122, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 122, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 114, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 113, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 247, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 222, 222, 222, 247, 222, 222, 222, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 185, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 185, 223, 223, 223, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 221, 221, 221, 30, 222, 222, 222, 181, 223, 223, 223, 254, 222, 222, 222, 181, 221, 221, 221, 30, 221, 221, 221, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 180, 223, 223, 223, 180, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 222, 222, 222, 0, 223, 223, 223, 0, 222, 222, 222, 0, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=2]
flags = 0
flags = 0
image = SubResource( 7 )
size = Vector2( 16, 16 )
[sub_resource type="Image" id=8]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 0, 223, 223, 223, 0, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 221, 221, 221, 60, 223, 223, 223, 201, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 201, 221, 221, 221, 60, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 199, 222, 222, 222, 70, 223, 223, 223, 0, 223, 223, 223, 0, 222, 222, 222, 70, 222, 222, 222, 199, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 223, 223, 223, 180, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 180, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 0, 222, 222, 222, 0, 0, 0, 0, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 0, 0, 0, 0, 217, 217, 217, 0, 222, 222, 222, 173, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 222, 222, 222, 173, 222, 222, 222, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 212, 212, 212, 0, 212, 212, 212, 18, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 232, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 221, 221, 221, 0, 221, 221, 221, 60, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 188, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 222, 222, 222, 0, 222, 222, 222, 103, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 147, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 223, 223, 223, 0, 223, 223, 223, 145, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 104, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 255, 224, 224, 224, 0, 223, 223, 223, 0, 223, 223, 223, 187, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 222, 222, 222, 62, 222, 222, 222, 0, 224, 224, 224, 0, 224, 224, 224, 255, 223, 223, 223, 0, 222, 222, 222, 0, 223, 223, 223, 230, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 214, 214, 214, 19, 214, 214, 214, 0, 223, 223, 223, 0, 223, 223, 223, 200, 222, 222, 222, 70, 221, 221, 221, 75, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 223, 223, 223, 193, 218, 218, 218, 0, 0, 0, 0, 0, 221, 221, 221, 0, 221, 221, 221, 60, 223, 223, 223, 202, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 224, 224, 224, 255, 222, 222, 222, 198, 220, 220, 220, 51, 220, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0, 221, 221, 221, 0, 223, 223, 223, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 224, 224, 224, 0, 222, 222, 222, 0, 220, 220, 220, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=4]
flags = 0
flags = 0
image = SubResource( 8 )
size = Vector2( 16, 16 )
[sub_resource type="Image" id=9]
data = {
"data": PoolByteArray( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 221, 221, 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 223, 223, 223, 57, 223, 223, 223, 177, 223, 223, 223, 228, 223, 223, 223, 234, 223, 223, 223, 185, 221, 221, 221, 61, 221, 221, 221, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 118, 223, 223, 223, 253, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 222, 222, 222, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 56, 223, 223, 223, 251, 222, 222, 222, 247, 222, 222, 222, 116, 223, 223, 223, 24, 220, 220, 220, 22, 223, 223, 223, 115, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 222, 222, 222, 0, 222, 222, 222, 174, 223, 223, 223, 254, 222, 222, 222, 116, 222, 222, 222, 0, 223, 223, 223, 0, 220, 220, 220, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 224, 223, 223, 223, 254, 223, 223, 223, 24, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 229, 223, 223, 223, 254, 214, 214, 214, 19, 214, 214, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 24, 223, 223, 223, 254, 223, 223, 223, 0, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 179, 223, 223, 223, 254, 223, 223, 223, 115, 222, 222, 222, 0, 223, 223, 223, 0, 223, 223, 223, 0, 222, 222, 222, 0, 222, 222, 222, 116, 223, 223, 223, 254, 222, 222, 222, 0, 223, 223, 223, 0, 223, 223, 223, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 223, 223, 223, 0, 223, 223, 223, 57, 223, 223, 223, 252, 223, 223, 223, 246, 222, 222, 222, 116, 223, 223, 223, 24, 223, 223, 223, 24, 222, 222, 222, 116, 223, 223, 223, 246, 223, 223, 223, 254, 222, 222, 222, 86, 218, 218, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 222, 222, 222, 0, 222, 222, 222, 118, 223, 223, 223, 253, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 254, 223, 223, 223, 209, 214, 214, 214, 19, 214, 214, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 220, 220, 220, 0, 219, 219, 219, 58, 223, 223, 223, 177, 223, 223, 223, 228, 223, 223, 223, 237, 222, 222, 222, 183, 223, 223, 223, 80, 223, 223, 223, 209, 223, 223, 223, 254, 223, 223, 223, 208, 214, 214, 214, 19, 214, 214, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 219, 219, 0, 223, 223, 223, 0, 223, 223, 223, 0, 223, 223, 223, 0, 222, 222, 222, 0, 220, 220, 220, 0, 218, 218, 218, 21, 223, 223, 223, 209, 223, 223, 223, 254, 222, 222, 222, 207, 214, 214, 214, 19, 214, 214, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 218, 218, 0, 218, 218, 218, 21, 223, 223, 223, 210, 223, 223, 223, 254, 222, 222, 222, 206, 214, 214, 214, 19, 214, 214, 214, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 218, 218, 0, 218, 218, 218, 21, 223, 223, 223, 211, 223, 223, 223, 228, 219, 219, 219, 36, 219, 219, 219, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 218, 218, 0, 218, 218, 218, 21, 218, 218, 218, 35, 218, 218, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 218, 218, 218, 0, 218, 218, 218, 0, 0, 0, 0, 0, 0, 0, 0, 0 ),
"format": "RGBA8",
"height": 16,
"mipmaps": false,
"width": 16
}
[sub_resource type="ImageTexture" id=6]
flags = 0
flags = 0
image = SubResource( 9 )
size = Vector2( 16, 16 )
[node name="SpritesheetInspector" type="VBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Header" type="HBoxContainer" parent="."]
margin_right = 1024.0
margin_bottom = 24.0
[node name="Filename" type="Label" parent="Header"]
margin_top = 5.0
margin_bottom = 19.0
[node name="Buttons" type="HBoxContainer" parent="Header"]
margin_left = 942.0
margin_right = 1024.0
margin_bottom = 24.0
size_flags_horizontal = 10
[node name="SettingsButton" type="ToolButton" parent="Header/Buttons"]
margin_right = 82.0
margin_bottom = 24.0
hint_tooltip = "Spritesheet Inspector's settings"
toggle_mode = true
text = "Settings"
icon = SubResource( 2 )
[node name="Body" type="HBoxContainer" parent="."]
margin_top = 28.0
margin_right = 1024.0
margin_bottom = 600.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="MainView" type="MarginContainer" parent="Body"]
margin_right = 1024.0
margin_bottom = 572.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="WarningView" type="VBoxContainer" parent="Body/MainView"]
margin_left = 415.0
margin_top = 230.0
margin_right = 608.0
margin_bottom = 341.0
size_flags_horizontal = 6
size_flags_vertical = 6
custom_constants/separation = 16
[node name="GodotButton" type="TextureButton" parent="Body/MainView/WarningView"]
margin_left = 64.0
margin_right = 128.0
margin_bottom = 64.0
rect_min_size = Vector2( 64, 64 )
hint_tooltip = "Hello!"
focus_mode = 0
mouse_default_cursor_shape = 2
size_flags_horizontal = 4
size_flags_vertical = 4
shortcut_in_tooltip = false
enabled_focus_mode = 0
texture_normal = ExtResource( 6 )
texture_pressed = ExtResource( 7 )
texture_hover = ExtResource( 5 )
expand = true
[node name="WarningMessage" type="Label" parent="Body/MainView/WarningView"]
margin_top = 80.0
margin_right = 193.0
margin_bottom = 111.0
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Import a Aseprite JSON file to
preview the spritesheet"
align = 1
valign = 1
[node name="SearchFileButton" type="Button" parent="Body/MainView/WarningView"]
visible = false
margin_left = 47.0
margin_top = 127.0
margin_right = 146.0
margin_bottom = 149.0
hint_tooltip = "Search for the spritesheet file"
size_flags_horizontal = 4
size_flags_vertical = 0
text = "Search File"
icon = SubResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SpritesheetView" parent="Body/MainView" instance=ExtResource( 2 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 1024.0
margin_bottom = 572.0
[node name="SettingsMenu" type="ScrollContainer" parent="Body"]
visible = false
margin_left = 882.0
margin_right = 1024.0
margin_bottom = 572.0
size_flags_horizontal = 8
size_flags_vertical = 3
follow_focus = true
scroll_horizontal_enabled = false
script = ExtResource( 3 )
[node name="Options" type="VBoxContainer" parent="Body/SettingsMenu"]
margin_right = 142.0
margin_bottom = 196.0
[node name="FrameBorder" parent="Body/SettingsMenu/Options" instance=ExtResource( 1 )]
margin_right = 142.0
label_text = "Frame Border"
visibility = true
show_visibility_button = true
color_value = Color( 0.501961, 0.501961, 0.501961, 1 )
color_edit_alpha = false
color_picker_tooltip = "Change the border color of unselected frames"
[node name="SelectionBorder" parent="Body/SettingsMenu/Options" instance=ExtResource( 1 )]
margin_top = 50.0
margin_right = 142.0
margin_bottom = 96.0
label_text = "Selection Border"
visibility = true
show_visibility_button = true
color_value = Color( 1, 1, 0, 1 )
color_edit_alpha = false
color_picker_tooltip = "Change the border color of selected frames"
[node name="TextureBackground" parent="Body/SettingsMenu/Options" instance=ExtResource( 1 )]
margin_top = 100.0
margin_right = 142.0
margin_bottom = 146.0
label_text = "Texture Background"
visibility = true
show_visibility_button = true
color_value = Color( 0.25098, 0.25098, 0.25098, 1 )
color_edit_alpha = false
color_picker_tooltip = "Change the background color of the spritesheet's transparent area "
[node name="InspectorBackground" parent="Body/SettingsMenu/Options" instance=ExtResource( 1 )]
margin_top = 150.0
margin_right = 142.0
margin_bottom = 196.0
label_text = "Inspector Background"
visibility = false
show_visibility_button = false
color_value = Color( 0, 0, 0, 1 )
color_edit_alpha = false
color_picker_tooltip = "Change the background color of the inspector"
[node name="Footer" type="HBoxContainer" parent="."]
visible = false
margin_top = 218.0
margin_right = 400.0
margin_bottom = 240.0
[node name="FrameCount" type="Label" parent="Footer"]
margin_top = 4.0
margin_bottom = 18.0
[node name="ZoomButton" type="ToolButton" parent="Footer"]
margin_left = 273.0
margin_right = 300.0
margin_bottom = 22.0
size_flags_horizontal = 10
text = "1 X"
icon = SubResource( 6 )
[node name="ZoomSlider" type="HSlider" parent="Footer"]
margin_left = 304.0
margin_top = 3.0
margin_right = 400.0
margin_bottom = 19.0
rect_min_size = Vector2( 96, 0 )
size_flags_horizontal = 8
size_flags_vertical = 6
min_value = 1.0
max_value = 8.0
value = 1.0
[node name="FileDialog" type="FileDialog" parent="."]
margin_left = 186.0
margin_right = 402.0
margin_bottom = 240.0
window_title = "Select the Spritesheet"
resizable = true
mode_overrides_title = false
mode = 0
filters = PoolStringArray( "*.png ; PNG Files" )
show_hidden_files = true

View File

@ -0,0 +1,315 @@
tool
extends Container
onready var h_scroll_bar : HScrollBar = $HScrollBar
onready var v_scroll_bar : VScrollBar = $VScrollBar
export(Texture) var texture : Texture setget set_texture
export(int, 1, 8) var zoom := 1 setget set_zoom
export(Vector2) var offset := Vector2.ZERO setget set_offset
export(bool)var zoom_to_fit := true
var frames = []
var selected_frames := [] setget set_selected_frames
var frame_border_color := Color.red
var frame_border_visibility := true
var selection_border_color := Color.yellow
var selection_border_visibility := true
var border_width := 2
var texture_background_color := Color.green
var texture_background_visibility := true
var background_color := Color.blue
var _full_rect := Rect2(Vector2.ZERO, rect_size)
var _render_rect : Rect2
var _texture_size : Vector2
var _min_offset : Vector2
var _max_offset : Vector2
var _zoom_pivot : Vector2
var _updating_scroll_bars := false
var _panning := false
signal zoom_changed(new_zoom)
func _ready() -> void:
h_scroll_bar.value = .5
v_scroll_bar.value = .5
connect("resized", self, "_on_resized")
h_scroll_bar.connect("value_changed", self, "_on_HScrollBar_value_changed")
v_scroll_bar.connect("value_changed", self, "_on_VScrollBar_value_changed")
update()
func _draw() -> void:
draw_rect(_full_rect, background_color)
if not texture:
return
if texture_background_visibility:
draw_rect(_render_rect, texture_background_color)
draw_texture_rect(texture, _render_rect, false)
if frame_border_visibility:
for frame_idx in range(frames.size()):
if (not selection_border_visibility) or (not frame_idx in selected_frames):
_draw_frame_border(frame_idx)
if selection_border_visibility:
for frame_idx in selected_frames:
_draw_frame_border(frame_idx, true)
func _draw_frame_border(frame_idx : int, selected := false) -> void:
var sprite_region = frames[frame_idx].frame
var frame_rect := _render_rect
frame_rect.position += Vector2(sprite_region.x, sprite_region.y) * zoom
frame_rect.size = Vector2(sprite_region.w, sprite_region.h) * zoom
var border_color
if frame_idx in selected_frames:
border_color = selection_border_color
else:
border_color = frame_border_color
draw_rect(frame_rect, border_color, false, border_width)
func _gui_input(event: InputEvent) -> void:
if event is InputEventMouseButton:
match event.button_index:
BUTTON_MIDDLE:
_panning = event.pressed
if _panning:
mouse_default_cursor_shape = CURSOR_DRAG
else:
mouse_default_cursor_shape = CURSOR_ARROW
BUTTON_WHEEL_UP, BUTTON_WHEEL_DOWN:
if event.pressed:
_zoom_pivot = get_local_mouse_position()
if event.button_index == BUTTON_WHEEL_UP:
self.zoom += 1
else:
self.zoom -= 1
_zoom_pivot = _full_rect.size / 2
elif event is InputEventMouseMotion:
if _panning:
self.offset += event.relative
func load_settings(settings : Dictionary) -> void:
frame_border_color = settings.frame_border.color
frame_border_visibility = settings.frame_border.visibility
selection_border_color = settings.selection_border.color
selection_border_visibility = settings.selection_border.visibility
texture_background_color = settings.texture_background.color
texture_background_visibility = settings.texture_background.visibility
background_color = settings.inspector_background.color
update()
func _update_offset_limits() -> void:
var full_rect_width := _full_rect.size.x
var render_rect_width := _render_rect.size.x
if render_rect_width <= full_rect_width:
_min_offset.x = 0
_max_offset.x = full_rect_width - render_rect_width
else:
_min_offset.x = -(render_rect_width - full_rect_width)
_max_offset.x = 0
var full_rect_height := _full_rect.size.y
var render_rect_height := _render_rect.size.y
if render_rect_height <= full_rect_height:
_min_offset.y = 0
_max_offset.y = full_rect_height - render_rect_height
else:
_min_offset.y = -(render_rect_height - full_rect_height)
_max_offset.y = 0
func _update_scrollbars() ->void:
_updating_scroll_bars = true
if h_scroll_bar:
var full_width:= _full_rect.size.x
var render_width:= _render_rect.size.x
if render_width > full_width:
var h_page := full_width / render_width
h_scroll_bar.page = h_page
h_scroll_bar.max_value = 1 + h_page
var value := inverse_lerp(_max_offset.x, _min_offset.x, offset.x)
h_scroll_bar.value = value
h_scroll_bar.show()
else:
h_scroll_bar.hide()
if v_scroll_bar:
var full_height:= _full_rect.size.y
var render_height:= _render_rect.size.y
if render_height > full_height:
var v_page := full_height / render_height
v_scroll_bar.page = v_page
v_scroll_bar.max_value = 1 + v_page
var value := inverse_lerp(_max_offset.y, _min_offset.y, offset.y)
v_scroll_bar.value = value
v_scroll_bar.show()
else:
v_scroll_bar.hide()
_updating_scroll_bars = false
# Setters and Getters
func set_offset(new_offset : Vector2) -> void:
new_offset.x = clamp(new_offset.x, _min_offset.x, _max_offset.x)
new_offset.y = clamp(new_offset.y, _min_offset.y, _max_offset.y)
if new_offset == offset:
return
offset = new_offset
_render_rect.position = offset
if not _updating_scroll_bars:
_update_scrollbars()
update()
func set_selected_frames(selection : Array) -> void:
selected_frames = selection
update()
func set_texture(new_texture) -> void:
texture = new_texture
if texture == null:
return
_texture_size = texture.get_size()
var full_rect_size := _full_rect.size
if zoom_to_fit:
var ratio : Vector2
ratio.x = floor(full_rect_size.x / _texture_size.x)
ratio.y = floor(full_rect_size.y / _texture_size.y)
self.zoom = min(ratio.x, ratio.y)
else:
self.zoom = 1
_update_offset_limits()
self.offset = (_max_offset - _min_offset) / 2
func set_zoom(new_zoom : int) -> void:
zoom = clamp(new_zoom, 1, 8)
var new_render_rect_size := _texture_size * zoom
var relative_pivot := _zoom_pivot - offset
var pivot_weight : Vector2
if _render_rect.size.x and _render_rect.size.y:
pivot_weight.x = relative_pivot.x / _render_rect.size.x
pivot_weight.y = relative_pivot.y / _render_rect.size.y
var render_rect_size_diff := new_render_rect_size - _render_rect.size
var offset_diff := render_rect_size_diff * pivot_weight
_render_rect.size = new_render_rect_size
_update_offset_limits()
_update_scrollbars()
self.offset = offset - offset_diff
emit_signal("zoom_changed", zoom)
# Signal Callbacks
func _on_resized() -> void:
_full_rect.size = rect_size
_zoom_pivot = _full_rect.size / 2
_update_offset_limits()
_update_scrollbars()
self.offset = offset
var rect := Rect2()
rect.position.x = 0
rect.position.y = (rect_size.y - h_scroll_bar.rect_size.y)
rect.size.x = (rect_size.x - v_scroll_bar.rect_size.x)
rect.size.y = h_scroll_bar.rect_size.y
fit_child_in_rect(h_scroll_bar, rect)
rect.position.x = (rect_size.x - v_scroll_bar.rect_size.x)
rect.position.y = 0
rect.size.x = v_scroll_bar.rect_size.x
rect.size.y = (rect_size.y - h_scroll_bar.rect_size.y)
fit_child_in_rect(v_scroll_bar, rect)
func _on_HScrollBar_value_changed(value : float) -> void:
if _updating_scroll_bars:
return
_updating_scroll_bars = true
self.offset.x = lerp(_max_offset.x, _min_offset.x, value)
_updating_scroll_bars = false
func _on_VScrollBar_value_changed(value : float) -> void:
if _updating_scroll_bars:
return
_updating_scroll_bars = true
self.offset.y = lerp(_max_offset.y, _min_offset.y, value)
_updating_scroll_bars = false

View File

@ -0,0 +1,48 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://addons/aseprite_importer/interface/spritesheet_inspector/SpritesheetView.gd" type="Script" id=2]
[sub_resource type="StyleBoxFlat" id=1]
content_margin_left = 4.0
content_margin_right = 4.0
content_margin_top = 4.0
content_margin_bottom = 4.0
bg_color = Color( 0.135, 0.165, 0.1875, 1 )
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color( 0.09, 0.11, 0.125, 1 )
[sub_resource type="Theme" id=2]
PanelContainer/styles/panel = SubResource( 1 )
[node name="SpritesheetView" type="Container"]
anchor_right = 1.0
anchor_bottom = 1.0
rect_clip_content = true
theme = SubResource( 2 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VScrollBar" type="VScrollBar" parent="."]
visible = false
margin_left = 1012.0
margin_right = 1024.0
margin_bottom = 588.0
grow_horizontal = 0
size_flags_horizontal = 8
max_value = 1.0
value = 0.5
[node name="HScrollBar" type="HScrollBar" parent="."]
visible = false
margin_top = 588.0
margin_right = 1012.0
margin_bottom = 600.0
grow_vertical = 0
size_flags_vertical = 8
max_value = 1.0
value = 0.5

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/godot_hover.png-8e29b7be0f1894279e875fca20fa84b6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_hover.png"
dest_files=[ "res://.import/godot_hover.png-8e29b7be0f1894279e875fca20fa84b6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/godot_normal.png-613381b9981510c0a02d47bcdc1f01b6.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_normal.png"
dest_files=[ "res://.import/godot_normal.png-613381b9981510c0a02d47bcdc1f01b6.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/godot_pressed.png-f3e404333788353a928368f9f57f22c1.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://addons/aseprite_importer/interface/spritesheet_inspector/godot_button/godot_pressed.png"
dest_files=[ "res://.import/godot_pressed.png-f3e404333788353a928368f9f57f22c1.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -0,0 +1,7 @@
[plugin]
name="Aseprite Importer"
description="Use the JSON data generated by Aseprite to import animations"
author="hectorid"
version="1.0.1"
script="plugin.gd"

View File

@ -0,0 +1,101 @@
tool
extends EditorPlugin
const INTERFACE_SCN = preload("interface/Main.tscn")
const DARK_ICON = preload("interface/icons/dark_icon.png")
const LIGHT_ICON = preload("interface/icons/light_icon.png")
var interface : Control
var editor_interface := get_editor_interface()
var editor_base_control := editor_interface.get_base_control()
var editor_settings := editor_interface.get_editor_settings()
var editor_viewport := editor_interface.get_editor_viewport()
var _state_set := false
func _enter_tree() -> void:
interface = INTERFACE_SCN.instance()
interface.connect("ready", self, "_on_interface_ready", [], CONNECT_ONESHOT)
editor_viewport.add_child(interface)
make_visible(false)
connect("scene_changed", self, "_on_scene_changed")
editor_settings.connect("settings_changed", self, "_on_settings_changed")
interface.connect("animations_generated", self, "_on_animations_generated")
func _exit_tree() -> void:
if interface:
interface.queue_free()
func has_main_screen():
return true
func make_visible(visible: bool) -> void:
if interface:
if visible:
interface.show()
else:
interface.hide()
func get_plugin_name():
return "Aseprite Importer"
func get_plugin_icon():
var editor_theme := editor_base_control.theme
if editor_theme.get_constant("dark_theme", "Editor"):
return LIGHT_ICON;
return DARK_ICON;
func get_state() -> Dictionary:
return interface.get_state()
func set_state(state: Dictionary) -> void:
interface.set_state(state)
_state_set = true
func _update_theme() -> void:
var editor_theme := EditorTheme.new(editor_base_control.theme)
interface.propagate_call("_update_theme", [editor_theme])
# Signal Callbacks
func _on_animations_generated(animation_player : AnimationPlayer) -> void:
var editor_selection := get_editor_interface().get_selection()
editor_selection.clear()
# Reselect the AnimationPlayer node to show the new animations
editor_selection.add_node(animation_player)
func _on_interface_ready() -> void:
_update_theme()
func _on_scene_changed(scene_root : Node) -> void:
if _state_set == false:
interface.set_state({})
_state_set = false
func _on_settings_changed() -> void:
yield(editor_base_control, "draw")
_update_theme()

7
default_env.tres Normal file
View File

@ -0,0 +1,7 @@
[gd_resource type="Environment" load_steps=2 format=2]
[sub_resource type="ProceduralSky" id=1]
[resource]
background_mode = 2
background_sky = SubResource( 1 )

8
dialogues/intro_1.json Normal file
View File

@ -0,0 +1,8 @@
[
{"name": "Ely", "text": "Heyo!", "expression": "neutral"},
{"name": "Ely", "text": "My name Ely", "expression": "neutral"},
{"name": "Ely", "text": "I do fun stuff", "expression": "neutral"},
{"name": "Ely", "text": "It is very fun", "expression": "neutral"},
{"name": "Crab", "text": "Also that's a very good dialogue with a very very long text", "expression": "neutral"},
{"name": "Crab", "text": "lorem ipsum dolor sit amet truc machin bidule lorem ipsum dolor sit amet truc machin bidule lorem ipsum dolor sit amet truc machin bidule", "expression": "neutral"}
]

BIN
fonts/EnterCommand-Bold.ttf Normal file

Binary file not shown.

Binary file not shown.

BIN
fonts/EnterCommand.ttf Normal file

Binary file not shown.

View File

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://fonts/EnterCommand.ttf" type="DynamicFontData" id=1]
[resource]
outline_color = Color( 0, 0, 0, 1 )
font_data = ExtResource( 1 )

BIN
icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

34
icon.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.png"
dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/Ely_Sitting.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/Ely_Sitting.png-39616a9d9ea3b9546cffc07c3c71bc76.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/Ely_Sitting.png"
dest_files=[ "res://.import/Ely_Sitting.png-39616a9d9ea3b9546cffc07c3c71bc76.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/campfire.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/campfire.png-5de4f9958a33ecb37437cf2893db9524.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/campfire.png"
dest_files=[ "res://.import/campfire.png-5de4f9958a33ecb37437cf2893db9524.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

107
images/campfire.tres Normal file
View File

@ -0,0 +1,107 @@
[gd_resource type="SpriteFrames" load_steps=26 format=2]
[ext_resource path="res://images/campfire.png" type="Texture" id=1]
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 1 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 1 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 1 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 1 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 1 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 1 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 1 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 1 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 1 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 1 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 1 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 1 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 1 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 1 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 1 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 1 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 1 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 1 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 1 )
region = Rect2( 576, 540, 192, 108 )
[resource]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]

555
images/ely.tres Normal file
View File

@ -0,0 +1,555 @@
[gd_resource type="SpriteFrames" load_steps=138 format=2]
[ext_resource path="res://images/Ely_Sitting.png" type="Texture" id=1]
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 1 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 1 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 1 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 1 )
region = Rect2( 768, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 1 )
region = Rect2( 960, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 1 )
region = Rect2( 1152, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 1 )
region = Rect2( 1344, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 1 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 1 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 1 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 1 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 1 )
region = Rect2( 768, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 1 )
region = Rect2( 960, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 1 )
region = Rect2( 1152, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 1 )
region = Rect2( 1344, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 1 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 1 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 1 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 1 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 1 )
region = Rect2( 768, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 1 )
region = Rect2( 960, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 1 )
region = Rect2( 1152, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 1 )
region = Rect2( 1344, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 1 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 1 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=27]
atlas = ExtResource( 1 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=28]
atlas = ExtResource( 1 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=29]
atlas = ExtResource( 1 )
region = Rect2( 768, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=30]
atlas = ExtResource( 1 )
region = Rect2( 960, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=31]
atlas = ExtResource( 1 )
region = Rect2( 1152, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 1 )
region = Rect2( 1344, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=33]
atlas = ExtResource( 1 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 1 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 1 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=36]
atlas = ExtResource( 1 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=37]
atlas = ExtResource( 1 )
region = Rect2( 768, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 1 )
region = Rect2( 960, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 1 )
region = Rect2( 1152, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 1 )
region = Rect2( 1344, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 1 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 1 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=43]
atlas = ExtResource( 1 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=44]
atlas = ExtResource( 1 )
region = Rect2( 576, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=45]
atlas = ExtResource( 1 )
region = Rect2( 768, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=46]
atlas = ExtResource( 1 )
region = Rect2( 960, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=47]
atlas = ExtResource( 1 )
region = Rect2( 1152, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=48]
atlas = ExtResource( 1 )
region = Rect2( 1344, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=49]
atlas = ExtResource( 1 )
region = Rect2( 0, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=50]
atlas = ExtResource( 1 )
region = Rect2( 192, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=51]
atlas = ExtResource( 1 )
region = Rect2( 384, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=52]
atlas = ExtResource( 1 )
region = Rect2( 576, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=53]
atlas = ExtResource( 1 )
region = Rect2( 768, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=54]
atlas = ExtResource( 1 )
region = Rect2( 960, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=55]
atlas = ExtResource( 1 )
region = Rect2( 1152, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=56]
atlas = ExtResource( 1 )
region = Rect2( 1344, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=57]
atlas = ExtResource( 1 )
region = Rect2( 0, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 1 )
region = Rect2( 192, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 1 )
region = Rect2( 384, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 1 )
region = Rect2( 576, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=61]
atlas = ExtResource( 1 )
region = Rect2( 768, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=62]
atlas = ExtResource( 1 )
region = Rect2( 960, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=63]
atlas = ExtResource( 1 )
region = Rect2( 1152, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=64]
atlas = ExtResource( 1 )
region = Rect2( 1344, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=65]
atlas = ExtResource( 1 )
region = Rect2( 0, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=66]
atlas = ExtResource( 1 )
region = Rect2( 192, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=67]
atlas = ExtResource( 1 )
region = Rect2( 384, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=68]
atlas = ExtResource( 1 )
region = Rect2( 576, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=69]
atlas = ExtResource( 1 )
region = Rect2( 768, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=70]
atlas = ExtResource( 1 )
region = Rect2( 960, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=71]
atlas = ExtResource( 1 )
region = Rect2( 1152, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=72]
atlas = ExtResource( 1 )
region = Rect2( 1344, 864, 192, 108 )
[sub_resource type="AtlasTexture" id=73]
atlas = ExtResource( 1 )
region = Rect2( 0, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=74]
atlas = ExtResource( 1 )
region = Rect2( 192, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=75]
atlas = ExtResource( 1 )
region = Rect2( 384, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=76]
atlas = ExtResource( 1 )
region = Rect2( 576, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=77]
atlas = ExtResource( 1 )
region = Rect2( 768, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=78]
atlas = ExtResource( 1 )
region = Rect2( 960, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=79]
atlas = ExtResource( 1 )
region = Rect2( 1152, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=80]
atlas = ExtResource( 1 )
region = Rect2( 1344, 972, 192, 108 )
[sub_resource type="AtlasTexture" id=81]
atlas = ExtResource( 1 )
region = Rect2( 0, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=82]
atlas = ExtResource( 1 )
region = Rect2( 192, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=83]
atlas = ExtResource( 1 )
region = Rect2( 384, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=84]
atlas = ExtResource( 1 )
region = Rect2( 576, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=85]
atlas = ExtResource( 1 )
region = Rect2( 768, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=86]
atlas = ExtResource( 1 )
region = Rect2( 960, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=87]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=88]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1080, 192, 108 )
[sub_resource type="AtlasTexture" id=89]
atlas = ExtResource( 1 )
region = Rect2( 0, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=90]
atlas = ExtResource( 1 )
region = Rect2( 192, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=91]
atlas = ExtResource( 1 )
region = Rect2( 384, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=92]
atlas = ExtResource( 1 )
region = Rect2( 576, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=93]
atlas = ExtResource( 1 )
region = Rect2( 768, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=94]
atlas = ExtResource( 1 )
region = Rect2( 960, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=95]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=96]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1188, 192, 108 )
[sub_resource type="AtlasTexture" id=97]
atlas = ExtResource( 1 )
region = Rect2( 0, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=98]
atlas = ExtResource( 1 )
region = Rect2( 192, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=99]
atlas = ExtResource( 1 )
region = Rect2( 384, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=100]
atlas = ExtResource( 1 )
region = Rect2( 576, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=101]
atlas = ExtResource( 1 )
region = Rect2( 768, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=102]
atlas = ExtResource( 1 )
region = Rect2( 960, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=103]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=104]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1296, 192, 108 )
[sub_resource type="AtlasTexture" id=105]
atlas = ExtResource( 1 )
region = Rect2( 0, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=106]
atlas = ExtResource( 1 )
region = Rect2( 192, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=107]
atlas = ExtResource( 1 )
region = Rect2( 384, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=108]
atlas = ExtResource( 1 )
region = Rect2( 576, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=109]
atlas = ExtResource( 1 )
region = Rect2( 768, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=110]
atlas = ExtResource( 1 )
region = Rect2( 960, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=111]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=112]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1404, 192, 108 )
[sub_resource type="AtlasTexture" id=113]
atlas = ExtResource( 1 )
region = Rect2( 0, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=114]
atlas = ExtResource( 1 )
region = Rect2( 192, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=115]
atlas = ExtResource( 1 )
region = Rect2( 384, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=116]
atlas = ExtResource( 1 )
region = Rect2( 576, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=117]
atlas = ExtResource( 1 )
region = Rect2( 768, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=118]
atlas = ExtResource( 1 )
region = Rect2( 960, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=119]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=120]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1512, 192, 108 )
[sub_resource type="AtlasTexture" id=121]
atlas = ExtResource( 1 )
region = Rect2( 0, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=122]
atlas = ExtResource( 1 )
region = Rect2( 192, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=123]
atlas = ExtResource( 1 )
region = Rect2( 384, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=124]
atlas = ExtResource( 1 )
region = Rect2( 576, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=125]
atlas = ExtResource( 1 )
region = Rect2( 768, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=126]
atlas = ExtResource( 1 )
region = Rect2( 960, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=127]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=128]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1620, 192, 108 )
[sub_resource type="AtlasTexture" id=129]
atlas = ExtResource( 1 )
region = Rect2( 0, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=130]
atlas = ExtResource( 1 )
region = Rect2( 192, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=131]
atlas = ExtResource( 1 )
region = Rect2( 384, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=132]
atlas = ExtResource( 1 )
region = Rect2( 576, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=133]
atlas = ExtResource( 1 )
region = Rect2( 768, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=134]
atlas = ExtResource( 1 )
region = Rect2( 960, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=135]
atlas = ExtResource( 1 )
region = Rect2( 1152, 1728, 192, 108 )
[sub_resource type="AtlasTexture" id=136]
atlas = ExtResource( 1 )
region = Rect2( 1344, 1728, 192, 108 )
[resource]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ), SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ), SubResource( 63 ), SubResource( 64 ), SubResource( 65 ), SubResource( 66 ), SubResource( 67 ), SubResource( 68 ), SubResource( 69 ), SubResource( 70 ), SubResource( 71 ), SubResource( 72 ), SubResource( 73 ), SubResource( 74 ), SubResource( 75 ), SubResource( 76 ), SubResource( 77 ), SubResource( 78 ), SubResource( 79 ), SubResource( 80 ), SubResource( 81 ), SubResource( 82 ), SubResource( 83 ), SubResource( 84 ), SubResource( 85 ), SubResource( 86 ), SubResource( 87 ), SubResource( 88 ), SubResource( 89 ), SubResource( 90 ), SubResource( 91 ), SubResource( 92 ), SubResource( 93 ), SubResource( 94 ), SubResource( 95 ), SubResource( 96 ), SubResource( 97 ), SubResource( 98 ), SubResource( 99 ), SubResource( 100 ), SubResource( 101 ), SubResource( 102 ), SubResource( 103 ), SubResource( 104 ), SubResource( 105 ), SubResource( 106 ), SubResource( 107 ), SubResource( 108 ), SubResource( 109 ), SubResource( 110 ), SubResource( 111 ), SubResource( 112 ), SubResource( 113 ), SubResource( 114 ), SubResource( 115 ), SubResource( 116 ), SubResource( 117 ), SubResource( 118 ), SubResource( 119 ), SubResource( 120 ), SubResource( 121 ), SubResource( 122 ), SubResource( 123 ), SubResource( 124 ), SubResource( 125 ), SubResource( 126 ), SubResource( 127 ), SubResource( 128 ), SubResource( 129 ), SubResource( 130 ), SubResource( 131 ), SubResource( 132 ), SubResource( 133 ), SubResource( 134 ), SubResource( 135 ), SubResource( 136 ) ],
"loop": true,
"name": "default",
"speed": 10.0
} ]

BIN
images/herbert_Eyes.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/herbert_Eyes.png-13f7f1841e84103b892adc7b529758bc.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/herbert_Eyes.png"
dest_files=[ "res://.import/herbert_Eyes.png-13f7f1841e84103b892adc7b529758bc.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/herbert_FirstStep.png-2d3c08b8eb539fa5e4b7079ac9715f8a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/herbert_FirstStep.png"
dest_files=[ "res://.import/herbert_FirstStep.png-2d3c08b8eb539fa5e4b7079ac9715f8a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/herbert_SecondStep.png-1332d5d8cb46f9541e74db53006229b2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/herbert_SecondStep.png"
dest_files=[ "res://.import/herbert_SecondStep.png-1332d5d8cb46f9541e74db53006229b2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/menu.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

34
images/menu.png.import Normal file
View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/menu.png-09788ebfe49b6ddbddfddd3ff6e0248b.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/menu.png"
dest_files=[ "res://.import/menu.png-09788ebfe49b6ddbddfddd3ff6e0248b.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/titleCampfire_loop.png-db7ae5be507e74482c3516e1cbd076b2.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/titleCampfire_loop.png"
dest_files=[ "res://.import/titleCampfire_loop.png-db7ae5be507e74482c3516e1cbd076b2.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/titleCampfire_start.png-7211507e659c115dea4e5d92c551697a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/titleCampfire_start.png"
dest_files=[ "res://.import/titleCampfire_start.png-7211507e659c115dea4e5d92c551697a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/titleCrab.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/titleCrab.png-302b90e0c073e8efa0a90d3fe9424695.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/titleCrab.png"
dest_files=[ "res://.import/titleCrab.png-302b90e0c073e8efa0a90d3fe9424695.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=true
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/titleEly_idle.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/titleEly_idle.png-6cd3b839f2b691d8f1c7d4b5785e4faa.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/titleEly_idle.png"
dest_files=[ "res://.import/titleEly_idle.png-6cd3b839f2b691d8f1c7d4b5785e4faa.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/titleEly_start.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/titleEly_start.png-bc10accc073a81f61983a58749cc61ba.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/titleEly_start.png"
dest_files=[ "res://.import/titleEly_start.png-bc10accc073a81f61983a58749cc61ba.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

View File

@ -0,0 +1,401 @@
[gd_resource type="SpriteFrames" load_steps=99 format=2]
[ext_resource path="res://images/titleEly_start.png" type="Texture" id=1]
[ext_resource path="res://images/titleEly_idle.png" type="Texture" id=2]
[sub_resource type="AtlasTexture" id=49]
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=50]
atlas = ExtResource( 1 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=51]
atlas = ExtResource( 1 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=52]
atlas = ExtResource( 1 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=53]
atlas = ExtResource( 1 )
region = Rect2( 768, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=54]
atlas = ExtResource( 1 )
region = Rect2( 960, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=55]
atlas = ExtResource( 1 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=56]
atlas = ExtResource( 1 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=57]
atlas = ExtResource( 1 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=58]
atlas = ExtResource( 1 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=59]
atlas = ExtResource( 1 )
region = Rect2( 768, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=60]
atlas = ExtResource( 1 )
region = Rect2( 960, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=61]
atlas = ExtResource( 1 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=62]
atlas = ExtResource( 1 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=63]
atlas = ExtResource( 1 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=64]
atlas = ExtResource( 1 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=65]
atlas = ExtResource( 1 )
region = Rect2( 768, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=66]
atlas = ExtResource( 1 )
region = Rect2( 960, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=67]
atlas = ExtResource( 1 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=68]
atlas = ExtResource( 1 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=69]
atlas = ExtResource( 1 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=70]
atlas = ExtResource( 1 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=71]
atlas = ExtResource( 1 )
region = Rect2( 768, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=72]
atlas = ExtResource( 1 )
region = Rect2( 960, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=73]
atlas = ExtResource( 1 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=74]
atlas = ExtResource( 1 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=75]
atlas = ExtResource( 1 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=76]
atlas = ExtResource( 1 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=77]
atlas = ExtResource( 1 )
region = Rect2( 768, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=78]
atlas = ExtResource( 1 )
region = Rect2( 960, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=79]
atlas = ExtResource( 1 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=80]
atlas = ExtResource( 1 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=81]
atlas = ExtResource( 1 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=82]
atlas = ExtResource( 1 )
region = Rect2( 576, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=83]
atlas = ExtResource( 1 )
region = Rect2( 768, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=84]
atlas = ExtResource( 1 )
region = Rect2( 960, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=85]
atlas = ExtResource( 1 )
region = Rect2( 0, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=86]
atlas = ExtResource( 1 )
region = Rect2( 192, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=87]
atlas = ExtResource( 1 )
region = Rect2( 384, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=88]
atlas = ExtResource( 1 )
region = Rect2( 576, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=89]
atlas = ExtResource( 1 )
region = Rect2( 768, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=90]
atlas = ExtResource( 1 )
region = Rect2( 960, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=91]
atlas = ExtResource( 1 )
region = Rect2( 0, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=92]
atlas = ExtResource( 1 )
region = Rect2( 192, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=93]
atlas = ExtResource( 1 )
region = Rect2( 384, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=94]
atlas = ExtResource( 1 )
region = Rect2( 576, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=95]
atlas = ExtResource( 1 )
region = Rect2( 768, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=96]
atlas = ExtResource( 1 )
region = Rect2( 960, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=1]
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=2]
atlas = ExtResource( 2 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=3]
atlas = ExtResource( 2 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=4]
atlas = ExtResource( 2 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=5]
atlas = ExtResource( 2 )
region = Rect2( 768, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=6]
atlas = ExtResource( 2 )
region = Rect2( 960, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=7]
atlas = ExtResource( 2 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=8]
atlas = ExtResource( 2 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=9]
atlas = ExtResource( 2 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=10]
atlas = ExtResource( 2 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=11]
atlas = ExtResource( 2 )
region = Rect2( 768, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=12]
atlas = ExtResource( 2 )
region = Rect2( 960, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=13]
atlas = ExtResource( 2 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=14]
atlas = ExtResource( 2 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=15]
atlas = ExtResource( 2 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=16]
atlas = ExtResource( 2 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=17]
atlas = ExtResource( 2 )
region = Rect2( 768, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=18]
atlas = ExtResource( 2 )
region = Rect2( 960, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=19]
atlas = ExtResource( 2 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=20]
atlas = ExtResource( 2 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=21]
atlas = ExtResource( 2 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=22]
atlas = ExtResource( 2 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=23]
atlas = ExtResource( 2 )
region = Rect2( 768, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=24]
atlas = ExtResource( 2 )
region = Rect2( 960, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=25]
atlas = ExtResource( 2 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=26]
atlas = ExtResource( 2 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=27]
atlas = ExtResource( 2 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=28]
atlas = ExtResource( 2 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=29]
atlas = ExtResource( 2 )
region = Rect2( 768, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=30]
atlas = ExtResource( 2 )
region = Rect2( 960, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=31]
atlas = ExtResource( 2 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=32]
atlas = ExtResource( 2 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=33]
atlas = ExtResource( 2 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=34]
atlas = ExtResource( 2 )
region = Rect2( 576, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=35]
atlas = ExtResource( 2 )
region = Rect2( 768, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=36]
atlas = ExtResource( 2 )
region = Rect2( 960, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=37]
atlas = ExtResource( 2 )
region = Rect2( 0, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=38]
atlas = ExtResource( 2 )
region = Rect2( 192, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=39]
atlas = ExtResource( 2 )
region = Rect2( 384, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=40]
atlas = ExtResource( 2 )
region = Rect2( 576, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=41]
atlas = ExtResource( 2 )
region = Rect2( 768, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=42]
atlas = ExtResource( 2 )
region = Rect2( 960, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=43]
atlas = ExtResource( 2 )
region = Rect2( 0, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=44]
atlas = ExtResource( 2 )
region = Rect2( 192, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=45]
atlas = ExtResource( 2 )
region = Rect2( 384, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=46]
atlas = ExtResource( 2 )
region = Rect2( 576, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=47]
atlas = ExtResource( 2 )
region = Rect2( 768, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=48]
atlas = ExtResource( 2 )
region = Rect2( 960, 756, 192, 108 )
[resource]
animations = [ {
"frames": [ SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ), SubResource( 63 ), SubResource( 64 ), SubResource( 65 ), SubResource( 66 ), SubResource( 67 ), SubResource( 68 ), SubResource( 69 ), SubResource( 70 ), SubResource( 71 ), SubResource( 72 ), SubResource( 73 ), SubResource( 74 ), SubResource( 75 ), SubResource( 76 ), SubResource( 77 ), SubResource( 78 ), SubResource( 79 ), SubResource( 80 ), SubResource( 81 ), SubResource( 82 ), SubResource( 83 ), SubResource( 84 ), SubResource( 85 ), SubResource( 86 ), SubResource( 87 ), SubResource( 88 ), SubResource( 89 ), SubResource( 90 ), SubResource( 91 ), SubResource( 92 ), SubResource( 93 ), SubResource( 94 ), SubResource( 95 ), SubResource( 96 ) ],
"loop": false,
"name": "start",
"speed": 10.0
}, {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ) ],
"loop": true,
"name": "idle",
"speed": 10.0
} ]

View File

@ -0,0 +1,497 @@
[gd_resource type="SpriteFrames" load_steps=99 format=2]
[ext_resource path="res://images/titleCampfire_loop.png" type="Texture" id=1]
[ext_resource path="res://images/titleCampfire_start.png" type="Texture" id=2]
[sub_resource type="AtlasTexture" id=1]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=2]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=3]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=4]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=5]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=6]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=7]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=8]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=9]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=10]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=11]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=12]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=13]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=14]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=15]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=16]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=17]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=18]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=19]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=20]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=21]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=22]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=23]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=24]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=25]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=26]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=27]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=28]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=29]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=30]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=31]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=32]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=33]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=34]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=35]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=36]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=37]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=38]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=39]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=40]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=41]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=42]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=43]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 0, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=44]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 192, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=45]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 384, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=46]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 576, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=47]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 768, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=48]
flags = 4
atlas = ExtResource( 2 )
region = Rect2( 960, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=49]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=50]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=51]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=52]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=53]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=54]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 0, 192, 108 )
[sub_resource type="AtlasTexture" id=55]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=56]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=57]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=58]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=59]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=60]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 108, 192, 108 )
[sub_resource type="AtlasTexture" id=61]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=62]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=63]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=64]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=65]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=66]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 216, 192, 108 )
[sub_resource type="AtlasTexture" id=67]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=68]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=69]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=70]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=71]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=72]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 324, 192, 108 )
[sub_resource type="AtlasTexture" id=73]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=74]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=75]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=76]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=77]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=78]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 432, 192, 108 )
[sub_resource type="AtlasTexture" id=79]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=80]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=81]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=82]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=83]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=84]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 540, 192, 108 )
[sub_resource type="AtlasTexture" id=85]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=86]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=87]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=88]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=89]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=90]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 648, 192, 108 )
[sub_resource type="AtlasTexture" id=91]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 0, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=92]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 192, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=93]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 384, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=94]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 576, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=95]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 768, 756, 192, 108 )
[sub_resource type="AtlasTexture" id=96]
flags = 4
atlas = ExtResource( 1 )
region = Rect2( 960, 756, 192, 108 )
[resource]
animations = [ {
"frames": [ SubResource( 1 ), SubResource( 2 ), SubResource( 3 ), SubResource( 4 ), SubResource( 5 ), SubResource( 6 ), SubResource( 7 ), SubResource( 8 ), SubResource( 9 ), SubResource( 10 ), SubResource( 11 ), SubResource( 12 ), SubResource( 13 ), SubResource( 14 ), SubResource( 15 ), SubResource( 16 ), SubResource( 17 ), SubResource( 18 ), SubResource( 19 ), SubResource( 20 ), SubResource( 21 ), SubResource( 22 ), SubResource( 23 ), SubResource( 24 ), SubResource( 25 ), SubResource( 26 ), SubResource( 27 ), SubResource( 28 ), SubResource( 29 ), SubResource( 30 ), SubResource( 31 ), SubResource( 32 ), SubResource( 33 ), SubResource( 34 ), SubResource( 35 ), SubResource( 36 ), SubResource( 37 ), SubResource( 38 ), SubResource( 39 ), SubResource( 40 ), SubResource( 41 ), SubResource( 42 ), SubResource( 43 ), SubResource( 44 ), SubResource( 45 ), SubResource( 46 ), SubResource( 47 ), SubResource( 48 ) ],
"loop": true,
"name": "start",
"speed": 10.0
}, {
"frames": [ SubResource( 49 ), SubResource( 50 ), SubResource( 51 ), SubResource( 52 ), SubResource( 53 ), SubResource( 54 ), SubResource( 55 ), SubResource( 56 ), SubResource( 57 ), SubResource( 58 ), SubResource( 59 ), SubResource( 60 ), SubResource( 61 ), SubResource( 62 ), SubResource( 63 ), SubResource( 64 ), SubResource( 65 ), SubResource( 66 ), SubResource( 67 ), SubResource( 68 ), SubResource( 69 ), SubResource( 70 ), SubResource( 71 ), SubResource( 72 ), SubResource( 73 ), SubResource( 74 ), SubResource( 75 ), SubResource( 76 ), SubResource( 77 ), SubResource( 78 ), SubResource( 79 ), SubResource( 80 ), SubResource( 81 ), SubResource( 82 ), SubResource( 83 ), SubResource( 84 ), SubResource( 85 ), SubResource( 86 ), SubResource( 87 ), SubResource( 88 ), SubResource( 89 ), SubResource( 90 ), SubResource( 91 ), SubResource( 92 ), SubResource( 93 ), SubResource( 94 ), SubResource( 95 ), SubResource( 96 ) ],
"loop": true,
"name": "idle",
"speed": 10.0
} ]

BIN
images/ui/brassy_frame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/brassy_frame.png-1b7e797eb18ae79b8053fcadb7baf826.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/ui/brassy_frame.png"
dest_files=[ "res://.import/brassy_frame.png-1b7e797eb18ae79b8053fcadb7baf826.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

BIN
images/ui/dialogue_bg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/dialogue_bg.png-bd04df9d8aa873c1b514d96025e7d2ea.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://images/ui/dialogue_bg.png"
dest_files=[ "res://.import/dialogue_bg.png-bd04df9d8aa873c1b514d96025e7d2ea.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=true
svg/scale=1.0

87
project.godot Normal file
View File

@ -0,0 +1,87 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=4
_global_script_classes=[ {
"base": "Node",
"class": "AsepriteImportData",
"language": "GDScript",
"path": "res://addons/aseprite_importer/classes/AsepriteImportData.gd"
}, {
"base": "Node",
"class": "AsepriteImporter",
"language": "GDScript",
"path": "res://addons/aseprite_importer/classes/AsepriteImporter.gd"
}, {
"base": "Node",
"class": "DialogueAction",
"language": "GDScript",
"path": "res://scripts/DialogueAction.gd"
}, {
"base": "Control",
"class": "DialogueBox",
"language": "GDScript",
"path": "res://scripts/DialogueBox.gd"
}, {
"base": "Node",
"class": "EditorTheme",
"language": "GDScript",
"path": "res://addons/aseprite_importer/classes/EditorTheme.gd"
}, {
"base": "Node",
"class": "IntroScript",
"language": "GDScript",
"path": "res://scripts/scenes/IntroScript.gd"
} ]
_global_script_class_icons={
"AsepriteImportData": "",
"AsepriteImporter": "",
"DialogueAction": "",
"DialogueBox": "",
"EditorTheme": "",
"IntroScript": ""
}
[application]
config/name="Crabs Game"
run/main_scene="res://scenes/startup.tscn"
config/icon="res://icon.png"
[display]
window/size/width=192
window/size/height=108
window/size/fullscreen=true
window/vsync/vsync_via_compositor=true
window/stretch/mode="2d"
window/stretch/aspect="keep"
[editor_plugins]
enabled=PoolStringArray( "aseprite_importer" )
[input]
ui_accept={
"deadzone": 0.5,
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777221,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777222,"unicode":0,"echo":false,"script":null)
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"unicode":0,"echo":false,"script":null)
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":-1,"button_index":0,"pressure":0.0,"pressed":false,"script":null)
]
}
[rendering]
quality/intended_usage/framebuffer_allocation=0
quality/intended_usage/framebuffer_allocation.mobile=0
quality/2d/use_pixel_snap=true
environment/default_environment="res://default_env.tres"
quality/dynamic_fonts/use_oversampling=false

35
scenes/campfire.tscn Normal file
View File

@ -0,0 +1,35 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://images/campfire.tres" type="SpriteFrames" id=1]
[ext_resource path="res://images/ely.tres" type="SpriteFrames" id=2]
[ext_resource path="res://scenes/dialogue.tscn" type="PackedScene" id=3]
[ext_resource path="res://scripts/scenes/IntroScript.gd" type="Script" id=4]
[node name="root" type="Node2D"]
[node name="Campfire (background)" type="AnimatedSprite" parent="."]
frames = ExtResource( 1 )
frame = 18
playing = true
centered = false
[node name="Ely" type="AnimatedSprite" parent="."]
frames = ExtResource( 2 )
frame = 49
playing = true
centered = false
[node name="UI" type="Control" parent="."]
margin_right = 192.0
margin_bottom = 108.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Dialog" parent="UI" instance=ExtResource( 3 )]
visible = false
[node name="IntroScript" type="Node" parent="."]
script = ExtResource( 4 )
dialogue_box_path = NodePath("../UI/Dialog")
start_dialogue = "res://dialogues/intro_1.json"

196
scenes/dialogue.tscn Normal file
View File

@ -0,0 +1,196 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://images/ui/dialogue_bg.png" type="Texture" id=1]
[ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2]
[ext_resource path="res://scripts/DialogueBox.gd" type="Script" id=3]
[sub_resource type="VisualShaderNodeColorConstant" id=1]
constant = Color( 0, 0, 0, 0.803922 )
[sub_resource type="VisualShaderNodeInput" id=2]
input_name = "texture"
[sub_resource type="VisualShaderNodeTexture" id=3]
source = 2
[sub_resource type="VisualShader" id=4]
code = "shader_type canvas_item;
void vertex() {
// Output:0
}
void fragment() {
// Input:4
// Texture:6
vec3 n_out6p0;
float n_out6p1;
{
vec4 _tex_read = texture(TEXTURE , UV.xy);
n_out6p0 = _tex_read.rgb;
n_out6p1 = _tex_read.a;
}
// Color:3
vec3 n_out3p0 = vec3(0.000000, 0.000000, 0.000000);
float n_out3p1 = 0.803922;
// Output:0
COLOR.rgb = n_out6p0;
COLOR.a = n_out3p1;
}
void light() {
// Output:0
}
"
custom_defines = ""
graph_offset = Vector2( 261, 117 )
mode = 1
flags/light_only = false
nodes/vertex/0/position = Vector2( 400, 160 )
nodes/fragment/0/position = Vector2( 1040, 260 )
nodes/fragment/3/node = SubResource( 1 )
nodes/fragment/3/position = Vector2( 600, 420 )
nodes/fragment/4/node = SubResource( 2 )
nodes/fragment/4/position = Vector2( 460, 300 )
nodes/fragment/6/node = SubResource( 3 )
nodes/fragment/6/position = Vector2( 740, 200 )
nodes/fragment/connections = PoolIntArray( 3, 1, 0, 1, 4, 0, 6, 2, 6, 0, 0, 0 )
[sub_resource type="ShaderMaterial" id=5]
render_priority = -1
shader = SubResource( 4 )
[node name="Dialog" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
title_path = NodePath("MarginContainer/VBoxContainer/MarginContainer/MarginContainer/CharacterName")
text_path = NodePath("MarginContainer/VBoxContainer/MarginContainer2/MarginContainer/DialogText")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 4
custom_constants/margin_left = 4
custom_constants/margin_bottom = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_left = 4.0
margin_right = 188.0
margin_bottom = 108.0
custom_constants/separation = 0
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer"]
margin_top = 61.0
margin_right = 184.0
margin_bottom = 74.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.2
custom_constants/margin_right = 4
custom_constants/margin_left = 4
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DialogBackground" type="NinePatchRect" parent="MarginContainer/VBoxContainer/MarginContainer"]
show_behind_parent = true
material = SubResource( 5 )
margin_left = 4.0
margin_right = 180.0
margin_bottom = 13.0
texture = ExtResource( 1 )
patch_margin_left = 1
patch_margin_top = 1
patch_margin_right = 1
patch_margin_bottom = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MarginContainer"]
margin_left = 4.0
margin_right = 180.0
margin_bottom = 13.0
custom_constants/margin_left = 4
custom_constants/margin_bottom = -2
[node name="CharacterName" type="RichTextLabel" parent="MarginContainer/VBoxContainer/MarginContainer/MarginContainer"]
margin_left = 4.0
margin_right = 176.0
margin_bottom = 15.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.25
custom_fonts/normal_font = ExtResource( 2 )
text = "Elie"
fit_content_height = true
scroll_active = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/VBoxContainer"]
margin_top = 74.0
margin_right = 184.0
margin_bottom = 108.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DialogBackground2" type="NinePatchRect" parent="MarginContainer/VBoxContainer/MarginContainer2"]
show_behind_parent = true
material = SubResource( 5 )
margin_right = 184.0
margin_bottom = 34.0
texture = ExtResource( 1 )
patch_margin_left = 10
patch_margin_top = 10
patch_margin_right = 10
patch_margin_bottom = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer/MarginContainer2"]
margin_right = 184.0
margin_bottom = 34.0
custom_constants/margin_right = 6
custom_constants/margin_top = 2
custom_constants/margin_left = 6
custom_constants/margin_bottom = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DialogText" type="RichTextLabel" parent="MarginContainer/VBoxContainer/MarginContainer2/MarginContainer"]
margin_left = 6.0
margin_top = 2.0
margin_right = 178.0
margin_bottom = 32.0
rect_clip_content = false
size_flags_horizontal = 3
custom_fonts/normal_font = ExtResource( 2 )
bbcode_enabled = true
bbcode_text = "[center]Wtf is going on, where am I and where did you hide the cheese?![/center]"
text = "Wtf is going on, where am I and where did you hide the cheese?!"
fit_content_height = true
__meta__ = {
"_edit_use_anchors_": false
}

90
scenes/main_menu.tscn Normal file
View File

@ -0,0 +1,90 @@
[gd_scene load_steps=9 format=2]
[ext_resource path="res://scripts/menu/title_background.gd" type="Script" id=1]
[ext_resource path="res://fonts/dialog_default_font.tres" type="DynamicFont" id=2]
[ext_resource path="res://scripts/menu/MenuButton.gd" type="Script" id=3]
[ext_resource path="res://images/title_background.tres" type="SpriteFrames" id=4]
[ext_resource path="res://scripts/menu/MainMenu.gd" type="Script" id=5]
[ext_resource path="res://images/title_background_campfire.tres" type="SpriteFrames" id=6]
[sub_resource type="StyleBoxEmpty" id=1]
[sub_resource type="StyleBoxEmpty" id=2]
[node name="Node2D" type="Node2D"]
[node name="background" type="AnimatedSprite" parent="."]
frames = ExtResource( 4 )
animation = "start"
frame = 47
playing = true
centered = false
script = ExtResource( 1 )
[node name="Fire" type="AnimatedSprite" parent="."]
frames = ExtResource( 6 )
animation = "start"
frame = 38
playing = true
centered = false
script = ExtResource( 1 )
[node name="UI" type="Control" parent="."]
margin_right = 40.0
margin_bottom = 40.0
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Buttons" type="Control" parent="UI"]
margin_right = 40.0
margin_bottom = 40.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PlayButton" type="Button" parent="UI/Buttons"]
anchor_left = 3.875
anchor_top = 1.35
anchor_right = 3.875
anchor_bottom = 1.35
margin_left = -13.3871
margin_top = -17.551
margin_right = 30.6129
margin_bottom = 2.449
custom_styles/focus = SubResource( 1 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 )
custom_colors/font_color_hover = Color( 1, 1, 1, 1 )
text = "Play"
flat = true
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
scene_to_load = "res://scenes/campfire.tscn"
[node name="QuitButton" type="Button" parent="UI/Buttons"]
anchor_left = 3.875
anchor_top = 1.35
anchor_right = 3.875
anchor_bottom = 1.35
margin_left = -13.3871
margin_top = 2.449
margin_right = 30.6129
margin_bottom = 22.449
custom_styles/focus = SubResource( 2 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.282353, 0.282353, 0.282353, 1 )
custom_colors/font_color_hover = Color( 1, 1, 1, 1 )
text = "Quit"
flat = true
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="animation_finished" from="background" to="background" method="_on_background_animation_finished"]
[connection signal="animation_finished" from="Fire" to="Fire" method="_on_background_animation_finished"]
[connection signal="pressed" from="UI/Buttons/PlayButton" to="UI/Buttons/PlayButton" method="_on_Button_pressed"]
[connection signal="pressed" from="UI/Buttons/QuitButton" to="UI/Buttons/QuitButton" method="_on_Button_pressed"]

6
scenes/startup.tscn Normal file
View File

@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://scripts/scenes/startup.gd" type="Script" id=1]
[node name="Node2D" type="Node2D"]
script = ExtResource( 1 )

22
scripts/DialogueAction.gd Normal file
View File

@ -0,0 +1,22 @@
extends Node
class_name DialogueAction
export (NodePath) var dialogue_box_path
onready var dialogue_box = get_node(dialogue_box_path)
export (String, FILE, '*.json') var dialogue_file_path : String
func start() -> void:
var dialogue : Array = load_dialogue(dialogue_file_path)
dialogue_box.start(dialogue)
yield(dialogue_box, "end")
emit_signal("end")
func load_dialogue(file_path) -> Array:
var file = File.new()
assert (file.file_exists(file_path))
file.open(file_path, file.READ)
var dialogue = parse_json(file.get_as_text())
assert (dialogue.size() > 0)
return dialogue

45
scripts/DialogueBox.gd Normal file
View File

@ -0,0 +1,45 @@
extends Control
class_name DialogueBox
signal end
export (NodePath) var title_path
onready var title = get_node(title_path) as RichTextLabel
export (NodePath) var text_path
onready var text = get_node(text_path) as RichTextLabel
export (NodePath) var expression_path
onready var expression = get_node(expression_path) as RichTextLabel
var _dialogue : Array
var _index : int
func _ready():
assert(title != null)
assert(text != null)
func start(dialogue : Array):
_dialogue = dialogue
_index = 0
_update()
show()
func _input(event):
if event.is_action_pressed("ui_accept"):
next()
func next() -> void:
_index += 1
if _index >= _dialogue.size():
hide()
emit_signal('end')
return
_update()
func _update() -> void:
text.text = _dialogue[_index].text
title.text = _dialogue[_index].name
#expression = _dialogue[_index].expression
if _index == _dialogue.size() - 1:
emit_signal('end')

View File

@ -0,0 +1,26 @@
extends Node
const SOURCE_DIRECTORY = "res://dialogues/characters/"
var characters : Dictionary
func _ready() -> void:
var dir : Directory = Directory.new()
assert (dir.dir_exists(SOURCE_DIRECTORY))
if not dir.open(SOURCE_DIRECTORY) == OK:
print("Could not read directory %s" % SOURCE_DIRECTORY)
return
dir.list_dir_begin()
var file_name : String = " "
while true:
file_name = dir.get_next()
if file_name == "":
break
if not file_name.ends_with(".tres"):
continue
characters[file_name.get_basename()] = load(SOURCE_DIRECTORY.plus_file(file_name))
func get_texture(character_name : String, expression : String = "neutral") -> Texture:
assert (character_name in characters)
assert (expression in characters[character_name].expressions)
return characters[character_name].expressions[expression]

12
scripts/menu/MainMenu.gd Normal file
View File

@ -0,0 +1,12 @@
extends Node
func _ready():
$Buttons/PlayButton.grab_focus()
for button in $Buttons.get_children():
button.connect('pressed', self, '_on_Button_pressed', [button.scene_to_load])
func _on_Button_pressed(scene_to_load : String):
if scene_to_load != "":
get_tree().change_scene(scene_to_load)
else:
get_tree().quit()

View File

@ -0,0 +1,3 @@
extends Button
export (String, FILE, "*.tscn") var scene_to_load

View File

@ -0,0 +1,10 @@
extends AnimatedSprite
func _ready():
play('start')
frame = 0
func _on_background_animation_finished():
play('idle')
frame = 0

6
scripts/pause_menu.gd Normal file
View File

@ -0,0 +1,6 @@
extends Node
func _input(event):
if event.is_action_pressed("ui_home"):
print('pause')

View File

@ -0,0 +1,15 @@
extends Node
class_name IntroScript
export (NodePath) var dialogue_box_path
onready var dialogue_box = get_node(dialogue_box_path)
export (String, FILE, '*.json') var start_dialogue : String
func _ready():
assert(dialogue_box != null)
var dialogue = DialogueAction.new()
dialogue.dialogue_file_path = start_dialogue
dialogue.dialogue_box = dialogue_box
dialogue.start()

View File

@ -0,0 +1,4 @@
extends Node2D
func _ready():
get_tree().change_scene("res://scenes/main_menu.tscn")