LoginSignup
3
3

More than 5 years have passed since last update.

free-gameでフルスクリーン表示

Last updated at Posted at 2013-09-29

この記事はfree-game-0.9.3.5について書いてあります

free-gameというのは、HaskellでFreeモナドを使ってゲームを作れるライブラリです。それ以上の説明は面倒本題ではないので割愛します。ググって下さい。

で、フルスクリーンにする方法です。Twitterでぼやいてたら@fumieval氏が教えてくれました。ありがとうございます。

windowed.hs
import Data.Function
import Graphics.UI.FreeGame

main = do
  font <- loadFont "VL-PGothic-Regular.ttf"
  -- GUIParamの_windowedをFalseにするとフルスクリーンになる
  -- デフォルトはTrue
  -- (ウィンドウモードか、ってことらしい)
  -- 途中で変更は(多分)できない。
  runGame (def {_windowed = False}) $ fix $ \loop-> do
    translate (V2 50 300) $ colored black $ text font 40 "Push Q to quit"
    tick

    bracket 
    q <- keyChar 'Q'
    unless q loop
3
3
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3