shadowndacorner

lerpy

Sep 7th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.97 KB | None | 0 0
  1. local iFadeSpeed=10
  2. btn_easy.Paint = function(self, w, h)
  3.     self.lCol=self.lCol or Color(255, 255, 255, 255)
  4.     draw.RoundedBox( 0, 0, 0, 100, 100, Color( 10, 10, 10, 255 ) )
  5.    
  6.     surface.SetMaterial( Material("droo/white.png") )
  7.     surface.SetDrawColor( Color( 150, 255, 150, 255 ) )
  8.     surface.DrawPoly( easyverts )
  9.    
  10.     draw.SimpleText( "Easy", "font4", 46, 30, self.lCol, TEXT_ALIGN_CENTER )
  11.    
  12.     if isHovering1 == true then
  13.         self.lCol.r=Lerp(FrameTime()*iFadeSpeed, self.lCol.r, 150)
  14.         //self.lCol.g=Lerp(FrameTime()*iFadeSpeed, self.lCol.g, 255) // Uncomment this if you want to change the G value
  15.         self.lCol.b=self.lCol.r // optimization - no point calculating it twice if they're the same
  16.         draw.SimpleText( "Easy", "font4", 46, 30, self.lCol, TEXT_ALIGN_CENTER )
  17.     else
  18.         self.lCol.r=Lerp(FrameTime()*iFadeSpeed, self.lCol.r, 255)
  19.         //self.lCol.g=Lerp(FrameTime()*iFadeSpeed, self.lCol.g, 255) // Uncomment this if you want to change the G value
  20.         self.lCol.b=self.lCol.r
  21.     end
  22. end
Advertisement
Add Comment
Please, Sign In to add comment