2018-06-29 18:32:21 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2018 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef NIMASlide_DEFINED
|
|
|
|
#define NIMASlide_DEFINED
|
|
|
|
|
|
|
|
#include "Slide.h"
|
|
|
|
|
|
|
|
#include "SkCanvas.h"
|
|
|
|
#include "SkVertices.h"
|
2018-10-30 19:08:53 +00:00
|
|
|
#include "nima/NimaActor.h"
|
2018-06-29 18:32:21 +00:00
|
|
|
|
|
|
|
class NIMASlide : public Slide {
|
|
|
|
public:
|
|
|
|
NIMASlide(const SkString& name, const SkString& path);
|
|
|
|
~NIMASlide() override;
|
|
|
|
|
2018-09-04 22:35:20 +00:00
|
|
|
SkISize getDimensions() const override;
|
|
|
|
|
2018-06-29 18:32:21 +00:00
|
|
|
void draw(SkCanvas* canvas) override;
|
|
|
|
void load(SkScalar winWidth, SkScalar winHeight) override;
|
|
|
|
void unload() override;
|
|
|
|
bool animate(const SkAnimTimer& timer) override;
|
|
|
|
|
|
|
|
bool onChar(SkUnichar c) override;
|
|
|
|
bool onMouse(SkScalar x, SkScalar y, sk_app::Window::InputState state,
|
|
|
|
uint32_t modifiers) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void resetActor();
|
|
|
|
|
|
|
|
void renderGUI();
|
|
|
|
|
|
|
|
private:
|
|
|
|
std::string fBasePath;
|
2018-10-30 19:08:53 +00:00
|
|
|
std::unique_ptr<NimaActor> fActor;
|
|
|
|
int fAnimationIndex;
|
2018-06-29 18:32:21 +00:00
|
|
|
|
|
|
|
bool fPlaying;
|
|
|
|
float fTime;
|
2018-07-20 18:18:50 +00:00
|
|
|
uint32_t fRenderFlags;
|
2018-06-29 18:32:21 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|