blob: ac397f25adb8bc69bba399e0dad90d3ec6fdb555 [file] [log] [blame] [view]
# Bouncing Ball Example
This directory contains an example application which draws an animated bouncing
ball using Scenic.
## Source layout
- `main.cc`: Main entrypoint for the component binary
## Before you begin
1. Start a FEMU instance:
```
$ ./third_party/fuchsia-sdk/bin/femu.sh --image workstation.qemu-x64-release -N
```
1. Start a local package repository instance:
```
$ ./third_party/fuchsia-sdk/tools/x64/fserve --image workstation.qemu-x64-release
```
> Note: This sample requires an image configuration that supports graphical
> sessions, such as `workstation`.
## Build the sample
1. Run the build script to compile and package the sample:
```
$ ./scripts/build.sh
```
1. Publish the FAR package to your local package repository:
```
$ ./third_party/fuchsia-sdk/tools/x64/fpublish out/x64/bouncing_ball.far
```
## Run the sample
1. Launch the sample component using `ffx session add`. This resolves the
component from the package repository and adds it to the session manager:
```
$ ffx session add fuchsia-pkg://fuchsia.com/bouncing_ball#meta/bouncing_ball.cm
```
1. Verify that you can see the bouncing ball animation on your display.
1. If you have an input device attached, click the button to restart the
animation.