From 6cc49f3a40d5571f90b17d39189a842688aa8f21 Mon Sep 17 00:00:00 2001 From: spatialfree Date: Sun, 4 Feb 2024 01:42:00 -0500 Subject: [PATCH] basic txt entry --- sk_demo/src/Mono.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sk_demo/src/Mono.cs b/sk_demo/src/Mono.cs index 19d67a8..31d03ed 100644 --- a/sk_demo/src/Mono.cs +++ b/sk_demo/src/Mono.cs @@ -215,6 +215,8 @@ public class Mono { Vec3 index_pos = Vec3.Zero; int index_i = 0; + string txt = "hello "; + public void Init() { rig.Init(); @@ -223,6 +225,8 @@ public class Mono { mat_room.SetTexture("diffuse", Tex.FromFile("bake.png")); mesh_room = model_room.Nodes.First(n => n.Name == "Room").Mesh; + + keyboard_btn.held = true; } public void Run() { @@ -264,8 +268,12 @@ public class Mono { Log.Info($"index_i: {index_i}"); monoNet.value = index_i; monoNet.send = true; + txt += KeyToChar(index_i); } + + // RENDER RENDER RENDER + // keyboard Hierarchy.Push(keyboard_m4); // 3 rows of 10 keys @@ -323,6 +331,19 @@ public class Mono { keyboard_btn.held ? Color.Hex(0x00000090) : Color.Hex(0x80808090) ); + // text + // show over the keyboard + Text.Add( + txt, + Matrix.TS( + V.XYZ(0, -1, 0), + V.XYZ(-1, -1, 0) * 20.0f + ) * keyboard_m4, + TextAlign.CenterLeft, + TextAlign.CenterLeft, + 0, 0, 0 + ); + // WORLD mesh_room.Draw( mat_room,