Questions tagged [gloss]

The Haskell gloss package is a simple vector graphics drawing package.

Source

Gloss hides the pain of drawing simple vector graphics behind a nice data type and a few display functions. Gloss uses OpenGL under the hood, but you won't need to worry about any of that. Get something cool on the screen in under 10 minutes.

102 questions
0
votes
0 answers

ReacTime function crashing game

My problem is that i made a game, i have initialState, drawState and reactEvent running well, but my reactTime function when i activate it crash's the programm -- | Main function that invoques the game main :: IO () main = do play dm …
Dost
  • 33
  • 7
0
votes
0 answers

Creating a picture of a map with a recurssive function

i'm using haskell gloss for the first time and I'm having some trouble, in this code: -- the initial c and l will be imagine for dimension 9: (-160) 160 -- (so the square ends in the center of the window -- column; line; dimension …
Dost
  • 33
  • 7
0
votes
1 answer

Cast from 'Array' (aka 'Array>') to unrelated type 'JSON' (aka 'Dictionary') always fails

I'm trying to load a table with data from JSON. I want to deserialize the JSON into an array. I use a 3rd party library called Gloss, anyway, it should be easy, but I can't solve the warning (same as the title of this thread). This is the JSON data:…
Luthfi Rahman
  • 424
  • 6
  • 17
0
votes
2 answers

Haskell Gloss: missing dependencies

As uni assignment, I need to enhance a given Haskell framework with certain features. Since this framework uses the Gloss library, I installed Gloss using cabal install gloss. This gave me no errors, however, when trying to configure the Setup file…
Felix
  • 147
  • 2
  • 10
0
votes
1 answer

iOS: Gloss Date decoding issue

I use Gloss for parsing JSON. I've got issues with parsing Date fields. My JSON input: "PurchasedAt": 2016-08-02T17:23:12.000Z, Struct: let purchasedAt: Date? init?(json: JSON) { self.purchasedAt = Decoder.decodeDate("PurchasedAt",…
NCFUSN
  • 1,624
  • 4
  • 28
  • 44
0
votes
1 answer

Give more "information" to the simulate function (Haskell / Gloss Library)

At the beginning of the program, the user can give the simulation some "information": main:: IO() main = do putStrLn("Hallo") val <- getLine startGUI(read val ::Float) The function (startGUI) : startGUI :: Float…
Max K
  • 171
  • 12
0
votes
2 answers

Cabal error running with Gloss

I'm trying to install gloss on my computer to make a graphic game and I followed a tutorial, with these steps: 1) First I run this command: cabal install gloss==1.8.* . I want gloss 1.8.* because I found a game made with this version of gloss, and…
Caroso
  • 111
  • 3
  • 12
0
votes
1 answer

How do I get cabal gloss working on IOS el Capitan?

After I installed cabal and try to run my (very basic) haskell code in which include import Graphics.Gloss I get an error message Could not find module ‘Graphics.Gloss’. Can´t figure out why as I seem to have installed it the correct way... Can…
0
votes
1 answer

Persisting drawn frames in Gloss

I've been messing around with Gloss for a little bit, getting a feel for it, and I really like it! I'm having one problem though, and that is that I'm not sure how to persist drawings for more than one frame. I can draw one Picture at a time, but…
Benjamin Kovach
  • 3,190
  • 1
  • 24
  • 38
-1
votes
1 answer

How can I import an image in haskell?

I'm a beginner in haskell and trying to make a game. Currently learning Gloss graphics. I wonder how I can import an BMP (JPG or PNG) image in haskell? (As a character or background etc). I want the image to be shown in the graphics window IO ().…
blobfish
  • 25
  • 3
-1
votes
1 answer

Haskell : Gloss error when trying to render a text

I am trying to run this example: https://raw.githubusercontent.com/elisehuard/game-in-haskell/master/src/Shapes.hs But I get the error "freeglut ERROR: Function called without first calling 'glutInit'." I managed to isolate the problem to line…
finuux
  • 1
  • 2
-1
votes
1 answer

How can I draw two shapes in a time sequence using Gloss?

I have a simple window displaying two shapes like so: import Graphics.Gloss circles = pictures [Translate 80 0 one, Translate (-80) 0 two] main = display (InWindow "t" (400,400) (800,0)) white circles one = Color red $ Circle 80 two = Color blue…
user5846939
  • 415
  • 4
  • 11
1 2 3 4 5 6
7