1

AR

Blocks in AR can detect the motion of objects.With these blocks, user can interact with the sprite and control sprite's motion. User can create games and applications.

For example: Fruit Cut (Motion Sensing Version), Scan and Recognize QR Code.

1. turn [on] camera

  • Trun on the camera while running the project, and detect the movement of the object in the video.

  • You need to get computer or mobile authorization while using this block.
Mobile authorization request:

If you run the project on mobile, please note that you cannot use the camera through WeChat.

You need to open it in your browser~

Usually, you can find the camera logo on the right side of the search box of the mobile browser. Click it to scan the QR code.

Computer authorization request:

2. set video transparency to (50)%

  • Change the overall transparency of the shooting content.

  • Turn on the camera bfore using this block.

    • Effect display:

a. Set transparency to 0%

Set transparency to 50%

Set transparency to 100%

3. motion [intensity/direction] of itself

  • Detect the motion intensity or motion direction of the sprite.

  • Turn on the camera before using this block.

    • Range of motion intensity: 0~100

    • Range of motion direction: -180~180

  • For example:

    a. The motion intensity of itself

We set Codemao: when the location of the "Codemao" is detected, if the motion intensity of the object is greater than 15, then Codemao will move 10 steps.

Script:

Effect:

b. The motion direction of itself

On the basis of the script above, we add an block to Codemao, so that Codemao will move 10 steps in the direction of the object.

Script:

Effect: push Codemao to the left, and it will move to the left.

  • Scan to play the game: Fruit Cut (Motion Sensing Version)

Tip: currently only browser of Android mobile is supported.

How to play:

Cut the fruits directly by hand; fruits will be separated when the hand touches them.

4. turn on camera and scan QR code

  • Turn on mobile camera to scan QR code (equivalent to embedding scan function of WeChat in the project).

  • You need to get authorization of mobile camera before using this block.

5. display QR code scan result

  • Get and show the result after scanning the QR code.

  • Scan results can be website, text, picture, audio and video, WeChat, and so on.

6. QR code scan result

  • Get the result after scanning the QR code.