Okay, okay, it's VERY BAD DESIGN© to use numbers as grades in MJ. But it's internationalized, and it's quick to type. The objective is to reduce the required effort to vote. Ideas welcome.master
parent
6688138328
commit
4792f7d59a
@ -0,0 +1,5 @@
|
||||
extends ColorRect
|
||||
|
||||
|
||||
func set_grade_icon(_grade_icon:Texture):
|
||||
get_material().set_shader_param("grade_icon", _grade_icon)
|
@ -1,8 +1,19 @@
|
||||
[gd_scene format=2]
|
||||
[gd_scene load_steps=5 format=2]
|
||||
|
||||
[ext_resource path="res://addons/majority_judgment/shaders/linear_grade.shader" type="Shader" id=1]
|
||||
[ext_resource path="res://addons/majority_judgment/nodes/MajorityJudgmentLinearGradeNode.gd" type="Script" id=2]
|
||||
[ext_resource path="res://sprites/grades/number_0.png" type="Texture" id=3]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
resource_local_to_scene = true
|
||||
shader = ExtResource( 1 )
|
||||
shader_param/grade_icon = ExtResource( 3 )
|
||||
|
||||
[node name="MajorityJudgmentLinearGradeNode" type="ColorRect"]
|
||||
material = SubResource( 1 )
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
@ -0,0 +1,54 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D grade_icon;
|
||||
|
||||
void fragment() {
|
||||
vec4 final_color = COLOR;
|
||||
|
||||
vec4 texture_color_waves1 = texture(grade_icon, UV*(1.0+sin(FRAGCOORD.x*0.013+TIME+FRAGCOORD.y*0.05)));
|
||||
final_color.rgb = mix(
|
||||
final_color.rgb,
|
||||
final_color.rgb * 0.97,
|
||||
texture_color_waves1.a
|
||||
);
|
||||
|
||||
vec4 texture_color_waves2 = texture(grade_icon, vec2(UV.x*1.2-0.1, float(int(FRAGCOORD.y+TIME*23.0)%60)/50.0));
|
||||
final_color.rgb = mix(
|
||||
final_color.rgb,
|
||||
final_color.rgb * 0.95,
|
||||
texture_color_waves2.a
|
||||
);
|
||||
|
||||
int step_size_x = 7;
|
||||
int step_size_y = 9;
|
||||
vec4 texture_color_waves3 = texture(grade_icon, vec2(
|
||||
float(int(FRAGCOORD.x-TIME*3.0)%step_size_x)/float(step_size_x-1),
|
||||
1.0-float(int(FRAGCOORD.y-TIME)%step_size_y)/float(step_size_y-1)
|
||||
));
|
||||
final_color.rgb = mix(
|
||||
final_color.rgb,
|
||||
final_color.rgb * 0.91,
|
||||
texture_color_waves3.a
|
||||
);
|
||||
|
||||
// Stretched
|
||||
vec4 texture_color_base = texture(grade_icon, UV);
|
||||
final_color.rgb = mix(
|
||||
final_color.rgb,
|
||||
final_color.rgb * 0.80,
|
||||
texture_color_base.a
|
||||
);
|
||||
|
||||
|
||||
COLOR = final_color;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in new issue