You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
838 B

  1. fullScreener = Class{}
  2. function fullScreener:init(a,b,c,d)
  3. self.a = a
  4. self.b = b
  5. self.c = c
  6. self.d = d
  7. end
  8. function fullScreener:toggle(vh, vw)
  9. self.a = self.a + 1
  10. if (self.a > 1) then
  11. self.a = 0
  12. end
  13. if (self.a == 0 ) then
  14. if (self.b == 1) then
  15. self.c = 1
  16. self.d = 1
  17. simpleScale.updateWindow(WINDOW_WIDTH, WINDOW_HEIGHT,{fullscreen = false})
  18. self.b = 0
  19. end
  20. end
  21. if (self.a == 1) then
  22. if (self.b == 0) then
  23. simpleScale.updateWindow(WINDOW_WIDTH, WINDOW_HEIGHT, {fullscreen = true})
  24. local newWidth = love.graphics.getWidth()
  25. local newHeight = love.graphics.getHeight()
  26. self.c = VIRTUAL_WIDTH / newWidth
  27. self.d = VIRTUAL_HEIGHT / newHeight
  28. self.b = 1
  29. end
  30. end
  31. end