blob: ea2c2273a40a4b3479fbe8881d88771c0ba3d40e [file] [log] [blame]
Ruiqi Maof5101492018-06-29 14:32:21 -04001/*
2* Copyright 2018 Google Inc.
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#ifndef NIMASlide_DEFINED
9#define NIMASlide_DEFINED
10
11#include "Slide.h"
12
13#include "SkCanvas.h"
14#include "SkVertices.h"
Kevin Lubickd9699322018-10-30 15:08:53 -040015#include "nima/NimaActor.h"
Ruiqi Maof5101492018-06-29 14:32:21 -040016
17class NIMASlide : public Slide {
18public:
19 NIMASlide(const SkString& name, const SkString& path);
20 ~NIMASlide() override;
21
Ben Wagner21151122018-09-04 18:35:20 -040022 SkISize getDimensions() const override;
23
Ruiqi Maof5101492018-06-29 14:32:21 -040024 void draw(SkCanvas* canvas) override;
25 void load(SkScalar winWidth, SkScalar winHeight) override;
26 void unload() override;
27 bool animate(const SkAnimTimer& timer) override;
28
29 bool onChar(SkUnichar c) override;
30 bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
31 uint32_t modifiers) override;
32
33private:
34 void resetActor();
35
36 void renderGUI();
37
38private:
39 std::string fBasePath;
Kevin Lubickd9699322018-10-30 15:08:53 -040040 std::unique_ptr<NimaActor> fActor;
41 int fAnimationIndex;
Ruiqi Maof5101492018-06-29 14:32:21 -040042
43 bool fPlaying;
44 float fTime;
Ruiqi Mao46656e22018-07-20 14:18:50 -040045 uint32_t fRenderFlags;
Ruiqi Maof5101492018-06-29 14:32:21 -040046};
47
48#endif