Add files via upload

This commit is contained in:
Nicolò Santilio 2020-12-21 18:13:04 +01:00 committed by GitHub
parent 60d0b98fd9
commit 2aafdd19c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 12 deletions

View File

@ -12,7 +12,7 @@ var function : String setget set_function, get_function
var mouse_entered : bool = false var mouse_entered : bool = false
enum SHAPES { enum SHAPES {
DOT, TRIANGLE, SQUARE, CROSS Dot, Triangle, Square, Cross
} }
var shape : int = 0 setget set_shape, get_shape var shape : int = 0 setget set_shape, get_shape
@ -31,20 +31,23 @@ func _draw():
draw_point(5,color) draw_point(5,color)
func draw_point(size : float, color : Color): func draw_point(size : float, color : Color):
var factor : float
match shape: match shape:
SHAPES.DOT: SHAPES.Dot:
draw_circle(OFFSET, size, color) draw_circle(OFFSET, size, color)
SHAPES.TRIANGLE: SHAPES.Triangle:
size+=6 size+=6
factor = 2
draw_colored_polygon([ draw_colored_polygon([
OFFSET-Vector2(0,size/2), OFFSET+Vector2(1,1)*size/2, OFFSET-Vector2(1,-1)*size/2 OFFSET-Vector2(0,size/factor), OFFSET+Vector2(1,1)*size/factor, OFFSET-Vector2(1,-1)*size/factor
], color,[],null,null,false) ], color,[],null,null,false)
SHAPES.SQUARE: SHAPES.Square:
size+=4 size+=4
factor = 2
draw_colored_polygon([ draw_colored_polygon([
OFFSET-Vector2(1,1)*size/2, OFFSET-Vector2(-1,1)*size/2, OFFSET+Vector2(1,1)*size/2, OFFSET-Vector2(1,-1)*size/2 OFFSET-Vector2(1,1)*size/factor, OFFSET-Vector2(-1,1)*size/factor, OFFSET+Vector2(1,1)*size/factor, OFFSET-Vector2(1,-1)*size/factor
], color,[],null,null,false) ], color,[],null,null,false)
SHAPES.CROSS: SHAPES.Cross:
size+=2 size+=2
draw_line(OFFSET-Vector2(size,0), OFFSET+Vector2(size,0), color, size-5, true) draw_line(OFFSET-Vector2(size,0), OFFSET+Vector2(size,0), color, size-5, true)
draw_line(OFFSET-Vector2(0,size), OFFSET+Vector2(0,size), color, size-5, true) draw_line(OFFSET-Vector2(0,size), OFFSET+Vector2(0,size), color, size-5, true)

View File

@ -19,15 +19,16 @@ corner_radius_bottom_right = 5
corner_radius_bottom_left = 5 corner_radius_bottom_left = 5
corner_detail = 20 corner_detail = 20
[node name="PointData" type="CanvasLayer"] [node name="CanvasLayer" type="CanvasLayer"]
[node name="PointData" type="PanelContainer" parent="."] [node name="PointData" type="PanelContainer" parent="."]
visible = false
anchor_right = 0.0694688 anchor_right = 0.0694688
anchor_bottom = 0.067 anchor_bottom = 0.067
margin_left = -256.805 margin_left = 79.7858
margin_top = -36.1267 margin_top = -250.75
margin_right = -256.941 margin_right = 79.6496
margin_bottom = -35.3267 margin_bottom = -249.95
grow_horizontal = 2 grow_horizontal = 2
mouse_filter = 2 mouse_filter = 2
custom_styles/panel = SubResource( 1 ) custom_styles/panel = SubResource( 1 )