2019-11-10 15:09:14 +10:30
|
|
|
extends "res://main.gd"
|
|
|
|
|
|
|
|
# Draw the bezel for radial gamemode
|
2019-11-18 13:11:02 +10:30
|
|
|
var center := Vector2(0.0, 0.0)
|
2019-11-10 15:09:14 +10:30
|
|
|
|
|
|
|
func _draw():
|
2019-11-18 13:11:02 +10:30
|
|
|
var bezel_colors := PoolColorArray([theme.bezel_color])
|
2019-11-10 15:09:14 +10:30
|
|
|
var bezel_points: PoolVector2Array
|
2019-11-18 13:11:02 +10:30
|
|
|
var screen_height2 := screen_height/2.0
|
2019-11-10 15:09:14 +10:30
|
|
|
|
2019-11-18 13:11:02 +10:30
|
|
|
draw_rect(Rect2(-screen_height2, -screen_height2, -x_margin, screen_height), theme.bezel_color)
|
|
|
|
draw_rect(Rect2(screen_height2, -screen_height2, x_margin, screen_height), theme.bezel_color)
|
2019-11-10 15:09:14 +10:30
|
|
|
|
2019-11-18 13:11:02 +10:30
|
|
|
bezel_points = arc_point_list(center, screen_height2, 0, -90)
|
|
|
|
bezel_points.push_back(Vector2(screen_height2, -screen_height2))
|
2019-11-10 15:09:14 +10:30
|
|
|
draw_polygon(bezel_points, bezel_colors)
|
|
|
|
|
2019-11-18 13:11:02 +10:30
|
|
|
bezel_points = arc_point_list(center, screen_height2, -90, -180)
|
|
|
|
bezel_points.push_back(Vector2(-screen_height2, -screen_height2))
|
2019-11-10 15:09:14 +10:30
|
|
|
draw_polygon(bezel_points, bezel_colors)
|
|
|
|
|
2019-11-18 13:11:02 +10:30
|
|
|
bezel_points = arc_point_list(center, screen_height2, -180, -270)
|
|
|
|
bezel_points.push_back(Vector2(-screen_height2, screen_height2))
|
2019-11-10 15:09:14 +10:30
|
|
|
draw_polygon(bezel_points, bezel_colors)
|
|
|
|
|
2019-11-18 13:11:02 +10:30
|
|
|
bezel_points = arc_point_list(center, screen_height2, -270, -360)
|
|
|
|
bezel_points.push_back(Vector2(screen_height2, screen_height2))
|
2019-11-10 15:09:14 +10:30
|
|
|
draw_polygon(bezel_points, bezel_colors)
|