Jump to content

how to build an item that can dynamically change its texture?


MarMan

Recommended Posts

My goal is to have something like a tablet computer in minecraft. Similar as the map (http://minecraft.gamepedia.com/Map) it should change its texture dynamically. The screen should show information like found in the debug screen [F3]. (Yes, it would be superfluous, but much more pretty in my opinion.)

 

By way of illustration:

https://dl.dropboxusercontent.com/u/43694603/tablet.png

 

How can i bring ever-changing content (text...) on an item's texture?

Link to comment
Share on other sites

Ok thank you very much! You seem to know how that works, but that was a really short explaination :D.

 

The only way adding item textures that i know is

    new Item().setTextureName("ID:Name").

 

How is MapItemRenderer to be used, when i have an Item object and nothing else?

 

Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill..

 

Is there maybe a more specific method?

Link to comment
Share on other sites

Ok thank you very much! You seem to know how that works,

:-P well to be honest actually I'm just figuring this out as I go, plus a bit of background knowledge

 

but that was a really short explaination :D.

I wouldn't want to rob you of the satisfaction of a thrilling voyage of discovery :)

 

For me, a lot of the fun of programming minecraft is trying to pick my way through this incomprehensible swamp of vanilla code until it finally goes 'click' in my head and I understand how it works.  I think it's a very important skill for anyone who's going to try something more complicated than a new Block and a couple of recipes...

 

Furthermore i actually only need *text*, that is updated in certain time intervals and write it onto that texture. Realizing that using a RGB array might be overkill..

 

Is there maybe a more specific method?

If you just need text, that's relatively simple; you could try looking into the FontRenderer.  It's scattered all throughout the vanilla code, for example the debug screen in Minecraft.displayDebugInfo; or the number of items in an itemstack in RenderItem.renderItemOverlayIntoGUI()

 

-TGG

 

 

 

Link to comment
Share on other sites

Now i'm stuck because i can not find a Forge Event that is fired when the player selects an item in the hotbar :(. Going through net.minecraftforge.event.* it seems like such an event doesn't exist.

 

Can somebody help, maybe describing a workaround for my intention?

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.