easily swappable fullscreen.
This commit is contained in:
@@ -12,6 +12,8 @@
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.utils.viewport FitViewport]
|
||||
[com.badlogic.gdx.scenes.scene2d Actor Stage]
|
||||
[com.badlogic.gdx Application Audio Files Game Gdx Graphics Input
|
||||
InputMultiplexer InputProcessor Net Preferences Screen]
|
||||
[java.lang Object]))
|
||||
|
||||
(defn log-coords [screen entities]
|
||||
@@ -316,3 +318,15 @@
|
||||
(particle-effect! p :update 10.0)
|
||||
(dotimes [_ 160]
|
||||
(particle-effect! p :update 0.2)))
|
||||
|
||||
(defn toggle-fullscreen! []
|
||||
(if (.isFullscreen Gdx/graphics)
|
||||
(on-gl (.setDisplayMode Gdx/graphics 1280 960 false))
|
||||
(on-gl (.setDisplayMode Gdx/graphics
|
||||
(doto (.width (.getDesktopDisplayMode Gdx/graphics)) println)
|
||||
(doto (.height (.getDesktopDisplayMode Gdx/graphics)) println)
|
||||
true)
|
||||
(set! (.foregroundFPS (-> (class Gdx/graphics)
|
||||
(.getDeclaredField (name "config"))
|
||||
(doto (.setAccessible true))
|
||||
(.get Gdx/graphics))) 60))))
|
||||
|
||||
Reference in New Issue
Block a user