Hewbrew+unicode=hell
This commit is contained in:
parent
76f3da5da7
commit
ca1fe9d9d0
27 changed files with 460 additions and 115 deletions
|
|
@ -13,9 +13,10 @@ import love.distributedrebirth.unicode4d.draw.DrawGlyphPath.ImGlyphQuadCurveTo;
|
|||
public class ImCharacter {
|
||||
|
||||
public static final float HEIGHT = 26f;
|
||||
public static final float WIDTH = 22f;
|
||||
public static final float MARGIN_MENUBAR = 4f;
|
||||
private static final ImVec2 SIZE = new ImVec2(22f, HEIGHT);
|
||||
private static final int COLOR = ImColor.intToColor(255, 255, 255, 255);
|
||||
private static final ImVec2 SIZE = new ImVec2(WIDTH, HEIGHT);
|
||||
private static final int DEFAULT_COLOR = ImColor.intToColor(255, 255, 255, 255);
|
||||
|
||||
public static void render(DrawCharacter drawChar) {
|
||||
ImGui.invisibleButton("canvas", SIZE.x, SIZE.y);
|
||||
|
|
@ -23,10 +24,13 @@ public class ImCharacter {
|
|||
ImVec2 p1 = ImGui.getItemRectMax(); // p1 = p0 + size
|
||||
ImDrawList drawList = ImGui.getWindowDrawList();
|
||||
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
|
||||
|
||||
// draw unicode4D
|
||||
float xOff = p0.x;
|
||||
float yOff = p0.y + 19f;
|
||||
drawUnicode4D(drawChar, p0.x, p0.y, DEFAULT_COLOR, drawList);
|
||||
drawList.popClipRect();
|
||||
}
|
||||
|
||||
public static void drawUnicode4D(DrawCharacter drawChar, float posX, float posY, int color, ImDrawList drawList) {
|
||||
float xOff = posX;
|
||||
float yOff = posY + 19f;
|
||||
float yFlip = -1f;
|
||||
float scale = 0.0199f;
|
||||
if (drawChar.getyMax() > 900) {
|
||||
|
|
@ -47,7 +51,7 @@ public class ImCharacter {
|
|||
yOff+prev.getY()*scale*yFlip,
|
||||
xOff+lineTo.getX()*scale,
|
||||
yOff+lineTo.getY()*scale*yFlip,
|
||||
COLOR);
|
||||
color);
|
||||
prev = cmd;
|
||||
continue;
|
||||
}
|
||||
|
|
@ -60,7 +64,7 @@ public class ImCharacter {
|
|||
yOff+quadCurveTo.getY1()*scale*yFlip,
|
||||
xOff+quadCurveTo.getX()*scale,
|
||||
yOff+quadCurveTo.getY()*scale*yFlip,
|
||||
COLOR,
|
||||
color,
|
||||
1);
|
||||
prev = cmd;
|
||||
continue;
|
||||
|
|
@ -71,11 +75,8 @@ public class ImCharacter {
|
|||
yOff+prev.getY()*scale*yFlip,
|
||||
xOff+first.getX()*scale,
|
||||
yOff+first.getY()*scale*yFlip,
|
||||
COLOR);
|
||||
color);
|
||||
}
|
||||
}
|
||||
//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), 1f);
|
||||
drawList.popClipRect();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue