Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function HideThings( name )
- if(name == "CHudHealth") or (name == "CHudBattery") then
- return false
- end
- -- We don't return anything here otherwise it will overwrite all other
- -- HUDShouldDraw hooks.
- end
- hook.Add( "HUDShouldDraw", "HideThings", HideThings )
- local soundURL = "http://jukebox.ijwtb.net/music/Rogue/Unknown/Adventure%20Time.mp3"
- soundChannel = soundChannel or nil
- function playMusic( url )
- if( soundChannel ) then
- soundChannel:Stop()
- soundChannel = nil
- end
- hook.Add( "PostDrawOpaqueRenderables", "Visualizer", playVisual )
- sound.PlayURL( url, "noblock", function(cb , errId, errName)
- soundChannel = cb
- end )
- end
- function playVisual()
- if( not IsValid( soundChannel ) ) then return end
- local FFTable = {}
- local FFTLevels = soundChannel:FFT( FFTable, FFT_256 )
- for key, val in pairs( FFTable ) do
- local height = val * 4000
- local keyOffset = key - 1
- cam.Start3D2D( Vector( -1000, 1000, -11275 ), Angle( 0, 0, 90 ), 1 )
- draw.RoundedBox( 0, 22 * keyOffset, ScrH() - height, 22, height, Color(255,key*5,0,255) )
- draw.RoundedBox( 0, 0, 0, ScrW(), ScrH(), Color(120,120,120,2) )
- cam.End3D2D()
- end
- end
- playMusic( soundURL )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement