Now, how do I draw an image to the container? I need them to be "attached". You'll see why soon.
I also need to make the rectangles and what they contain drag and dropable. I know I need to get the object, and it's position on the screen, but that's all I can figure out. I assume the code needs to be in the mouse methods, something like onClick? Any help would be appreciated.
public int getBlockTextureFromSide(int i)
{
switch (i)
{
case 0: return 0;
case 1: return 1;
case 2: return 2;
case 3: return 3;
case 4: return 4;
case 5: return 5; }
return blockIndexInTexture;
}
Would something like that help? The way you render a multi-texture block?
where return 0-5 would be what ever spots on your texture .png
the Case 0-5 would be all the sides.??
public int getBlockTextureFromSide(int i)
{
switch (i)
{
case 0: return 0;
case 1: return 1;
case 2: return 2;
case 3: return 3;
case 4: return 4;
case 5: return 5; }
return blockIndexInTexture;
}
Would something like that help? The way you render a multi-texture block?
where return 0-5 would be what ever spots on your texture .png
the Case 0-5 would be all the sides.??
Thanks for the reply, but not really what I'm after.
I'm trying to render an image (say, like the minecraft logo) constantly on the screen.
Are you wanting to draw a gui constantly on the ingame screen? Or draw these rectangles on a screen/gui you're making that will, for example, be opened by the player?
If you're using Forge (hope you are;)) you should set up a tick handler. Then use that tick handler to draw your HUD element (what I'm going to call it).
Here's my example of the tick handler: https://github.com/bau5/Alptraum/blob/master/_bau5/alptraum/AlpTicker.java
The code for the HUD isn't in there, but you'd want to have that class have a variable of your HUD element class and then call the draw method from it on every tick. I've done this before and it works perfect. I used this method to put something on the in game screen that was sort of like another hunger or health bar. You can use the same idea to accomplish what you're wanting.
If you're using Forge (hope you are;)) you should set up a tick handler. Then use that tick handler to draw your HUD element (what I'm going to call it).
Here's my example of the tick handler: https://github.com/b.../AlpTicker.java
The code for the HUD isn't in there, but you'd want to have that class have a variable of your HUD element class and then call the draw method from it on every tick. I've done this before and it works perfect. I used this method to put something on the in game screen that was sort of like another hunger or health bar. You can use the same idea to accomplish what you're wanting.
I have the tick handler, I just can't actually draw the images. I can't find the code. (The GL11.whatever and GL12.whatever stuff).
Right now, I'm using this to draw the rectangles:
Now, how do I draw an image to the container? I need them to be "attached". You'll see why soon.
I also need to make the rectangles and what they contain drag and dropable. I know I need to get the object, and it's position on the screen, but that's all I can figure out. I assume the code needs to be in the mouse methods, something like onClick? Any help would be appreciated.
Would something like that help? The way you render a multi-texture block?
where return 0-5 would be what ever spots on your texture .png
the Case 0-5 would be all the sides.??
Thanks for the reply, but not really what I'm after.
I'm trying to render an image (say, like the minecraft logo) constantly on the screen.
https://code.google.com/p/endercraft/source/browse/trunk/mod_endercraft/GuiEnderHUD.java
Thanks, I'll look into that.
Still haven't tried your method yet dmiller.
Here's my example of the tick handler: https://github.com/bau5/Alptraum/blob/master/_bau5/alptraum/AlpTicker.java
The code for the HUD isn't in there, but you'd want to have that class have a variable of your HUD element class and then call the draw method from it on every tick. I've done this before and it works perfect. I used this method to put something on the in game screen that was sort of like another hunger or health bar. You can use the same idea to accomplish what you're wanting.
I have the tick handler, I just can't actually draw the images. I can't find the code. (The GL11.whatever and GL12.whatever stuff).
I found this in GuiInGame:
Adapt that to your needs and it will probably work just fine.