Liking cljdoc? Tell your friends :D
ClojureScript only.

dynadoc.examples


Screencljsprotocol

A screen object provides the basic lifecycle for a game. Simple games may only need to have one screen. They are a useful way to isolate different aspects of your game. For example, you could make one screen display the title and menu, and another screen contain the game itself.

You can create a screen by using reify like this:

(def main-screen
  (reify p/Screen
    (on-show [this])
    (on-hide [this])
    (on-render [this])))
A screen object provides the basic lifecycle for a game.
Simple games may only need to have one screen. They are a useful way to
isolate different aspects of your game. For example, you could make one
screen display the title and menu, and another screen contain the game
itself. 

You can create a screen by using `reify` like this:

```
(def main-screen
  (reify p/Screen
    (on-show [this])
    (on-hide [this])
    (on-render [this])))
```

on-showcljs

(on-show screen)

Runs once, when the screen first appears.

Runs once, when the screen first appears.

on-hidecljs

(on-hide screen)

Runs once, when the screen is no longer displayed.

Runs once, when the screen is no longer displayed.

on-rendercljs

(on-render screen)

Runs each time the game is ready to render another frame.

Runs each time the game is ready to render another frame.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close