Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. function love.load()
  2. love.window.setMode(800,600, {vsync = true})
  3. love.graphics.setBackgroundColor(0,0,0)
  4. winwidth = love.graphics.getWidth()
  5. winheight = love.graphics.getHeight()
  6.  
  7. gamestate = "menu"
  8.  
  9. titleFont = love.graphics.newFont(64)
  10. love.graphics.setFont(titleFont)
  11. titleText = "CRYPTIC\nCROSSWORDS"
  12. titleTextWidth,titleTextHeight = titleFont:getWidth(titleText),titleFont:getHeight(titleText)
  13. end
  14.  
  15.  
  16. function drawText(string,font,locationX,locationY)
  17. textWidth,textHeight = font:getWidth(string),font:getHeight(string)
  18. love.graphics.printf(string, 0, (locationY)-(textHeight), winwidth, 'center')
  19. end
  20.  
  21. function love.update(dt)
  22. end
  23.  
  24. function love.draw()
  25. if gamestate == "menu" then
  26. drawText(titleText,titleFont,winwidth/2,winheight/2)
  27. end
  28. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement