aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode/SampleShip.cpp
diff options
context:
space:
mode:
authorGravatar jvanverth <jvanverth@google.com>2015-11-06 14:20:03 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-11-06 14:20:04 -0800
commit3b484a40b3be7f0262afadeaf6b741ba5cedcfe1 (patch)
tree85f5a9e4ea16172ba3147d0c27cfd035a65ffaf4 /samplecode/SampleShip.cpp
parente8e17cf23d2a036f9b3050bedeb9d3a544221f4c (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);
}