-
Notifications
You must be signed in to change notification settings - Fork 17
Widget_Item2D
ben-mkiv edited this page Dec 9, 2023
·
4 revisions
widget = component.glasses.addItem2D()
-- adds a Item Icon to the 2D Overlay
setItem(String:name, Integer:meta):boolean
-- sets the widget item by its name and metaindex
-- returns false if the item couldn't be found/set, otherwise it's true
-- add widget which shows an iron sword
glassesTerminal = require("component").glasses
glassesTerminal.removeAll()
Widget_ItemIcon = glassesTerminal.addItem2D()
Widget_ItemIcon.setItem("minecraft:iron_sword", 0)
Widget_ItemIcon.addTranslation(50, 50, 0) -- modifier #1 (translate the render position on the viewport)
Widget_ItemIcon.addScale(40, 40, 40) -- modifier #2 (scale the render matrix)