blob: f0c4af5c817025e9e3e95522190ef03ad815ce09 [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 an emulator instance:
```
$ ./third_party/fuchsia-sdk/tools/x64/ffx product-bundle get workstation_eng.qemu-x64
$ ./third_party/fuchsia-sdk/tools/x64/ffx emu start workstation_eng.qemu-x64
```
1. Start a local package repository instance:
```
$ ./third_party/fuchsia-sdk/tools/x64/fserve --image workstation_eng.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:
```
$ ./third_party/fuchsia-sdk/tools/x64/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.