mirror of
https://github.com/Relintai/GraphicsEditor.git
synced 2024-11-12 08:15:17 +01:00
Removed self on a lot of lines
This commit is contained in:
parent
13c3a1716b
commit
d8bcc2df3f
@ -7,7 +7,7 @@ func _ready():
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
func _draw():
|
func _draw():
|
||||||
draw_outline_box(self.rect_size, color, 3)
|
draw_outline_box(rect_size, color, 3)
|
||||||
|
|
||||||
func draw_outline_box(size, color, width):
|
func draw_outline_box(size, color, width):
|
||||||
#Top line
|
#Top line
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
tool
|
tool
|
||||||
extends MenuButton
|
extends MenuButton
|
||||||
|
|
||||||
var popup = self.get_popup()
|
var popup = get_popup()
|
||||||
signal item_pressed
|
signal item_pressed
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
popup.connect("id_pressed", self, "id_pressed")
|
popup.connect("id_pressed", self, "id_pressed")
|
||||||
|
|
||||||
func id_pressed(id):
|
func id_pressed(id):
|
||||||
emit_signal("item_pressed", self.name, popup.get_item_text(id))
|
emit_signal("item_pressed", name, popup.get_item_text(id))
|
@ -73,7 +73,7 @@ func _ready():
|
|||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
var mouse_position = get_local_mouse_position()
|
var mouse_position = get_local_mouse_position()
|
||||||
var rect = Rect2(Vector2(0, 0), self.rect_size)
|
var rect = Rect2(Vector2(0, 0), rect_size)
|
||||||
mouse_in_region = rect.has_point(mouse_position)
|
mouse_in_region = rect.has_point(mouse_position)
|
||||||
update()
|
update()
|
||||||
#if not Engine.editor_hint:
|
#if not Engine.editor_hint:
|
||||||
|
@ -5,7 +5,7 @@ var image = Image.new()
|
|||||||
var image_texture = ImageTexture.new()
|
var image_texture = ImageTexture.new()
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
|
||||||
func setup(region_size):
|
func setup(region_size):
|
||||||
image.create(region_size, region_size, true, Image.FORMAT_RGBA8)
|
image.create(region_size, region_size, true, Image.FORMAT_RGBA8)
|
||||||
@ -21,7 +21,7 @@ func set_cell(x, y, color):
|
|||||||
update_chunk()
|
update_chunk()
|
||||||
|
|
||||||
func _on_VisibilityNotifier2D_screen_entered():
|
func _on_VisibilityNotifier2D_screen_entered():
|
||||||
self.visible = true
|
visible = true
|
||||||
|
|
||||||
func _on_VisibilityNotifier2D_screen_exited():
|
func _on_VisibilityNotifier2D_screen_exited():
|
||||||
self.visible = false
|
visible = false
|
@ -9,7 +9,7 @@ func _ready():
|
|||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
var mouse_position = get_local_mouse_position()
|
var mouse_position = get_local_mouse_position()
|
||||||
var rect = Rect2(Vector2(0, 0), self.rect_size)
|
var rect = Rect2(Vector2(0, 0), rect_size)
|
||||||
mouse_in_region = rect.has_point(mouse_position)
|
mouse_in_region = rect.has_point(mouse_position)
|
||||||
|
|
||||||
func _on_PaintCanvasContainer_mouse_entered():
|
func _on_PaintCanvasContainer_mouse_entered():
|
||||||
|
@ -26,4 +26,4 @@ func _on_CheckButton_toggled(button_pressed):
|
|||||||
canvas_outline.visible = button_pressed
|
canvas_outline.visible = button_pressed
|
||||||
|
|
||||||
func _on_Ok_pressed():
|
func _on_Ok_pressed():
|
||||||
self.hide()
|
hide()
|
||||||
|
@ -8,9 +8,9 @@ var size = 240
|
|||||||
|
|
||||||
func add_text_info(text_name, custom_node = null):
|
func add_text_info(text_name, custom_node = null):
|
||||||
var last_text_info_child = null
|
var last_text_info_child = null
|
||||||
var child_count = self.get_child_count()
|
var child_count = get_child_count()
|
||||||
if not child_count <= 0:
|
if not child_count <= 0:
|
||||||
last_text_info_child = self.get_children()[self.get_children().size() - 1]
|
last_text_info_child = get_children()[get_children().size() - 1]
|
||||||
var label = Label.new()
|
var label = Label.new()
|
||||||
label.name = text_name
|
label.name = text_name
|
||||||
label.rect_size = Vector2(size, 14)
|
label.rect_size = Vector2(size, 14)
|
||||||
@ -25,14 +25,14 @@ func add_text_info(text_name, custom_node = null):
|
|||||||
label.rect_position = Vector2(x + temp_size, y)
|
label.rect_position = Vector2(x + temp_size, y)
|
||||||
if not custom_node == null:
|
if not custom_node == null:
|
||||||
label.add_child(custom_node)
|
label.add_child(custom_node)
|
||||||
self.add_child(label)
|
add_child(label)
|
||||||
|
|
||||||
func update_text_info(text_name, text_value = null, node = null, node_target_value = null, node_value = null):
|
func update_text_info(text_name, text_value = null, node = null, node_target_value = null, node_value = null):
|
||||||
var text_label = self.get_node(text_name)
|
var text_label = self.get_node(text_name)
|
||||||
if text_label == null:
|
if text_label == null:
|
||||||
return
|
return
|
||||||
if not node == null:
|
if not node == null:
|
||||||
self.get_node(text_name).get_node(node).set(node_target_value, node_value)
|
get_node(text_name).get_node(node).set(node_target_value, node_value)
|
||||||
if text_value == null:
|
if text_value == null:
|
||||||
text_label.text = "%s: %s" % [text_name, null]
|
text_label.text = "%s: %s" % [text_name, null]
|
||||||
else:
|
else:
|
||||||
|
@ -5,5 +5,5 @@ func _ready():
|
|||||||
|
|
||||||
func _notification(what):
|
func _notification(what):
|
||||||
if what == Control.NOTIFICATION_RESIZED:
|
if what == Control.NOTIFICATION_RESIZED:
|
||||||
get_node("Viewport").size = self.rect_size
|
get_node("Viewport").size = rect_size
|
||||||
get_node("Viewport/Node2D/Camera2D").position = Vector2(self.rect_size.x / 2, self.rect_size.y / 2)
|
get_node("Viewport/Node2D/Camera2D").position = Vector2(rect_size.x / 2, rect_size.y / 2)
|
@ -14,17 +14,17 @@ func _draw():
|
|||||||
|
|
||||||
var wrap_offset = Vector2(wrapf(offset.x, 0, temp_size), wrapf(offset.y, 0, temp_size))
|
var wrap_offset = Vector2(wrapf(offset.x, 0, temp_size), wrapf(offset.y, 0, temp_size))
|
||||||
|
|
||||||
var ceil_x = ceil(self.rect_size.x / temp_size) + 0.01
|
var ceil_x = ceil(rect_size.x / temp_size) + 0.01
|
||||||
var ceil_y = ceil(self.rect_size.y / temp_size) + 0.01
|
var ceil_y = ceil(rect_size.y / temp_size) + 0.01
|
||||||
|
|
||||||
for i in ceil_y:
|
for i in ceil_y:
|
||||||
var start_x = Vector2(0, (i * temp_size) + wrap_offset.y)
|
var start_x = Vector2(0, (i * temp_size) + wrap_offset.y)
|
||||||
var end_x = Vector2(self.rect_size.x, (i * temp_size) + wrap_offset.y)
|
var end_x = Vector2(rect_size.x, (i * temp_size) + wrap_offset.y)
|
||||||
draw_line(start_x, end_x, color, 1)
|
draw_line(start_x, end_x, color, 1)
|
||||||
|
|
||||||
for i in ceil_x:
|
for i in ceil_x:
|
||||||
var start_y = Vector2((i * temp_size) + wrap_offset.x, 0)
|
var start_y = Vector2((i * temp_size) + wrap_offset.x, 0)
|
||||||
var end_y = Vector2((i * temp_size) + (wrap_offset.x + 0.01), self.rect_size.y)
|
var end_y = Vector2((i * temp_size) + (wrap_offset.x + 0.01), rect_size.y)
|
||||||
draw_line(start_y, end_y, color, 1)
|
draw_line(start_y, end_y, color, 1)
|
||||||
|
|
||||||
func _process(delta):
|
func _process(delta):
|
||||||
|
Loading…
Reference in New Issue
Block a user