Yue Posted March 23 Posted March 23 How can I change the font size for a widget? or how can I assign a new font to a specific widget? Quote
Yue Posted March 23 Author Posted March 23 Ok, solved here, size font. self.exitButton:SetFontScale(3) New Font for Widget? Quote
Solution Dreikblack Posted March 24 Solution Posted March 24 local font = LoadFont("Fonts/YourFont.ttf"); ui = CreateInterface(camera, font, framebufferSize) You can choose font only for whole interface when creating it. 1 Quote
Yue Posted March 25 Author Posted March 25 On 3/23/2025 at 7:52 PM, Dreikblack said: local font = LoadFont("Fonts/YourFont.ttf"); ui = CreateInterface(camera, font, framebufferSize) You can choose font only for whole interface when creating it. Widget Image? Quote
Dreikblack Posted March 25 Posted March 25 9 minutes ago, Yue said: Widget Image? https://www.leadwerks.com/learn/Widget_SetPixmap?lang=lua 1 Quote
Yue Posted March 25 Author Posted March 25 I'm just trying to understand how this works in widgets, what should I keep in mind when working with images in widgets? -- Método para agregar un msgbox. function this:CreateMsgBox(id, text, x, y, width, height, buttons) local panel = self.gui:AddPanel(id, x, y, width, height) local title = "INFO" self.labelInfo = self.gui:AddLabel(id, title, 0, 0, width, height - 120, panel, LABEL_CENTER + LABEL_MIDDLE) self.labelInfo:SetFontScale(2.5) self.label = self.gui:AddLabel(id, text, 0, 10, width, height - 30, panel, LABEL_CENTER + LABEL_MIDDLE) self.label:SetFontScale(2) -- self.widgets[id .. "_label"] = label -- test local pixmap = LoadPixmap("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Materials/Ground/dirt01.dds") -- Crear botones local buttonX = 40 for btnId, btnText in pairs(buttons) do local button = self.gui:AddButton(btnId, btnText, buttonX, height - 60, 180, 40, panel) buttonX = buttonX + 240 button:SetFontScale(1.5) button:SetPixmap(pixmap) --self.widgets[id .. "_button_" .. btnId] = button end return panel end Quote
Dreikblack Posted March 25 Posted March 25 31 minutes ago, Yue said: I'm just trying to understand how this works in widgets, what should I keep in mind when working with images in widgets? 2nd var in Widget:SetPixmap can be used place it at center or stretch over the widget. Button widget will put image at left to text anyway. If you remove text then image will be work normally. 1 Quote
Recommended Posts
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.