aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleShip.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2015-11-08 08:07:24 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-08 08:07:24 -0800
commit629162dd8ef127f793c9cedf0f47a1d4de4d3a3d (patch)
tree7b8d9c7a038fdd6dc85b1e564f06a6ea43b0a159 /samplecode/SampleShip.cpp
parentf514eae53227bcd9f5125cd4479942644f0d4c84 (diff)
Add text animation sample; tweak DrawShip sample
Diffstat (limited to 'samplecode/SampleShip.cpp')
-rw-r--r--samplecode/SampleShip.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/samplecode/SampleShip.cpp b/samplecode/SampleShip.cpp
index caaad046d9..fddf0235ba 100644
--- a/samplecode/SampleShip.cpp
+++ b/samplecode/SampleShip.cpp
@@ -70,7 +70,7 @@ public:
fTex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f,
SkIntToScalar(fAtlas->width()),
SkIntToScalar(fAtlas->height()));
- fXform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f,
+ fXform[currIndex] = SkRSXform::MakeFromRadians(0.1f, SK_ScalarPI*0.5f,
xPos, yPos, anchorX, anchorY);
currIndex++;
}
@@ -78,7 +78,7 @@ public:
fTex[currIndex] = SkRect::MakeLTRB(0.0f, 0.0f,
SkIntToScalar(fAtlas->width()),
SkIntToScalar(fAtlas->height()));
- fXform[currIndex] = SkRSXform::MakeFromRadians(2.0f, SK_ScalarPI*0.5f,
+ fXform[currIndex] = SkRSXform::MakeFromRadians(0.5f, SK_ScalarPI*0.5f,
kWidth*0.5f, kHeight*0.5f, anchorX, anchorY);
fCurrentTime = 0;
@@ -147,7 +147,10 @@ protected:
}
fProc(canvas, fAtlas, fXform, fTex, nullptr, kGrid*kGrid+1, nullptr, &paint);
- canvas->drawText(outString.c_str(), outString.size(), 100.f, 100.f, paint);
+ paint.setColor(SK_ColorBLACK);
+ canvas->drawRect(SkRect::MakeXYWH(0, 0, 200, 24), paint);
+ paint.setColor(SK_ColorWHITE);
+ canvas->drawText(outString.c_str(), outString.size(), 5, 15, paint);
this->inval(nullptr);
}