• vgui shift to new line if text width > x
    6 replies, posted
as in title, I cant do it. I know it can be done with draw.drawtext using \n manually but I want to make it auto.
You cannot, you'll have to use a string wrapping function like the one here: [url]https://github.com/SuperiorServers/dash/blob/master/lua/dash/extensions/client/string.lua[/url]
[QUOTE=code_gs;52649384]You cannot, you'll have to use a string wrapping function like the one here: [url]https://github.com/SuperiorServers/dash/blob/master/lua/dash/extensions/client/string.lua[/url][/QUOTE] thanks
Try using a [img]http://wiki.garrysmod.com/favicon.ico[/img] [URL="https://wiki.garrysmod.com/page/Category:DLabel"]DLabel[/URL] with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/SetWrap]Panel:SetWrap[/url]
[QUOTE=MPan1;52649455]Try using a [img]http://wiki.garrysmod.com/favicon.ico[/img] [URL="https://wiki.garrysmod.com/page/Category:DLabel"]DLabel[/URL] with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/SetWrap]Panel:SetWrap[/url][/QUOTE] That still uses a string wrapping function internally, no reason to use it unless you're already using a panel.
[QUOTE=MPan1;52649455]Try using a [img]http://wiki.garrysmod.com/favicon.ico[/img] [URL="https://wiki.garrysmod.com/page/Category:DLabel"]DLabel[/URL] with [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/SetWrap]Panel:SetWrap[/url][/QUOTE] I still have to know if that label is wrapped or not because that label will be child of a panel and I have to extend that panel if it is wrapped
[QUOTE=code_gs;52649461]That still uses a string wrapping function internally, no reason to use it unless you're already using a panel.[/QUOTE] It says vgui in the title of this thread [editline]5th September 2017[/editline] [QUOTE=gmoddertr;52649495]I still have to know if that label is wrapped or not because that label will be child of a panel and I have to extend that panel if it is wrapped[/QUOTE] [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/DLabel/SetAutoStretchVertical]DLabel:SetAutoStretchVertical[/url] or [img]http://wiki.garrysmod.com/favicon.ico[/img] [url=http://wiki.garrysmod.com/page/Panel/SizeToContents]Panel:SizeToContents[/url] might work
Sorry, you need to Log In to post a reply to this thread.