-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved the experimental visualizer
- Loading branch information
Showing
18 changed files
with
746 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[gd_resource type="LabelSettings" load_steps=2 format=3 uid="uid://bk6ghtaibqhya"] | ||
|
||
[ext_resource type="FontFile" uid="uid://dpthqbkpqte48" path="res://Fonts/Kenney Pixel.ttf" id="1_g83er"] | ||
|
||
[resource] | ||
font = ExtResource("1_g83er") | ||
font_size = 18 | ||
font_color = Color(0.509804, 0.509804, 0.509804, 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The license for the files '../Fonts/Kenney Mini.ttf' | ||
and '../Fonts/Kenney Pixel.ttf' is provided below. | ||
|
||
--- | ||
|
||
Font package (free) | ||
|
||
Created/distributed by Kenney (www.kenney.nl) | ||
|
||
------------------------------ | ||
|
||
License: (Creative Commons Zero, CC0) | ||
http://creativecommons.org/publicdomain/zero/1.0/ | ||
|
||
This content is free to use in personal, educational and commercial projects. | ||
Support us by crediting (Kenney or www.kenney.nl), this is not mandatory. | ||
|
||
------------------------------ | ||
|
||
Donate: http://support.kenney.nl | ||
Request: http://request.kenney.nl | ||
Patreon: http://patreon.com/kenney/ | ||
|
||
Follow on Twitter for updates: | ||
@KenneyNL |
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
Syllabore/Syllabore.Visualizer/Fonts/Kenney Mini.ttf.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[remap] | ||
|
||
importer="font_data_dynamic" | ||
type="FontFile" | ||
uid="uid://8dcyb60yu3ub" | ||
path="res://.godot/imported/Kenney Mini.ttf-cae9f4188ec099302813ee760aa78bae.fontdata" | ||
|
||
[deps] | ||
|
||
source_file="res://Fonts/Kenney Mini.ttf" | ||
dest_files=["res://.godot/imported/Kenney Mini.ttf-cae9f4188ec099302813ee760aa78bae.fontdata"] | ||
|
||
[params] | ||
|
||
Rendering=null | ||
antialiasing=1 | ||
generate_mipmaps=false | ||
multichannel_signed_distance_field=false | ||
msdf_pixel_range=8 | ||
msdf_size=48 | ||
allow_system_fallback=true | ||
force_autohinter=false | ||
hinting=1 | ||
subpixel_positioning=1 | ||
oversampling=0.0 | ||
Fallbacks=null | ||
fallbacks=[] | ||
Compress=null | ||
compress=true | ||
preload=[] | ||
language_support={} | ||
script_support={} | ||
opentype_features={} |
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
Syllabore/Syllabore.Visualizer/Fonts/Kenney Pixel.ttf.import
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[remap] | ||
|
||
importer="font_data_dynamic" | ||
type="FontFile" | ||
uid="uid://dpthqbkpqte48" | ||
path="res://.godot/imported/Kenney Pixel.ttf-81d50fd9036595aeb2ef7347717d979e.fontdata" | ||
|
||
[deps] | ||
|
||
source_file="res://Fonts/Kenney Pixel.ttf" | ||
dest_files=["res://.godot/imported/Kenney Pixel.ttf-81d50fd9036595aeb2ef7347717d979e.fontdata"] | ||
|
||
[params] | ||
|
||
Rendering=null | ||
antialiasing=1 | ||
generate_mipmaps=false | ||
multichannel_signed_distance_field=false | ||
msdf_pixel_range=8 | ||
msdf_size=48 | ||
allow_system_fallback=true | ||
force_autohinter=false | ||
hinting=1 | ||
subpixel_positioning=1 | ||
oversampling=0.0 | ||
Fallbacks=null | ||
fallbacks=[] | ||
Compress=null | ||
compress=true | ||
preload=[] | ||
language_support={} | ||
script_support={} | ||
opentype_features={} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using Godot; | ||
using System; | ||
|
||
public partial class GraphemeEditor : Control | ||
{ | ||
public event Action GraphemeEditorChanged; | ||
|
||
protected virtual void OnGraphemeEditorChanged() | ||
{ | ||
GraphemeEditorChanged?.Invoke(); | ||
} | ||
|
||
protected virtual void OnVSliderChanged(float value) | ||
{ | ||
this.UpdatePercentageLabel(value); | ||
GraphemeEditorChanged?.Invoke(); | ||
} | ||
|
||
protected virtual void OnCheckBoxToggled(bool buttonPressed) | ||
{ | ||
this.UpdateEnabledStatus(); | ||
this.GetNode<CheckBox>("LeftPanel/CheckBox").ReleaseFocus(); | ||
GraphemeEditorChanged?.Invoke(); | ||
} | ||
|
||
public string LabelText | ||
{ | ||
get | ||
{ | ||
return this.GetNode<Label>("LeftPanel/Label").Text; | ||
} | ||
set | ||
{ | ||
this.GetNode<Label>("LeftPanel/Label").Text = value; | ||
} | ||
} | ||
|
||
public string Text | ||
{ | ||
get | ||
{ | ||
return this.GetNode<TextEdit>("LeftPanel/TextEdit").Text; | ||
} | ||
set | ||
{ | ||
|
||
this.GetNode<TextEdit>("LeftPanel/TextEdit").Text = value; | ||
} | ||
} | ||
|
||
public bool Enabled | ||
{ | ||
get | ||
{ | ||
return this.GetNode<CheckBox>("LeftPanel/CheckBox").ButtonPressed; | ||
} | ||
set | ||
{ | ||
this.GetNode<CheckBox>("LeftPanel/CheckBox").ButtonPressed = value; | ||
this.UpdateEnabledStatus(); | ||
} | ||
} | ||
|
||
public double Probability | ||
{ | ||
get | ||
{ | ||
var vSlider = this.GetNode<VSlider>("RightPanel/VSlider"); | ||
return vSlider.Value / vSlider.MaxValue; // Normalize to [0,1] | ||
} | ||
set | ||
{ | ||
var vSlider = this.GetNode<VSlider>("RightPanel/VSlider"); | ||
this.GetNode<VSlider>("RightPanel/VSlider").Value = value * vSlider.MaxValue; // Normalize to [0,100] | ||
this.UpdatePercentageLabel(value * vSlider.MaxValue); | ||
} | ||
} | ||
|
||
public void UpdateEnabledStatus() | ||
{ | ||
this.GetNode<TextEdit>("LeftPanel/TextEdit").Editable = this.Enabled; | ||
this.GetNode<VSlider>("RightPanel/VSlider").Editable = this.Enabled; | ||
} | ||
|
||
private void UpdatePercentageLabel(double value) | ||
{ | ||
this.GetNode<Label>("RightPanel/PercentageLabel").Text = $"{(int)value}%"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://dfh0hshtdjms1"] | ||
|
||
[ext_resource type="Script" path="res://GraphemeEditor.cs" id="1_7by6n"] | ||
[ext_resource type="LabelSettings" uid="uid://bk6ghtaibqhya" path="res://EditorLabelGray.tres" id="1_886yt"] | ||
[ext_resource type="FontFile" uid="uid://8dcyb60yu3ub" path="res://Fonts/Kenney Mini.ttf" id="3_5e4ym"] | ||
|
||
[sub_resource type="LabelSettings" id="LabelSettings_yvqpb"] | ||
font = ExtResource("3_5e4ym") | ||
|
||
[node name="GraphemeEditor" type="Control"] | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
offset_right = -940.0 | ||
offset_bottom = -700.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_7by6n") | ||
|
||
[node name="LeftPanel" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_right = 170.0 | ||
offset_bottom = 70.0 | ||
|
||
[node name="Label" type="Label" parent="LeftPanel"] | ||
layout_mode = 0 | ||
offset_left = 26.0 | ||
offset_top = 2.0 | ||
offset_right = 166.0 | ||
offset_bottom = 25.0 | ||
text = "Grapheme Label" | ||
label_settings = ExtResource("1_886yt") | ||
vertical_alignment = 1 | ||
|
||
[node name="TextEdit" type="TextEdit" parent="LeftPanel"] | ||
layout_mode = 0 | ||
offset_left = 5.0 | ||
offset_top = 25.0 | ||
offset_right = 165.0 | ||
offset_bottom = 62.0 | ||
|
||
[node name="CheckBox" type="CheckBox" parent="LeftPanel"] | ||
layout_mode = 0 | ||
offset_top = 2.0 | ||
offset_right = 24.0 | ||
offset_bottom = 26.0 | ||
|
||
[node name="RightPanel" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_left = 177.0 | ||
offset_right = 252.0 | ||
offset_bottom = 70.0 | ||
|
||
[node name="VSlider" type="VSlider" parent="RightPanel"] | ||
layout_mode = 0 | ||
offset_left = 1.0 | ||
offset_top = 5.0 | ||
offset_right = 27.0 | ||
offset_bottom = 62.0 | ||
value = 100.0 | ||
|
||
[node name="PercentageLabel" type="Label" parent="RightPanel"] | ||
layout_mode = 0 | ||
offset_left = 25.0 | ||
offset_top = 9.0 | ||
offset_right = 67.0 | ||
offset_bottom = 61.0 | ||
text = "100%" | ||
label_settings = SubResource("LabelSettings_yvqpb") | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[node name="Label" type="Label" parent="RightPanel"] | ||
visible = false | ||
layout_mode = 0 | ||
offset_left = 1.0 | ||
offset_top = 2.0 | ||
offset_right = 74.0 | ||
offset_bottom = 25.0 | ||
text = "Probability" | ||
label_settings = ExtResource("1_886yt") | ||
horizontal_alignment = 1 | ||
vertical_alignment = 1 | ||
|
||
[connection signal="text_changed" from="LeftPanel/TextEdit" to="." method="OnGraphemeEditorChanged"] | ||
[connection signal="toggled" from="LeftPanel/CheckBox" to="." method="OnCheckBoxToggled"] | ||
[connection signal="value_changed" from="RightPanel/VSlider" to="." method="OnVSliderChanged"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace Syllabore.Visualizer | ||
{ | ||
public interface ITemporalController | ||
{ | ||
public bool IsSlowed { get; set; } | ||
public bool IsPaused { get; set; } | ||
|
||
} | ||
} |
Oops, something went wrong.