About

Ads Here

Minggu, 11 Agustus 2013

Rendering Items


Rendering items is a bit complicated because there are a number of different places they can be seen:
  • In the inventory (also in the Speedbar overlay) – referred to in Vanilla code as a GUI item (graphical user interface) and in Forge code as InventoryItem
  • Equipped (held in the player’s hand) – in first person view or third person view – referred to as EquippedItem.
  • Dropped (on the ground)- referred to as EntityItem and DroppedItem
  • In a picture frame – EntityItemFrame – rendered as an EntityItem, with the RenderItem.renderInFrame flag set.

In addition to this,
  • Most Items which are also Blocks are rendered in 3D (eg TNT), which uses a rendering method provided by the Block.
  • If fancy graphics are enabled, Items and 2D Blocks have thickness and also slowly rotate.
  • There are several flags which affect the display of items such as bobbing, rotation.
  •  ItemStack (multiple items/blocks) render with a number in the GUI overlay and as a pile of minicubes when dropped.

The pictures below show these various different renders:

Item (Pickaxe) and 3D Block (TNT) rendered into the GUI (InventoryItem)

 Fancy graphics enabled.
GUI items (red): Item (pickaxe),  3D Block (TNT), 2D Block (Bed), multiple blocks (Dirt)
Equipped Item (pickaxe blue circle);
Dropped Item/EntityItems (purple):  Item (Pickaxe), 3D Block (TNT), 2D Block (Bed), multiple blocks rendered as minicubes (Dirt)

Fancy graphics disabled.
 Dropped Item/EntityItems (yellow):  Item (Pickaxe), 2D Block (Bed)

Equipped Item - first person view: 3D block (TNT)

Equipped item - third person view: 3D block (TNT)


Items rendered in frames - rendered as per EntityItem: Item (pickaxe), 2D Block (bed), 3D Block (TNT)


Tidak ada komentar:

Posting Komentar