Kingdaro

THIS SHOULDN'T BE NECESSARY

May 7th, 2012
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.37 KB | None | 0 0
  1. function profiles:draw()
  2.     love.graphics.setFont(Fonts.title)
  3.     love.graphics.printf('Select a Profile or create a new one!',0,100,screen.width,'center')
  4.     local font = Fonts.large
  5.     love.graphics.setFont(font)
  6.  
  7.     local size = 150
  8.     local left = screen.width/2 - size/2
  9.     local top = screen.height/2
  10.  
  11.     love.graphics.setColor(255,255,255,50 + 50*(math.sin(glowfx*3) + 1))
  12.     love.graphics.rectangle('fill',left,top,size,size)
  13.     love.graphics.setColor(255,255,255)
  14.     love.graphics.rectangle('line',left,top,size,size)
  15.  
  16.     for i=1, #list+1 do
  17.         local x = left + (i-1)*size - (selection-1)*size
  18.         local y = top
  19.         if i <= #list then
  20.             local v = list[i]
  21.             local height = font:getHeight(v.name)
  22.  
  23.             love.graphics.setColor(0,0,0,100)
  24.             love.graphics.printf(v.name, x+2, y + size - height + 2, size, 'center')
  25.             love.graphics.setColor(255,255,255)
  26.             love.graphics.printf(v.name, x, y + size - height, size, 'center')
  27.             love.graphics.setColor(HSL(v.hue,200,125))
  28.             love.graphics.draw(img.player, x + size/2 - 25, y + size/2 - 25, 0, 2, 2)
  29.         else
  30.             local text = 'New'
  31.             local height = font:getHeight(text)
  32.  
  33.             love.graphics.setColor(0,0,0,100)
  34.             love.graphics.printf(text, x+2, y + size - height + 2, size, 'center')
  35.             love.graphics.setColor(255,255,255)
  36.             love.graphics.printf(text, x, y + size - height, size, 'center')
  37.             love.graphics.draw(img.add, x + size/2 - 25, y + size/2 - 25, 0, 2, 2)
  38.         end
  39.     end
  40. end
Advertisement
Add Comment
Please, Sign In to add comment