Added 60 part

This commit is contained in:
Willem Cazander 2022-01-31 01:12:29 +01:00
parent 390a6c657e
commit 3763ee3fdd
20 changed files with 184 additions and 97 deletions

View file

@ -0,0 +1,63 @@
package love.distributedrebirth.demo4d.screen;
import java.util.Arrays;
import java.util.List;
import imgui.ImGui;
import imgui.flag.ImGuiCond;
import imgui.flag.ImGuiTableFlags;
import imgui.type.ImBoolean;
import love.distributedrebirth.demo4d.Demo4DMain;
import love.distributedrebirth.demo4d.ImGuiRendererMain;
import love.distributedrebirth.numberxd.base2t.T60Sexagesimal;
import love.distributedrebirth.numberxd.base2t.facet.BasePart;
/**
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class BasePartRenderer extends ImGuiRendererMain {
public BasePartRenderer(Demo4DMain main) {
super(main);
}
@Override
public void render(ImBoolean widgetOpen) {
ImGui.setNextWindowPos(200, 200, ImGuiCond.FirstUseEver);
ImGui.setNextWindowSize(640, 480, ImGuiCond.FirstUseEver);
ImGui.begin("Base part", widgetOpen);
ImGui.text("Current part type:");
ImGui.sameLine();
ImGui.text("T60Sexagesimal");
int flags = ImGuiTableFlags.ScrollX | ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersOuter | ImGuiTableFlags.BordersV;
ImGui.beginTable("base-part", 5, flags);
ImGui.tableSetupColumn("ordinal");
ImGui.tableSetupColumn("idTone");
ImGui.tableSetupColumn("idLetter");
ImGui.tableSetupColumn("ChinaKey");
ImGui.tableSetupColumn("ChinaValue");
ImGui.tableHeadersRow();
List<BasePart> parts = Arrays.asList(T60Sexagesimal.values());
for (BasePart part:parts) {
ImGui.tableNextRow();
ImGui.tableNextColumn();
ImGui.text(Integer.toString(part.ordinal()));
ImGui.tableNextColumn();
ImGui.text(part.getIdentifierTone());
ImGui.tableNextColumn();
ImGui.text(part.getIdentifierLetter());
ImGui.tableNextColumn();
ImGui.text(part.getChinaKey());
ImGui.tableNextColumn();
ImGui.text(part.getChinaValue());
}
ImGui.endTable();
ImGui.end();
}
}

View file

@ -32,19 +32,10 @@ public class ScreenUnicode4D extends Demo4DMainAdapter {
ImVec2 size = new ImVec2(144f, 48f);
ImGui.invisibleButton("canvas", size.x, size.y);
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax();
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
// draw unicode4D
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
drawList.addQuad(p0.x, p0.y, p0.x+size.x, p0.y, p1.x, p1.y, p0.x, p0.y+size.y,
ImColor.intToColor(127, 127, 255, 255), 5f);
@ -54,5 +45,14 @@ public class ScreenUnicode4D extends Demo4DMainAdapter {
drawList.popClipRect();
ImGui.end();
//System.out.println("p0.x="+p0.x+" p0.y="+p0.y);
//System.out.println("p1.x="+p1.x+" p1.y="+p1.y);
// for (int n = 0; n < (1.0f + Math.sin(ImGui.getTime() * 5.7f)) * 40.0f; n++) {
// drawList.addCircle(p0.x + size.x * 0.5f, p0.y + size.y * 0.5f, size.y * (0.01f + n * 0.03f),
// ImColor.intToColor(255, 140 - n * 4, n * 3, 255)
// );
// }
}
}