NextInima Posted January 30, 2016 Posted January 30, 2016 i have a standart bar in minecraft int expbar = (int) (((double) 194) * (rins.getCURRENTLEVELEXP()) / rins.getNEXTLEVELMAXEXP()); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); drawTexturedModalRect(xPos -94, yPos - 32 + 3, 0, 9, expbar, 7); this is going normal like the normal expbar of minecraft. But how i can change the drawing from right to left to left to right? Quote May RPG MOD KoRIN at minecraftforum http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2570463-kingdom-of-rin-rpg-stuff-classes-dungeons http://rin-online.de/forum/
Failender Posted January 30, 2016 Posted January 30, 2016 1. calculate the size of the gui to draw 2. calculate the x where u want to start to draw (xmax-size) 3. draw the gui! Quote
NextInima Posted January 30, 2016 Author Posted January 30, 2016 can i draw rect with minus widht and hight? sorry my english is not so good... Quote May RPG MOD KoRIN at minecraftforum http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2570463-kingdom-of-rin-rpg-stuff-classes-dungeons http://rin-online.de/forum/
NextInima Posted January 31, 2016 Author Posted January 31, 2016 I cant find a way to solve this problem. here is my bar http://redsun.do.am/2016-01-31_01.33.18.png the 2 bars on top are render the same, but i want the left bar to render right to left. can write so good english i hope you understand it. Quote May RPG MOD KoRIN at minecraftforum http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2570463-kingdom-of-rin-rpg-stuff-classes-dungeons http://rin-online.de/forum/
Ernio Posted January 31, 2016 Posted January 31, 2016 You should really learn tesselator (and math?) to understand the drawing process. The method you are using now: drawTexturedModalRect(xPos -94, yPos - 32 + 3, 0, 9, expbar, 7); Is pretty much: Draw box from x/y, with width/height. So logically, when width is your progress, the "walls" of box are at: left: x right: x+progress top: y bot: y+height To draw in reverse you would need to have: left: x+max-progress right: x+max top: y bot: y+height Converted to drawing: drawTexturedModalRect(xPos + 194 - expbar, yPos - 29, 0, 9, expbar, 7); But that is just plain stupid if you can easily learn tess and draw nice things, example: wr.addVertex(right, top, zLevel); // top right corner wr.addVertex(left, top, zLevel); // top left corner wr.addVertex(left, bottom, zLevel); // bot left wr.addVertex(right, bottom, zLevel); // bot right This draws a box with said 4 corners. Since vertexes go anti-clockwise, you add them in this order. Look at "drawTexturedModalRect" on how to implement it, I leave it as an exerice. Read more: http://greyminecraftcoder.blogspot.com.au/2013/08/the-tessellator.html Quote 1.7.10 is no longer supported by forge, you are on your own.
NextInima Posted January 31, 2016 Author Posted January 31, 2016 thank you i think i understand it now, maybe i will draw it all with tessel now. i will try some stuff Quote May RPG MOD KoRIN at minecraftforum http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/2570463-kingdom-of-rin-rpg-stuff-classes-dungeons http://rin-online.de/forum/
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.