DearImGui 图标

DearImGui

作者:rebot | 分类:模组

价格:0 墨喵币 下载量:0 点赞:0 版本 0.1.0+1.18.2-fabric
本资源为搬运资源,原资源地址: https://modrinth.com/mod/dearimgui
资源信息

Minecraft 版本: 1.18.2

平台: fabric

标签: decoration library utility

资源介绍

DearImGui for Minecraft

A basic library mod giving developers the ability to use ImGui within Minecraft.


Discord Badge
Ko-Fi Badge


Usage

Setup

You need to add it as a dependency in your build.gradle(.kts) file.

repositories {
    maven("https://maven.deftu.dev/snapshots")
}

dependencies {
    modImplementation("dev.deftu:dearimguimc-<MINECRAFTVERSION>-fabric:<VERSION>")
}

Of course, replace <MINECRAFTVERSION> with the version of Minecraft you are developing for, and <VERSION> with the version of the library you want to use.

Rendering

To render for ImGui, you need to create your own DearImGuiEntrypoint and add it to your fabric.mod.json file,

{
    "entrypoints": {
        "imgui": ["your.package.here.DearImGuiEntrypoint"]
    }
}

DearImGuiEntrypoint has two methods you can override - createRenderer and render.

public class ExampleDearImGuiEntrypoint implements DearImGuiEntrypoint {

    @Override
    public ImGuiRenderer createRenderer() {
        return new ExampleImGuiRenderer();
    }

    @Override
    public void render() {
        // Render ImGui here
    }

}

Both ultimately achieve the same goal, but createRenderer is more flexible and allows you to pass in additional parameters to your renderer.

Example Rendering

public class ExampleImGuiRenderer implements ImGuiRenderer {

    @Override
    public void render() {
        ImGui.showDemoWindow();
    }

}
public class ExampleDearImGuiEntrypoint implements DearImGuiEntrypoint {

    @Override
    public void render() {
        ImGui.showDemoWindow();
    }

}

BisectHosting


This project is licensed under LGPL-3.0\
© 2024 Deftu

下载太慢?试试 墨喵加速站,支持 Modrinth 和外网直链高速下载! 用的人越多,下载的越快!
下载与版本
评论(0)
登录 后发表评论。

暂无评论,抢个沙发吧~

举报此资源

请登录后举报

🔥 相关推荐
absolut3 Totem of Undying

价格:0 墨喵币
下载量:0

查看详情
Performy

价格:0 墨喵币
下载量:0

查看详情
Create: Golden ticket and chocolates

价格:0 墨喵币
下载量:0

查看详情
Create: Think Bigger! (Server Side)

价格:0 墨喵币
下载量:0

查看详情