gdxapp4d/gdxapp4d-lib-imxmi/src/main/java/love/distributedrebirth/imxmi/lang/ImFrameˣᴹᴵ.java

127 lines
3 KiB
Java
Raw Normal View History

2022-02-07 14:29:23 +01:00
package love.distributedrebirth.imxmi.lang;
2022-02-07 15:30:07 +01:00
import imgui.ImGui;
import imgui.flag.ImGuiCond;
import imgui.type.ImBoolean;
2022-10-17 16:42:12 +02:00
import love.distributedrebirth.bassboonyd.clazz.BãßBȍőnAuthor注;
2022-02-07 14:29:23 +01:00
2022-10-15 02:34:58 +02:00
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
2022-02-07 15:30:07 +01:00
public class ImFrameˣᴹᴵ extends AbstractImComponentSetˣᴹᴵ {
private String title;
private ImBoolean frameOpen;
private float nextWindowPosX;
private float nextWindowPosY;
private int nextWindowPosCond;
private float nextWindowSizeWidth;
private float nextWindowSizeHeight;
private int nextWindowSizeCond;
public ImFrameˣᴹᴵ() {
this(null, null);
}
public ImFrameˣᴹᴵ(String title, ImBoolean frameOpen) {
this.title = title;
this.frameOpen = frameOpen;
nextWindowPosX = 320;
nextWindowPosY = 240;
nextWindowPosCond = ImGuiCond.FirstUseEver;
nextWindowSizeWidth = 640;
nextWindowSizeHeight = 480;
nextWindowSizeCond = ImGuiCond.FirstUseEver;
}
@Override
public void renderBegin() {
ImGui.setNextWindowPos(nextWindowPosX, nextWindowPosY, nextWindowPosCond);
ImGui.setNextWindowSize(nextWindowSizeWidth, nextWindowSizeHeight, nextWindowSizeCond);
}
@Override
public void renderComponent() {
2022-02-08 21:21:33 +01:00
if (ImGui.begin(title, frameOpen)) {
renderComponents();
}
2022-02-07 15:30:07 +01:00
}
@Override
public void renderEnd() {
ImGui.end();
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public ImBoolean getFrameOpen() {
return frameOpen;
}
public void setFrameOpen(ImBoolean frameOpen) {
this.frameOpen = frameOpen;
}
2022-02-12 18:22:56 +01:00
public void setNextWindowPos(float nextWindowPosX, float nextWindowPosY) {
setNextWindowPosX(nextWindowPosX);
setNextWindowPosY(nextWindowPosY);
}
2022-02-07 15:30:07 +01:00
public float getNextWindowPosX() {
return nextWindowPosX;
}
public void setNextWindowPosX(float nextWindowPosX) {
this.nextWindowPosX = nextWindowPosX;
}
public float getNextWindowPosY() {
return nextWindowPosY;
}
public void setNextWindowPosY(float nextWindowPosY) {
this.nextWindowPosY = nextWindowPosY;
}
public int getNextWindowPosCond() {
return nextWindowPosCond;
}
public void setNextWindowPosCond(int nextWindowPosCond) {
this.nextWindowPosCond = nextWindowPosCond;
}
2022-02-12 18:22:56 +01:00
public void setNextWindowSize(float nextWindowSizeWidth, float nextWindowSizeHeight) {
setNextWindowSizeWidth(nextWindowSizeWidth);
setNextWindowSizeHeight(nextWindowSizeHeight);
}
2022-02-07 15:30:07 +01:00
public float getNextWindowSizeWidth() {
return nextWindowSizeWidth;
}
public void setNextWindowSizeWidth(float nextWindowSizeWidth) {
this.nextWindowSizeWidth = nextWindowSizeWidth;
}
public float getNextWindowSizeHeight() {
return nextWindowSizeHeight;
}
public void setNextWindowSizeHeight(float nextWindowSizeHeight) {
this.nextWindowSizeHeight = nextWindowSizeHeight;
}
public int getNextWindowSizeCond() {
return nextWindowSizeCond;
}
public void setNextWindowSizeCond(int nextWindowSizeCond) {
this.nextWindowSizeCond = nextWindowSizeCond;
}
2022-02-07 14:29:23 +01:00
}