First commit
This commit is contained in:
commit
6951a80fdb
21
etc/main_tileset.tres
Normal file
21
etc/main_tileset.tres
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
[gd_resource type="TileSet" load_steps=4 format=3 uid="uid://stnhmu4q2gsn"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://c7eq6tbstw18j" path="res://sprites/tiles/tileatlas.png" id="1_r78at"]
|
||||||
|
|
||||||
|
[sub_resource type="NavigationPolygon" id="NavigationPolygon_f4er1"]
|
||||||
|
vertices = PackedVector2Array(8, 8, -8, 8, -8, -8, 8, -8)
|
||||||
|
polygons = Array[PackedInt32Array]([PackedInt32Array(0, 1, 2, 3)])
|
||||||
|
outlines = Array[PackedVector2Array]([PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)])
|
||||||
|
agent_radius = 0.0
|
||||||
|
|
||||||
|
[sub_resource type="TileSetAtlasSource" id="TileSetAtlasSource_02q8r"]
|
||||||
|
texture = ExtResource("1_r78at")
|
||||||
|
0:0/0 = 0
|
||||||
|
0:0/0/physics_layer_0/polygon_0/points = PackedVector2Array(-8, -8, 8, -8, 8, 8, -8, 8)
|
||||||
|
1:0/0 = 0
|
||||||
|
1:0/0/navigation_layer_0/polygon = SubResource("NavigationPolygon_f4er1")
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
physics_layer_0/collision_layer = 1
|
||||||
|
navigation_layer_0/layers = 1
|
||||||
|
sources/0 = SubResource("TileSetAtlasSource_02q8r")
|
1
icon.svg
Normal file
1
icon.svg
Normal file
|
@ -0,0 +1 @@
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="124" height="124" x="2" y="2" fill="#363d52" stroke="#212532" stroke-width="4" rx="14"/><g fill="#fff" transform="translate(12.322 12.322)scale(.101)"><path d="M105 673v33q407 354 814 0v-33z"/><path fill="#478cbf" d="m105 673 152 14q12 1 15 14l4 67 132 10 8-61q2-11 15-15h162q13 4 15 15l8 61 132-10 4-67q3-13 15-14l152-14V427q30-39 56-81-35-59-83-108-43 20-82 47-40-37-88-64 7-51 8-102-59-28-123-42-26 43-46 89-49-7-98 0-20-46-46-89-64 14-123 42 1 51 8 102-48 27-88 64-39-27-82-47-48 49-83 108 26 42 56 81zm0 33v39c0 276 813 276 814 0v-39l-134 12-5 69q-2 10-14 13l-162 11q-12 0-16-11l-10-65H446l-10 65q-4 11-16 11l-162-11q-12-3-14-13l-5-69z"/><path d="M483 600c0 34 58 34 58 0v-86c0-34-58-34-58 0z"/><circle cx="725" cy="526" r="90"/><circle cx="299" cy="526" r="90"/></g><g fill="#414042" transform="translate(12.322 12.322)scale(.101)"><circle cx="307" cy="532" r="60"/><circle cx="717" cy="532" r="60"/></g></svg>
|
After Width: | Height: | Size: 994 B |
37
icon.svg.import
Normal file
37
icon.svg.import
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://bx2ylasoljyrr"
|
||||||
|
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://icon.svg"
|
||||||
|
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
|
svg/scale=1.0
|
||||||
|
editor/scale_with_editor_scale=false
|
||||||
|
editor/convert_colors_with_editor_theme=false
|
81
project.godot
Normal file
81
project.godot
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
; 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=5
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="WindowPuzzler"
|
||||||
|
run/main_scene="res://scenes/world.tscn"
|
||||||
|
config/features=PackedStringArray("4.3", "GL Compatibility")
|
||||||
|
config/icon="res://icon.svg"
|
||||||
|
|
||||||
|
[debug]
|
||||||
|
|
||||||
|
gdscript/warnings/untyped_declaration=2
|
||||||
|
gdscript/warnings/unsafe_property_access=2
|
||||||
|
gdscript/warnings/unsafe_method_access=2
|
||||||
|
gdscript/warnings/unsafe_cast=1
|
||||||
|
gdscript/warnings/unsafe_call_argument=2
|
||||||
|
gdscript/warnings/narrowing_conversion=0
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/viewport_width=256
|
||||||
|
window/size/viewport_height=256
|
||||||
|
window/size/resizable=false
|
||||||
|
window/size/window_width_override=512
|
||||||
|
window/size/window_height_override=512
|
||||||
|
window/stretch/mode="canvas_items"
|
||||||
|
window/stretch/scale_mode="integer"
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
ui_left={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194319,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":13,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":-1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":97,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":72,"key_label":0,"unicode":104,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_right={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194321,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":14,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":0,"axis_value":1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":100,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":76,"key_label":0,"unicode":108,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_up={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194320,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":11,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":-1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":87,"key_label":0,"unicode":119,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":75,"key_label":0,"unicode":107,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
ui_down={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":4194322,"physical_keycode":0,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventJoypadButton,"resource_local_to_scene":false,"resource_name":"","device":0,"button_index":12,"pressure":0.0,"pressed":false,"script":null)
|
||||||
|
, Object(InputEventJoypadMotion,"resource_local_to_scene":false,"resource_name":"","device":0,"axis":1,"axis_value":1.0,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":83,"key_label":0,"unicode":115,"location":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":74,"key_label":0,"unicode":106,"location":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
textures/canvas_textures/default_texture_filter=0
|
||||||
|
renderer/rendering_method="gl_compatibility"
|
||||||
|
renderer/rendering_method.mobile="gl_compatibility"
|
||||||
|
environment/defaults/default_clear_color=Color(0, 0, 0, 1)
|
30
scenes/player.tscn
Normal file
30
scenes/player.tscn
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
[gd_scene load_steps=3 format=3 uid="uid://qf1tj52hbpvv"]
|
||||||
|
|
||||||
|
[ext_resource type="Texture2D" uid="uid://cr0j5caegnmmm" path="res://sprites/player.png" id="1_5amrr"]
|
||||||
|
[ext_resource type="Script" path="res://scripts/player.gd" id="1_44r7b"]
|
||||||
|
|
||||||
|
[node name="Player" type="Node2D"]
|
||||||
|
script = ExtResource("1_44r7b")
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite2D" parent="."]
|
||||||
|
texture = ExtResource("1_5amrr")
|
||||||
|
centered = false
|
||||||
|
|
||||||
|
[node name="UpCast" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
target_position = Vector2(0, -16)
|
||||||
|
|
||||||
|
[node name="LeftCast" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
target_position = Vector2(-16, 0)
|
||||||
|
|
||||||
|
[node name="DownCast" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
target_position = Vector2(0, 16)
|
||||||
|
|
||||||
|
[node name="RightCast" type="RayCast2D" parent="."]
|
||||||
|
position = Vector2(8, 8)
|
||||||
|
target_position = Vector2(16, 0)
|
||||||
|
|
||||||
|
[node name="MoveTimer" type="Timer" parent="."]
|
||||||
|
one_shot = true
|
14
scenes/world.tscn
Normal file
14
scenes/world.tscn
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
[gd_scene load_steps=3 format=4 uid="uid://cj745xdkfs07e"]
|
||||||
|
|
||||||
|
[ext_resource type="TileSet" uid="uid://stnhmu4q2gsn" path="res://etc/main_tileset.tres" id="1_xai1s"]
|
||||||
|
[ext_resource type="PackedScene" uid="uid://qf1tj52hbpvv" path="res://scenes/player.tscn" id="2_6pie4"]
|
||||||
|
|
||||||
|
[node name="World" type="Node2D"]
|
||||||
|
metadata/_edit_lock_ = true
|
||||||
|
|
||||||
|
[node name="TileMapLayer" type="TileMapLayer" parent="."]
|
||||||
|
tile_map_data = PackedByteArray("AAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAMAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAYAAAAAAAAAAAAAAAcAAAAAAAAAAAAAAAkAAAAAAAAAAAAAAAoAAAAAAAAAAAAAAAsAAAAAAAAAAAAAAAwAAAAAAAAAAAAAAA0AAAAAAAAAAAAAAA4AAAAAAAAAAAAAAA8AAAAAAAAAAAABAA8AAAAAAAAAAAACAA8AAAAAAAAAAAADAA8AAAAAAAAAAAAEAA8AAAAAAAAAAAAFAA8AAAAAAAAAAAAGAA8AAAAAAAAAAAAHAA8AAAAAAAAAAAAJAA8AAAAAAAAAAAAKAA8AAAAAAAAAAAALAA8AAAAAAAAA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AAAAAAAKAA4AAAABAAAAAAAKAA0AAAABAAAAAAALAA0AAAABAAAAAAALAA4AAAABAAAAAAAMAA4AAAABAAAAAAAMAA0AAAABAAAAAAANAA0AAAABAAAAAAANAAwAAAABAAAAAAANAAsAAAABAAAAAAANAAoAAAABAAAAAAAOAAoAAAABAAAAAAAOAAkAAAABAAAAAAAOAAgAAAABAAAAAAAOAAcAAAABAAAAAAAOAAYAAAABAAAAAAAOAAUAAAABAAAAAAAOAAQAAAABAAAAAAAOAAMAAAABAAAAAAAOAAIAAAABAAAAAAAOAAEAAAABAAAAAAAOAAsAAAABAAAAAAAOAAwAAAABAAAAAAAOAA0AAAABAAAAAAAOAA4AAAABAAAAAAANAA4AAAABAAAAAAA=")
|
||||||
|
tile_set = ExtResource("1_xai1s")
|
||||||
|
|
||||||
|
[node name="Player" parent="." instance=ExtResource("2_6pie4")]
|
||||||
|
position = Vector2(128, 128)
|
58
scripts/player.gd
Normal file
58
scripts/player.gd
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
extends Node2D
|
||||||
|
|
||||||
|
const TILE_SIZE : int = 16
|
||||||
|
|
||||||
|
const MOVE_TIME : float = 0.2
|
||||||
|
|
||||||
|
enum {UP,LEFT,DOWN,RIGHT,NONE = -1}
|
||||||
|
|
||||||
|
@onready var DirectionCast : Array[RayCast2D] = [$UpCast,$LeftCast,$DownCast,$RightCast]
|
||||||
|
|
||||||
|
@onready var MoveTimer : Timer = $MoveTimer
|
||||||
|
|
||||||
|
var direction : int
|
||||||
|
|
||||||
|
# Called when the node enters the scene tree for the first time.
|
||||||
|
func _ready() -> void:
|
||||||
|
pass # Replace with function body.
|
||||||
|
|
||||||
|
|
||||||
|
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||||
|
func _process(delta: float) -> void:
|
||||||
|
direction = NONE
|
||||||
|
|
||||||
|
if Input.is_action_pressed("ui_left"):
|
||||||
|
direction = LEFT
|
||||||
|
if Input.is_action_just_pressed("ui_left"):
|
||||||
|
move()
|
||||||
|
|
||||||
|
if Input.is_action_pressed("ui_right"):
|
||||||
|
direction = RIGHT
|
||||||
|
if Input.is_action_just_pressed("ui_right"):
|
||||||
|
move()
|
||||||
|
|
||||||
|
if Input.is_action_pressed("ui_up"):
|
||||||
|
direction = UP
|
||||||
|
if Input.is_action_just_pressed("ui_up"):
|
||||||
|
move()
|
||||||
|
|
||||||
|
if Input.is_action_pressed("ui_down"):
|
||||||
|
direction = DOWN
|
||||||
|
if Input.is_action_just_pressed("ui_down"):
|
||||||
|
move()
|
||||||
|
|
||||||
|
if MoveTimer.is_stopped():
|
||||||
|
move()
|
||||||
|
|
||||||
|
|
||||||
|
func move() -> void:
|
||||||
|
if direction == LEFT and not DirectionCast[LEFT].is_colliding():
|
||||||
|
position.x -= TILE_SIZE
|
||||||
|
if direction == RIGHT and not DirectionCast[RIGHT].is_colliding():
|
||||||
|
position.x += TILE_SIZE
|
||||||
|
if direction == UP and not DirectionCast[UP].is_colliding():
|
||||||
|
position.y -= TILE_SIZE
|
||||||
|
if direction == DOWN and not DirectionCast[DOWN].is_colliding():
|
||||||
|
position.y += TILE_SIZE
|
||||||
|
|
||||||
|
MoveTimer.start(MOVE_TIME)
|
BIN
sprites/player.png
Normal file
BIN
sprites/player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 151 B |
34
sprites/player.png.import
Normal file
34
sprites/player.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cr0j5caegnmmm"
|
||||||
|
path="res://.godot/imported/player.png-f534b8a02ffb80eefc72936296201445.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/player.png"
|
||||||
|
dest_files=["res://.godot/imported/player.png-f534b8a02ffb80eefc72936296201445.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
sprites/tiles/tileatlas.ase
Normal file
BIN
sprites/tiles/tileatlas.ase
Normal file
Binary file not shown.
BIN
sprites/tiles/tileatlas.png
Normal file
BIN
sprites/tiles/tileatlas.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 133 B |
34
sprites/tiles/tileatlas.png.import
Normal file
34
sprites/tiles/tileatlas.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://c7eq6tbstw18j"
|
||||||
|
path="res://.godot/imported/tileatlas.png-e65435ae30eacc618cef8ad0dcb649f4.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/tiles/tileatlas.png"
|
||||||
|
dest_files=["res://.godot/imported/tileatlas.png-e65435ae30eacc618cef8ad0dcb649f4.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
Loading…
Reference in a new issue