Compare commits
No commits in common. "9e14cc915ec1a49112a9c7d083c8623c2aad6dc3" and "0ff17ab486d8e2e63b42f569212487dde63b4568" have entirely different histories.
9e14cc915e
...
0ff17ab486
6 changed files with 6 additions and 68 deletions
|
@ -1,47 +0,0 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bxin06eifwhb5"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dx8jpmxtm2cdx" path="res://textures/pattern/Pattern_Forest.png" id="1_wdsuj"]
|
||||
|
||||
[sub_resource type="GDScript" id="GDScript_7jd0b"]
|
||||
script/source = "@tool
|
||||
extends CanvasLayer
|
||||
|
||||
@export var Pattern :Texture2D:
|
||||
set(new_pattern):
|
||||
Pattern = new_pattern
|
||||
$TextureRect.texture = Pattern
|
||||
$TextureRect.queue_redraw()
|
||||
@export var PatternColor :Color = Color.WHITE:
|
||||
set(new_patternColor):
|
||||
PatternColor = new_patternColor
|
||||
$TextureRect.self_modulate = PatternColor
|
||||
$TextureRect.queue_redraw()
|
||||
@export var BGColor :Color = Color.GRAY:
|
||||
set(new_BGColor):
|
||||
BGColor = new_BGColor
|
||||
$ColorRect.color = BGColor
|
||||
$ColorRect.queue_redraw()
|
||||
"
|
||||
|
||||
[node name="Background" type="CanvasLayer"]
|
||||
layer = -100
|
||||
script = SubResource("GDScript_7jd0b")
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="."]
|
||||
light_mask = 0
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("1_wdsuj")
|
||||
stretch_mode = 1
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="."]
|
||||
z_index = -1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0, 0, 0, 1)
|
|
@ -8,7 +8,6 @@ var hoveredObjects : Array
|
|||
var hoveredObject
|
||||
var hoveredSticker
|
||||
var grabbedSticker
|
||||
var grabbedStickerOffset
|
||||
|
||||
enum CURSOR_STATE {DEFAULT, CLICK, GRAB, GRABBED}
|
||||
var currentCursorState:CURSOR_STATE = CURSOR_STATE.DEFAULT
|
||||
|
@ -29,8 +28,6 @@ func _process(_delta):
|
|||
#endregion
|
||||
pointcast()
|
||||
cursor_look()
|
||||
if (grabbedSticker):
|
||||
grabbedSticker.position = grabbedStickerOffset+get_global_mouse_position()
|
||||
|
||||
|
||||
func isSticker(selectedObject:Node):
|
||||
|
@ -120,14 +117,9 @@ func _input(rawInputEvent:InputEvent):
|
|||
grab_end()
|
||||
|
||||
func grab_start():
|
||||
if (hoveredSticker and grabbedSticker == null):
|
||||
if (hoveredSticker):
|
||||
grabbedSticker = hoveredSticker
|
||||
|
||||
print("Grabbed ", grabbedSticker)
|
||||
grabbedStickerOffset = grabbedSticker.position - get_global_mouse_position()
|
||||
print("offset =", grabbedStickerOffset, " Stickpos:",grabbedSticker.position,"-",get_global_mouse_position() )
|
||||
if (grabbedSticker.has_method("on_grab")):
|
||||
grabbedSticker.on_grab(grabbedStickerOffset)
|
||||
|
||||
func grab_end():
|
||||
grabbedSticker.on_released()
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
[gd_scene load_steps=23 format=3 uid="uid://0m1hk2nu4bps"]
|
||||
[gd_scene load_steps=21 format=3 uid="uid://0m1hk2nu4bps"]
|
||||
|
||||
[ext_resource type="Script" path="res://core/player.gd" id="1_whhfc"]
|
||||
[ext_resource type="Texture2D" uid="uid://5pmqr3y62guu" path="res://textures/player/currentCloth.tres" id="2_w1l4c"]
|
||||
[ext_resource type="Texture2D" uid="uid://5qixrbrclydr" path="res://textures/player/currentHat.tres" id="3_ybl0v"]
|
||||
[ext_resource type="Animation" uid="uid://bd0mi2x4pkf70" path="res://animations/player/Walk.res" id="4_56ghs"]
|
||||
[ext_resource type="PackedScene" uid="uid://bxin06eifwhb5" path="res://core/Background.tscn" id="4_vpr5c"]
|
||||
[ext_resource type="Texture2D" uid="uid://cr27nsk1jw2ks" path="res://textures/pattern/Pattern_swamp.png" id="5_moipb"]
|
||||
[ext_resource type="Animation" uid="uid://b85dikp6ps8i2" path="res://animations/player/idle.res" id="5_uweie"]
|
||||
[ext_resource type="Texture2D" uid="uid://sod0ms1cfkjf" path="res://textures/player/playerSkin_ref.png" id="6_3ryww"]
|
||||
|
||||
|
@ -523,11 +521,6 @@ drag_bottom_margin = 0.74
|
|||
editor_draw_limits = true
|
||||
editor_draw_drag_margin = true
|
||||
|
||||
[node name="Background" parent="Camera2D" instance=ExtResource("4_vpr5c")]
|
||||
Pattern = ExtResource("5_moipb")
|
||||
PatternColor = Color(1, 1, 1, 0.490196)
|
||||
BGColor = Color(0.173374, 0.319037, 0.221103, 1)
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="." groups=["Animation"]]
|
||||
libraries = {
|
||||
"": SubResource("AnimationLibrary_4k813")
|
||||
|
|
|
@ -234,6 +234,7 @@ texture = SubResource("AtlasTexture_vun1v")
|
|||
offset = Vector2(-78.385, -130.2)
|
||||
StickerShape = SubResource("CapsuleShape2D_b3366")
|
||||
Position = Vector2(8.56, -52.395)
|
||||
Rotation = 0.0
|
||||
CollisionShape = SubResource("RectangleShape2D_4cdlc")
|
||||
CollisionPosition = Vector2(7.915, -31.39)
|
||||
metadata/tags = ["rock"]
|
||||
|
@ -244,6 +245,7 @@ texture = SubResource("AtlasTexture_wpoj4")
|
|||
offset = Vector2(-126.11, -220.56)
|
||||
StickerShape = SubResource("CapsuleShape2D_bkpsv")
|
||||
Position = Vector2(0, -89.77)
|
||||
Rotation = 0.0
|
||||
CollisionShape = SubResource("RectangleShape2D_hk5e3")
|
||||
CollisionPosition = Vector2(0, -66.02)
|
||||
metadata/tags = ["rock"]
|
||||
|
|
|
@ -43,9 +43,6 @@ func on_hover():
|
|||
func on_unhover():
|
||||
material = null
|
||||
queue_redraw()
|
||||
|
||||
func on_grab(_offset:Vector2=Vector2(0.0,0.0)):
|
||||
pass
|
||||
"
|
||||
|
||||
[node name="FreeSticker1" type="Sprite2D"]
|
||||
|
|
|
@ -55,6 +55,7 @@ texture = SubResource("AtlasTexture_2wdar")
|
|||
centered = false
|
||||
offset = Vector2(-161.055, -179.785)
|
||||
script = SubResource("GDScript_uqtu8")
|
||||
Rotation = Vector2(0, 0)
|
||||
metadata/tags = ["sticker"]
|
||||
|
||||
[node name="Area2D" type="Area2D" parent="."]
|
||||
|
|
Loading…
Reference in a new issue