Conversation
This reverts commit 59f7056.
|
CraftNG #25 (comment) has a good start of an inventory system: specifically these commits at least: twetzel59/CraftNG@a604e73 twetzel59/CraftNG@3b44099 and twetzel59/CraftNG@7e7c624. Cherry-picked them and got the beginning of an inventory: The next/previous E/R keys and 0-9 cycle the available blocks, so the bottommost block is active for placement, the others above serve as previews. |
|
I think the offset is caused discrepancy is caused by using direct manipulation of the matrix instead of stacked matrix transformations, e.g. in set_matrix_item: - mat_translate(b, -xoffset, -yoffset, 0);
+ mat_translate(b, -xoffset + 1.75f, -yoffset, 0);and render_item: if (!i) {
set_matrix_item(matrix, g->width, g->height, g->scale);
matrix[12] += 0.08f;
matrix[13] += 0.1f;
}
matrix[13] += 0.25f;
|
|
Reducing scope of this pull request: #177 |
) * Cherry-pick from "HUD expansion": twetzel59/CraftNG@a604e73 * Decrease item rendering size to 32 * Rename _item to item_hotbar to clarify its purpose * Revert "Rename _item to item_hotbar to clarify its purpose" This reverts commit 59f7056. * Cherry-pick item counts from "Inventory with HUD." twetzel59/CraftNG@3b44099 twetzel59/CraftNG@7e7c624 * Refactor render_item_count tx/ty * Move the hotbar flush up against the right edge, fix width shifting #175 (comment) * Translate Z of item hotbar slightly to fix text overlap * Increase clipping plane and z translate to not overlap on web * Fix unnecessary whitespace after item count text * Zero-initialize fixed size (not variable) buf in render_item_count * Increase hotbar size to 9 items * Remove count labels from hotbar items for now










#18