Module

Graphics.Glapple.Data.Picture

Package
purescript-glappleDEPRECATED
Repository
yukikurage/purescript-glapple

#Picture Source

newtype Picture sprite

Instances

#DrawStyle Source

data DrawStyle sprite

Constructors

Instances

#Shape Source

data Shape

Constructors

Instances

#Font Source

newtype Font

Constructors

Instances

#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.

#tryLoadImageAff Source

tryLoadImageAff :: String -> Aff CanvasImageSource

Aff version of tryLoadImage

#transform Source

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

#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.

#empty Source

empty :: forall sprite. Picture sprite

Empty picture.

#rotate Source

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

Rotate a picture. (Clockwise)

#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.

#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.

#addComposite Source

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

#color Source

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

Set color

#destinationOverComposite Source

#drawWithTransform Source

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

Retrieves the current transform state and draws a 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

#opacity Source

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

Set opacity.

#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.

#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.

#translate Source

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

Translate a picture.

#paint Source

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

Add color or pattern.

#absorb Source

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

Embeds the action of Aff into the Picture.

#(<-*) 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)

#translateToTransform Source

translateToTransform :: Number -> Number -> Transform

convert parallel movement to Transform

#angleToTransform Source

angleToTransform :: Number -> Transform

convert angle to Transform