Custom Query (25 matches)
Results (19 - 21 of 25)
Ticket | Resolution | Summary | Owner | Reporter |
---|---|---|---|---|
#25 | fixed | Add IO derivatives of the play, simulate, and animate actions | ||
Description |
I propose we generalize the animate, simulate, and play actions by providing variants allowing IO actions for world stepping and rendering.
This would be particularly useful for work like gloss-osm, that allows immediate rendering by presenting missing tiles with a default until the download is complete. |
|||
#26 | fixed | Fix end of arc condition in arc rendering | ||
Description |
With this program: import Graphics.Gloss main = animate (InWindow "Foo" (800,800) (0,0)) black $ \t -> pictures [ color white $ ThickArc (5 * t+ 0.01) (10 * t+ 0.1) 200 100 , color red $ ThickArc (5 * t+ 0.01) (10 * t+ 0.1) 250 10 , color red $ ThickArc (5 * t+ 0.01) (10 * t+ 0.1) 150 10 ] The arc ends aren't at the right angle, depending on the value for the total arc length. I expect this is an interaction between the number of draw steps and the total length. |
|||
#15 | worksforme | Window doesn't refresh under Gnome. | ||
Description |
I tried this in a typical Gnome environment, but the window never refreshed and X hogged 100% of the CPU. {-# LANGUAGE CPP #-} import Graphics.Gloss.Game import Graphics.Gloss import Data.Maybe (maybe) import Debug.Trace main = do let state = St Nothing [] gameInWindow "Test Game" (1400,1050) (0,0) white 100 state makePicture handleEvent stepWorld data State = St (Maybe Path) [Picture] type Segment = ((Float, Float), (Float, Float)) makePicture :: State -> Picture makePicture (St m xs) = Pictures (maybe xs (\x -> Line x : xs) m) handleEvent :: Event -> State -> State handleEvent e st = trace (show e) (handleE e st) handleE (EventMotion (x,y)) st@(St (Just ps) ss) = St (Just ((x-418,516 - y):ps)) ss -- Here is the offset for a 1/2 window on xmonad handleE (EventKey (MouseButton LeftButton) Down _ pt@(x,y)) st@(St Nothing ss) = St (Just [pt]) (Translate x y (Text "Down") : ss) handleE (EventKey (MouseButton LeftButton) Up _ pt@(x,y)) st@(St (Just ps) ss) = St Nothing (Translate x y (Text "up") : Line (pt:ps) : ss) handleE _ st = st stepWorld :: Float -> State -> State stepWorld _ = id |