Module

Graphics.Glapple.Data.Picture

Package
purescript-glapple
Repository
yukikurage/purescript-glapple

#(<-*) Source

Operator alias for Graphics.Glapple.Data.Picture.multiplyComposite (left-associative / precedence 5)

#(<-+) Source

Operator alias for Graphics.Glapple.Data.Picture.addComposite (left-associative / precedence 5)

#(<-.) Source

Operator alias for Graphics.Glapple.Data.Picture.destinationOverComposite (left-associative / precedence 5)

#(<-^) Source

Operator alias for Graphics.Glapple.Data.Picture.sourceOverComposite (left-associative / precedence 5)

#(|*|) Source

Operator alias for Graphics.Glapple.Data.Picture.multiplyTransform (right-associative / precedence 7)

#DrawStyle Source

data DrawStyle sprite

Constructors

Instances

#Font Source

newtype Font

Constructors

Instances

#Picture Source

newtype Picture sprite

Instances

#Shape Source

data Shape

Constructors

Instances

#absolute Source

absolute :: forall s. Picture s -> Picture s

Disables the parent's transform, forcing it to draw from the origin. Heavy use is deprecated.

#absorb Source

absorb :: forall s. Aff (Picture s) -> Picture s

Embeds the action of Aff into the Picture.

#absorb' Source

absorb' :: forall s. (Context2D -> (s -> Maybe CanvasImageSource) -> Aff (Picture s)) -> Picture s

It is not recommended to use this system except for the glapple system.

#addComposite Source

addComposite :: forall s. Picture s -> Picture s -> Picture s

#angleToTransform Source

angleToTransform :: Number -> Transform

convert angle to Transform

#arc Source

arc :: forall s. { angle :: Number, radius :: Number, start :: Number } -> Picture s

Draw an arc with stroke. Property angle is the rotation angle from the start position. A positive number will cause a clockwise rotation, 2π will make a perfect circle, and 4π will return to a blank state.

#color Source

color :: forall s. Color -> Picture s -> Picture s

Set color

#destinationOverComposite Source

#drawPicture Source

drawPicture :: forall sprite. Context2D -> (sprite -> Maybe CanvasImageSource) -> Picture sprite -> Aff Unit

Draw a picture It is not recommended to use this except for the glapple system.

#drawWithTransform Source

drawWithTransform :: forall s. (Transform -> Picture s) -> Picture s

Retrieves the current transform state and draws a Picture.

#empty Source

empty :: forall sprite. Picture sprite

Empty picture.

#fan Source

fan :: forall s. Shape -> { angle :: Number, radius :: Number, start :: Number } -> Picture s

Draw a fan. Property angle is the rotation angle from the start position. A positive number will cause a clockwise rotation, 2π will make a perfect circle, and 4π will return to a blank state.

#font Source

font :: forall s. Font -> Picture s -> Picture s

Set font.

#line Source

line :: forall sprite. Array (Number /\ Number) -> Picture sprite

Draw line.

#lineWidth Source

lineWidth :: forall s. Number -> Picture s -> Picture s

Set lineWidth.

#multiplyComposite Source

multiplyComposite :: forall s. Picture s -> Picture s -> Picture s

#composite Source

composite :: forall sprite. Composite -> Picture sprite -> Picture sprite -> Picture sprite

Combine images using the specified combining method. Issue: Synthesis of the combined image behaves unexpectedly. ex) x <-+ (y <-^ z) = (x <-+ y) <-^ z

#opacity Source

opacity :: forall s. Number -> Picture s -> Picture s

Set opacity.

#paint Source

paint :: forall s. DrawStyle s -> Picture s -> Picture s

Add color or pattern.

#polygon Source

polygon :: forall sprite. Shape -> Array (Number /\ Number) -> Picture sprite

Draw polygon.

#rect Source

rect :: forall s. Shape -> Number -> Number -> Picture s

Draw rectangle.

#rotate Source

rotate :: forall s. Number -> Picture s -> Picture s

Rotate a picture. (Clockwise)

#scale Source

scale :: forall s. Number -> Number -> Picture s -> Picture s

Scale a picture.

#sourceOverComposite Source

sourceOverComposite :: forall s. Picture s -> Picture s -> Picture s

#sprite Source

sprite :: forall sprite. sprite -> Picture sprite

Draws the sprite loaded by runGame.

#text Source

text :: forall sprite. Shape -> String -> Picture sprite

Draw text.

#textAlign Source

textAlign :: forall s. TextAlign -> Picture s -> Picture s

Set textAlign.

#textBaseLine Source

textBaseLine :: forall s. TextBaseline -> Picture s -> Picture s

Set textBaseLine.

#transform Source

transform :: forall s. Transform -> Picture s -> Picture s

#translate Source

translate :: forall s. Number -> Number -> Picture s -> Picture s

Translate a picture.

#translateToTransform Source

translateToTransform :: Number -> Number -> Transform

convert parallel movement to Transform

#tryLoadImageAff Source

tryLoadImageAff :: String -> Aff CanvasImageSource

Aff version of tryLoadImage