

A suggestion before we get started, make sure your GIF of choice isn't overly long. Welcome to my tutorial on converting a GIF of your choice to a spray! To start off, this may be a little to complicated for some, if so - sorry. Oh, and by the way, that image, when I copy it to memory using right click, copy image, and paste it into Irfanview, says its 1920x1080. Reasonably small in disk/memory use, powerful in it's basic functionality. Not only will it view just about anything thrown at it, including, with additional plugins, some audio and pdf type oddball stuff you may not expect an image viewer to view, it allows basic editing, One of those editing features is, imo, an awesome resampler (think resize, but better quality). My recommendation if #2 doesn't work out, and you don't need the huge feature rich free open-source equivalent of Adobe's photoshop from #1, Unfortunately, with as limited as the HTML viewer in Source is, resizing MIGHT be pixelated/bit rough at lower sizes, if the Source HTML engine allows it at all. Good stuff, yes, but perhaps a bit more than needed just to resize an image.Ģ) Decicus HTML - good way 'on the fly' to resize images in-line if they can't be adjusted. I'd also like to make it so that there's a countdown of 5 seconds before they're able to close out of the motd if possible.ġ) Gimp, though awesome, is a huge feature rich package that requires some learning curve and disk space. Simply resizing it causes it to look warped and I don't have the PSD of the image, only the static. You may be thinking, "Why not just resize the image?" - Well I can't without completely recreating the image from scratch, which i'd rather not do. I figured that if I just change the size of the motd window to match the size of the image, it would fix the problem, but the image still appears with bars. I use the exact same code (except a different image source) for my server's loading screen and it re-sizes to any resolution automatically without any bars on the sides. ULib.fileWrite( "data/ulx_motd.txt", text ) Url = string.gsub( url, "%%steamid%%", steamid )

Url = string.gsub( url, "%%curmap%%", game.GetMap() ) Html:SetHTML( ULib.fileRead( "data/ulx_motd.txt" ) ) Html:SetSize( window:GetWide() - 20, window:GetTall() - button:GetTall() - 50 ) Local button = vgui.Create( "DButton", window )īutton.DoClick = function() window:Close() endīutton:SetPos( (window:GetWide() - button:GetWide()) / 2, window:GetTall() - button:GetTall() - 10 ) Local html = vgui.Create( "HTML", window ) If ScrW() > 640 then - Make it larger if we can.
