Class: PostcardObject

PostcardObject

new PostcardObject(type, ctx, options)

Represents an internal object within the Postcard. Can be selected, redrawn, modified.
Parameters:
Name Type Argument Description
type text | image | shape The type of object being rendered
ctx CanvasRenderingContext2D context in which to draw the object
options Object <optional>
Defines placement and content.
Properties
Name Type Argument Default Description
x Object <optional>
0 X value of the object.
y Object <optional>
0 Y value of the object.
w Object <optional>
50 Width of the object.
h Object <optional>
50 Height of the object.
fill Object <optional>
steelblue Fill (color) of the object.
rotation Object <optional>
0 Rotation of the object (in degrees).
Source:

Methods

contains() → {Boolean}

Generic contains method for PostcardObject.
Source:
Returns:
if the coordinate is within the object's bounds
Type
Boolean

draw()

Generic draw method for PostcardObject.
Source:

hide()

Set opacity on the PostcardObject to 0.0
Source:

show()

Set opacity on the PostcardObject to 1.0
Source:

update(newOptions)

Generic update method for PostcardObject.
Parameters:
Name Type Description
newOptions Object any options to update
Source: