Color rework
This commit is contained in:
parent
0dd3628ce1
commit
2b527c9b2e
15 changed files with 73 additions and 16 deletions
|
|
@ -92,7 +92,7 @@ func recolor():
|
|||
color_base = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1))
|
||||
color_enemy = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1))
|
||||
color_background = Color.from_hsv(randf(), randf_range(0.1765, 1), randf_range(0.06, 0.08))
|
||||
ship.modulate = color_player
|
||||
ship.material.set_shader_parameter('color',color_player)
|
||||
bases.modulate = color_base
|
||||
enemy_faction.modulate = color_enemy
|
||||
enemy_faction.changeitemscolor()
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ func changeitemscolor():
|
|||
var items = get_children()
|
||||
var ship = get_tree().current_scene.ship
|
||||
for item in items:
|
||||
item.modulate = modulate
|
||||
#item.modulate = modulate
|
||||
if item.material:
|
||||
item.material.set_shader_parameter("color",modulate)
|
||||
if faction:
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ func _process(_delta):
|
|||
if hull.hp < 0: destroy()
|
||||
|
||||
func changeinterfacecolor():
|
||||
$GUI/Interface.modulate = modulate
|
||||
$GUI/Interface.modulate = material.get_shader_parameter('color')
|
||||
|
||||
func destroy():
|
||||
hull.hp = hull.max_hp
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ extends Control
|
|||
var markers = []
|
||||
|
||||
func _process(_delta):
|
||||
$Sprite.self_modulate = ship.modulate
|
||||
$Sprite.self_modulate = ship.material.get_shader_parameter('color')
|
||||
|
||||
func add_marker(target : Node, type : String):
|
||||
var marker_inst = marker.instantiate()
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@ func _process(_delta):
|
|||
rotation = ship.global_position.angle_to_point(target.global_position)
|
||||
var sp_scale = 1024 / clamp(ship.global_position.distance_to(target.global_position), 512, 2048)
|
||||
marker.scale = Vector2(sp_scale, sp_scale)
|
||||
modulate = target.modulate
|
||||
modulate = target.material.get_shader_parameter("color")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue