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
1 answer

Haskell Either in main

I am having trouble to use my function that returns an Either monad in my main :: IO() function. I am able to run my code without using Either, but I now use Either to handle errors. I have the following code: parse :: Parser a -> String -> Either…
fangio
  • 1,746
  • 5
  • 28
  • 52
0
votes
2 answers

using gloss error unknown GLUT entry glutInit

Hey I am trying to use gloss library but I always get this error: Exception: user error (unknown GLUT entry glutInit) This is my code: module Pruebas where import Graphics.Gloss window :: Display window = InWindow "Nice Window" (200, 200) (10,…
Pablo
  • 49
  • 1
  • 5
0
votes
1 answer

Making a Map in Gloss

In PL class we were asked to make a pacman clone in Gloss, nevertheless I got stuck at making the map. My approach was taking a .png of the classical pacman first level, and paste it in the render function so I don't need to draw everything by…
0
votes
1 answer

How do I load a GIF-image from computer in Haskell?

I want to have a GIF-image looping in the background of a game (For example with Gloss Juicy or module Codec.Picture.Gif) Managed to work with a BMP image like this: image :: IO Picture image = loadBMP "image.bmp" But now I want to do the same…
blobfish
  • 25
  • 3
0
votes
1 answer

Posting a message while running Gloss code in Haskell

The Haskell playIO has the below type: playIO:: Display -> Color background color -> Int -> world --initial world -> (world -> IO Picture) -- function to change world into a picture -> (Event -> world -> IO world) --event handler…
Gakuo
  • 845
  • 6
  • 26
0
votes
2 answers

Pick a specific picture from a list

I have the following function: blockToPicture :: Int -> [Picture] -> Picture blockToPicture n [pic1,pic2,pic3] | n==0 = ... | n==1 = ... | otherwise = ... If n==0 I want to select…
0
votes
0 answers

How to Exit a Game in playIO function?

I am making Pacman in Haskell Gloss. Now I am trying to Exit the game, once all the chips on the gameboard have been eaten by pacman. I have the function to check if that is the case, but I can't find a way to exit the game after that. This is…
ramon abacherli
  • 199
  • 2
  • 12
0
votes
1 answer

Pythagoras Tree failling on level 2 and more, why?

So we are trying to build a Pythagoras Tree using gloss, and it fails level 2 and next ones (only works level 0 and 1). Here is the code: data FTree a b = Unit b | Comp a (FTree a b) (FTree a b) deriving (Eq,Show) type PTree = FTree Square…
Jaime
  • 21
  • 3
0
votes
2 answers

Alamofire + Gloss: nested JSON array not working

I'm trying to post following JSON to the api. Following is the log from the Xcode console. { address = ( { city = 1; area = 1; "building_name" = "building"; } ); category = 1; …
Pei
  • 11,452
  • 5
  • 41
  • 45
0
votes
0 answers

How to integrate realm model with the gloss model in effective harmony as I am facing this issue

Here is my sample code, It gives an nil on the link as self.init() called get property what is the alternate way to do this? class channel : Object, Gloss.Decodable { var id:String? var channelName:String? dynamic var links: Links? = nil public…
0
votes
0 answers

Haskell Gloss : Making zoom, pan, and all that kind of effects for module Graphics.Gloss.Interface.Pure.Game

Recently I have been working on making a game with Haskell, and we have been using the library Gloss in order to complete the graphic part. To make a game with Gloss, as you probably know, you have to use Graphics.Gloss.Interface.Pure.Game (or IO…
pCosta99
  • 51
  • 5
0
votes
1 answer

Combining `animation` and `play` functions in gloss

I am implementing a simple Simon game using Haskell with Gloss. I wish, at the moment, that, for example, for the first 4 seconds some rectangles will change their color (or simply in other words show some animation), and afterwards allow colors…
Alex Goft
  • 1,114
  • 1
  • 11
  • 23
0
votes
1 answer

ghc sudden error: -lGLU, -lGL

I am running Ubuntu 16.04 in virtualbox on windows 10. I am working with gloss in haskell ghc and I compiled many files with the gloss package without an issue. Then suddenly for no apparent reason, I am getting errors compiling things that used to…
domoremath
  • 555
  • 2
  • 8
  • 17
0
votes
1 answer

Haskell gloss example/skeleton

I am trying to use the gloss package in Haskell to make a game but find everything I read too simplistic or hard to read. I have seen What would be a typical game skeleton in Haskell which is a little useful but I am hoping for a little more…
domoremath
  • 555
  • 2
  • 8
  • 17
0
votes
1 answer

How do I generate test cases for pictures using the RGBA constructor in the Gloss library?

I am trying to write some test cases using HUnit in Haskell for a function using the Gloss Graphics library. The function: makePicture :: Color -> Picture makePicture c = Color c $ Circle 80 If I display a call to this function with argument…
user5846939
  • 415
  • 4
  • 11