Scratch Card : Scratch your image

Short description

Helps you scratch a image and reveal your component behind :cat:

Picture of all the blocks

Instructions to use your extension

Some properties like overlay width, overlay height, overlay image and tile mode should be set before setting up scratch card in your layout.

Docs

Docs for: ScratchCard

Events

OnRevealPercentChanged

Triggers when user scratches the scratch card.
Params

percent | number


OnRevealed

Triggers when image is revealed.

Methods

Mask

Covers your layout back with image.

RevealPercent

Returns the current revealed image percent.

Return type : number


SetEraserMode

Sets the mode to erase.

IsRevealed

Checks if the image is revealed or not.

Setup

Setups your scratch card with properties set before.
Params

layout | component


Reveal

Removes the masked image from your layout.

Properties

TileMode

Set the tile mode of the scratch card. Default is CLAMP others are REPEAT and MIRROR. Property to be set before setting up view.

Property Type : read-write
Accepts : text


StrokeWidth

Set the width of the stroke using which image will be scratched.

Property Type : write-only
Accepts : number


OverlayWidth

Set width of the overlay pattern. Property to be set before setting up view.

Property Type : read-write
Accepts : number


OverlayImage

Set the overlay image which is to be scratched. Property to be set before setting up view.

Property Type : read-write
Accepts : text


OverlayHeight

Set height of the overlay pattern. Property to be set before setting up view.

Property Type : read-write
Accepts : number


Demo Blocks

Aia - scratch.aia (28.0 KB)
Apk - Download APK

Demo Video

Download link

com.aktech.scratchcard.aix (12.9 KB)

Credits

This extension is made on the ScratchView library by Anup Kumar Panwar

6 Likes

Nice @Aarush_Kumar! You have overcame the canvas component!

1 Like

Thank you @gordonlu310 :relaxed:

Mind blowing once again
Keep it up dood :+1::+1::+1:

1 Like

Thank you @Horizon

Good :+1::+1::+1: