How to render images on screen
-
@purpl3-yt use the image assest
-
@purpl3-yt use the image assest
@plumer-man I'm sorry I do not know how it works can you show an example code?
-
@plumer-man I'm sorry I do not know how it works can you show an example code?
@purpl3-yt You can use GL11.GL_QUADS to render an image, you just need to bind the image, in minecraft you bind the image like so
mc.getTextureManager().bindTexture(new ResourceLocation("path to resource or image inside /assets/minecraft/"))and render the quads like so:
GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord(0, 0); GL11.glVertex2d(x, y); GL11.glTexCoord(1, 0); GL11.glVertex2d(x2, y); GL11.glTexCoord(1, 1); GL11.glVertex2d(x2, y2); GL11.glTexCoord(0, 1); GL11.glVertex2d(x, y2); GL11.glEnd(); -
@purpl3-yt You can use GL11.GL_QUADS to render an image, you just need to bind the image, in minecraft you bind the image like so
mc.getTextureManager().bindTexture(new ResourceLocation("path to resource or image inside /assets/minecraft/"))and render the quads like so:
GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord(0, 0); GL11.glVertex2d(x, y); GL11.glTexCoord(1, 0); GL11.glVertex2d(x2, y); GL11.glTexCoord(1, 1); GL11.glVertex2d(x2, y2); GL11.glTexCoord(0, 1); GL11.glVertex2d(x, y2); GL11.glEnd();@throwaway39234 Thank you
-
P Purpl3 YT has marked this topic as solved on
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login