Jump to content

Change Size Font Widget GUI? ( Lua )


Go to solution Solved by Dreikblack,

Recommended Posts

Posted

How can I change the font size for a widget? or how can I assign a new font to a specific widget? 

image.png.a7bc1405a40e64e61bd39ac0b83e3830.png

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

Ok, solved here, size font. 

image.png.bc5b73177ff75e10f86459c1b75fec67.png

self.exitButton:SetFontScale(3)


New Font for Widget?
 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted
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?

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

Only Work on panel  and backgrund gui?

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted

I'm just trying to understand how this works in widgets, what should I keep in mind when working with images in widgets?

image.thumb.png.8e13c39fcc8ca81a1ce52ee46ee30d2e.png

    -- 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

 

 

 

 

Astrocuco.thumb.png.c76e0fb3de2d6e437e7dca099625e11e.png

Murphy's Law: We don't fix bugs, we document them as features. – Murphy Games

Posted
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.

  • Like 1

Check out Slipgate Tactics demo, which is made with Ultra Engine:

https://www.leadwerks.com/community/topic/61480-slipgate-tactics-demo/

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...