-
Notifications
You must be signed in to change notification settings - Fork 18
Widget_Text2D
ben-mkiv edited this page Feb 14, 2019
·
6 revisions
widget = component.glasses.addText2D()
-- adds a Text to the 2D Overlaywidget.setText("My Text")
-- sets the text string
widget.getText():String
-- returns configured textmethods here may change, specially from which location and how fonts get loaded, currently fonts installed on your pc are used.
require("component").glasses.getFonts()
-- shows a list of available fonts
-- this runs serverside so it may include fonts that arent available on your client!
widget.setFont(String:fontName)
-- sets a font (empty string resets the font to vanilla minecraft font)
widget.setAntialias(Boolean:enabled)
-- enables/disables antialiasing for TrueType Fonts
-- (doesnt affect vanilla font rendering)
widget.setFontSize(Integer:fontSize)
-- sets the TrueTypeFont size
-- (doesnt affect vanilla font rendering)-- add a truetype text
glasses = require("component").glasses
widget = component.glasses.addText2D()
widget.setText("Hello World")
widget.setFont("verdana")
widget.setFontSize(24)