Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix TTS playback issue #236

Open
wants to merge 11 commits into
base: newmaster
Choose a base branch
from
21 changes: 5 additions & 16 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,24 +89,13 @@ lint/outputs/
lint/tmp/
# lint/reports/

bookviewer/cocos2d/*
!bookviewer/cocos2d/readme.txt
pehlaschool/cocos2d/*
pehlaschool/cocos2d/readme.txt

mainapp/cocos2d/*
!mainapp/cocos2d/readme.txt
pehlaschoollibrary/cocos2d/*

mainapp/firebase_cpp_sdk/*
!mainapp/firebase_cpp_sdk/readme.txt

seaworld/cocos2d/*
!seaworld/cocos2d/readme.txt


library/localized/en-us
library/localized/sw-tz

mainapp/Resources/*
!mainapp/Resources/readme.txt
pehlaschool/firebase_cpp_sdk/*
!pehlaschool/firebase_cpp_sdk/readme.txt

maqpublisher.keystore
google-services.json
2 changes: 1 addition & 1 deletion pehlaschool/Classes/CCAppController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ void CCAppController::startBookScene(std::string bookFolder, bool replaceParent,
backButton->setPosition(Vec2(25, nextScene->getContentSize().height-25));
nextScene->addChild(backButton);

auto l = TodoUtil::createLabel(LanguageManager::getInstance()->getLocalizedString("Error"), 200, Size::ZERO, "fonts/Aileron-Regular.otf", Color4B::WHITE);
auto l = TodoUtil::createLabel(LanguageManager::getInstance()->getLocalizedString("Error", false), 200, Size::ZERO, "fonts/Aileron-Regular.otf", Color4B::WHITE);
l->setPosition(nextScene->getContentSize()/2);
nextScene->addChild(l);

Expand Down
2 changes: 1 addition & 1 deletion pehlaschool/Classes/Common/Controls/CoinTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void CoinTab::setCoinLabel(int num)
}
auto size = this->getContentSize();

_coinLabel = TodoUtil::createLabel(TodoUtil::itos(num), 70, Size::ZERO, "fonts/mukta-bold.ttf", Color4B::WHITE);
_coinLabel = TodoUtil::createLabel(TodoUtil::itos(num), 50, Size::ZERO, "arial", Color4B::WHITE);
_coinLabel->setPosition(size/2);
this->addChild(_coinLabel);

Expand Down
2 changes: 1 addition & 1 deletion pehlaschool/Classes/Common/Controls/CompletePopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ bool CompletePopup::init() {


_titleTextLabel = Label::createWithSystemFont(labelText(), "arial",
70, Size::ZERO,
75, Size::ZERO,
TextHAlignment::CENTER, TextVAlignment::CENTER);
_titleTextLabel->setTextColor(Color4B(255, 252, 236, 255));
_titleTextLabel->setPosition(Vec2(p.x, p.y-250));
Expand Down
6 changes: 3 additions & 3 deletions pehlaschool/Classes/Common/Controls/Subtitle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ void Subtitle::setContent(string content) {

this->removeAllChildren();

const string font = "fonts/mukta-bold.ttf";
const string font = "arial";
const float shadow = 8;

auto drawShadow = [this, font, content](float posX, float posY){
auto shadow = TodoUtil::createLabel(content, 100, Size::ZERO, font, Color4B::BLACK);
auto shadow = TodoUtil::createLabel(content, 75, Size::ZERO, font, Color4B::BLACK);
shadow->setPosition(posX,posY);
this->addChild(shadow);
};
Expand All @@ -114,7 +114,7 @@ void Subtitle::setContent(string content) {
drawShadow(shadow, 0);
drawShadow(shadow, shadow);

auto label = TodoUtil::createLabel(content, 100, Size::ZERO, font, Color4B::WHITE);
auto label = TodoUtil::createLabel(content, 75, Size::ZERO, font, Color4B::WHITE);
this->addChild(label);

}
28 changes: 14 additions & 14 deletions pehlaschool/Classes/Games/Books/BookPage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void BookPage::setTitle(string title, string titleImagePath, string audioPath, T
_textView->setPosition(Vec2(halfSize.width-610, 1800-250));
_rightView->addChild(_textView);

float fontSize = 120;
float fontSize = 100;

auto labelFunc = [&](Color4B color, string fontName, Size offset){

Expand Down Expand Up @@ -396,7 +396,7 @@ void BookPage::setTitle(string title, string titleImagePath, string audioPath, T
_textView->setPosition(Vec2(bigSize.width/2, 1800-380-100));
_rightView->addChild(_textView);

float fontSize = 120;
float fontSize = 100;



Expand Down Expand Up @@ -992,7 +992,7 @@ void BookPage::setCreditPage()
{
string creditTxt = getSentence(1);

Label* label = Label::createWithSystemFont(creditTxt, arialFont, 35, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
Label* label = Label::createWithSystemFont(creditTxt, arialFont, 30, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
label->setTextColor(Color4B(98, 61, 29, 255));
label->setAnchorPoint(Vec2::ANCHOR_MIDDLE_TOP);
label->setPosition(textViewSize/2);
Expand All @@ -1002,7 +1002,7 @@ void BookPage::setCreditPage()
{
string licenseTxt = getSentence(2);

auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 20, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 15, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
bottom->setTextColor(Color4B(98, 61, 29, 255));
bottom->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
bottom->setPosition(Size(halfSize.width/2+centerOffset, 50));
Expand Down Expand Up @@ -1107,7 +1107,7 @@ void BookPage::setCreditPage()
{
string creditTxt = getSentence(1);

Label* label = Label::createWithSystemFont(creditTxt, arialFont, 35, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
Label* label = Label::createWithSystemFont(creditTxt, arialFont, 30, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
label->setTextColor(Color4B(54, 28, 14, 255));
label->setAnchorPoint(Vec2::ANCHOR_MIDDLE_TOP);
label->setPosition(Vec2(textViewSize.width/2, textViewSize.height - 600));
Expand All @@ -1117,7 +1117,7 @@ void BookPage::setCreditPage()
{
string licenseTxt = getSentence(2);

auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 20, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 15, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
bottom->setTextColor(Color4B(255, 249, 225, 255));
bottom->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
bottom->setPosition(Size(defaultSize.width/2, 50));
Expand All @@ -1127,7 +1127,7 @@ void BookPage::setCreditPage()
cc->setPosition(Vec2(defaultSize.width/2, bottom->getContentSize().height + 120));
_rightView->addChild(cc);

auto enuma = Label::createWithSystemFont("(c) 2015 Enuma, Inc.", arialFont, 20);
auto enuma = Label::createWithSystemFont("(c) 2015 Enuma, Inc.", arialFont, 15);
enuma->setTextColor(Color4B(255, 249, 225, 255));
enuma->setPosition(cc->getPosition() + Vec2(0, cc->getContentSize().height/2 + 40));
_rightView->addChild(enuma);
Expand Down Expand Up @@ -1205,7 +1205,7 @@ void BookPage::setCreditPage()
{
string creditTxt = getSentence(1);

Label* label = Label::createWithSystemFont(creditTxt, arialFont, 35, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
Label* label = Label::createWithSystemFont(creditTxt, arialFont, 30, textViewSize, TextHAlignment::CENTER, TextVAlignment::TOP);
label->setTextColor(Color4B(54, 28, 14, 255));
label->setAnchorPoint(Vec2::ANCHOR_MIDDLE_TOP);
label->setPosition(Vec2(textViewSize.width/2, textViewSize.height - 600));
Expand All @@ -1215,7 +1215,7 @@ void BookPage::setCreditPage()
{
string licenseTxt = getSentence(2);

auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 20, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
auto bottom = Label::createWithSystemFont(licenseTxt, arialFont, 15, Size(0, 0), TextHAlignment::CENTER, TextVAlignment::CENTER);
bottom->setTextColor(Color4B(54, 28, 14, 255));
bottom->setAnchorPoint(Vec2::ANCHOR_MIDDLE_BOTTOM);
bottom->setPosition(Size(squareSize.width/2, 50));
Expand All @@ -1225,19 +1225,19 @@ void BookPage::setCreditPage()
cc->setPosition(Vec2(squareSize.width/2, bottom->getContentSize().height + 120));
_rightView->addChild(cc);

auto enuma = Label::createWithSystemFont("(c) 2015 Enuma, Inc.", arialFont, 20);
auto enuma = Label::createWithSystemFont("(c) 2015 Enuma, Inc.", arialFont, 15);
enuma->setTextColor(Color4B(54, 28, 14, 255));
enuma->setPosition(cc->getPosition() + Vec2(0, cc->getContentSize().height/2 + 40));
_rightView->addChild(enuma);

}



}







}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace ComprehensionTest
{
const Size txtSize = Size(600, 300);
// const Size txtSize = Size(510, 374);
const string fontName = FONT_MUKTA_BOLD;
const string fontName = FONT_ARIAL;

TextObject::TextObject():
_dotDirection(DotDirection::Right)
Expand All @@ -33,7 +33,7 @@ namespace ComprehensionTest
void TextObject::setText(std::string text)
{
auto halign = (location == ObjectLocation::LeftSide ? TextHAlignment::RIGHT : TextHAlignment::LEFT);
_textLabel = TodoUtil::createLabelMultilineToFit(text, 80, txtSize, fontName, Color4B(77, 77, 77, 255), halign, TextVAlignment::CENTER);
_textLabel = TodoUtil::createLabelMultilineToFit(text, 40, txtSize, fontName, Color4B(77, 77, 77, 255), halign, TextVAlignment::CENTER);
addChild(_textLabel);

setContentSize(_textLabel->getContentSize());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ namespace ComprehensionTest
_answerSprite->setPosition(this->getContentSize() / 2);
this->addChild(_answerSprite);

_letterLabel = TodoUtil::createLabel("", 60, Size::ZERO, FONT_MUKTA_BOLD, Color4B(7, 171, 24, 255));
_letterLabel = TodoUtil::createLabel("", 40, Size::ZERO, FONT_ARIAL, Color4B(7, 171, 24, 255));
_letterLabel->setAnchorPoint(Vec2::ANCHOR_TOP_LEFT);
_letterLabel->setPosition(33, this->getContentSize().height - 10.f);
this->addChild(_letterLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace MultipleChoicesSceneSpace
{
// const bool bDebug = false;
const char* defaultFont = FONT_ANDIKA_BOLD;
const char* defaultFont = FONT_ARIAL;
}

using namespace MultipleChoicesSceneSpace;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,27 +84,27 @@ namespace ComprehensionTest
_wrongAnswerSprite->setVisible(false);
addChild(_wrongAnswerSprite);

_normalLetterLabel = TodoUtil::createLabel("", 60, Size::ZERO, FONT_MUKTA_BOLD, kNormalLetterColor);
_normalLetterLabel = TodoUtil::createLabel("", 40, Size::ZERO, FONT_ARIAL, kNormalLetterColor);
_normalLetterLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT);
_normalLetterLabel->setPosition(50.f + kRevisedX, getContentSize().height / 2 + kRevisedY);
addChild(_normalLetterLabel);

_wrongLetterLabel = TodoUtil::createLabel("", 60, Size::ZERO, FONT_MUKTA_BOLD, kWrongLetterColor);
_wrongLetterLabel = TodoUtil::createLabel("", 40, Size::ZERO, FONT_ARIAL, kWrongLetterColor);
_wrongLetterLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT);
_wrongLetterLabel->setPosition(50.f + kRevisedX, getContentSize().height / 2 + kRevisedY);
addChild(_wrongLetterLabel);

_normalAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 60, Size(_normalAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_MUKTA_BOLD, kNormalAnswerColor);
_normalAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 40, Size(_normalAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_ARIAL, kNormalAnswerColor);
_normalAnswerLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT);
_normalAnswerLabel->setPosition(150.f + kRevisedX, getContentSize().height / 2 + kRevisedY);
addChild(_normalAnswerLabel);

_rightAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 60, Size(_rightAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_MUKTA_BOLD, kRightAnswerColor);
_rightAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 40, Size(_rightAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_ARIAL, kRightAnswerColor);
_rightAnswerLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT);
_rightAnswerLabel->setPosition(150.f + kRevisedX, getContentSize().height / 2 + kRevisedY);
addChild(_rightAnswerLabel);

_wrongAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 60, Size(_wrongAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_MUKTA_BOLD, kWrongAnswerColor);
_wrongAnswerLabel = TodoUtil::createLabelMultilineToFit(text, 40, Size(_wrongAnswerSprite->getContentSize().width - 210.f, 160.f), FONT_ARIAL, kWrongAnswerColor);
_wrongAnswerLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE_LEFT);
_wrongAnswerLabel->setPosition(150.f + kRevisedX, getContentSize().height / 2 + kRevisedY);
addChild(_wrongAnswerLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ string MainDepot::defaultFont() const {
}

float MainDepot::defaultFontSize() const {
return 70.f;
return 60.f;
}

Color3B MainDepot::defaultFontColor() const {
Expand Down
2 changes: 1 addition & 1 deletion pehlaschool/Classes/Games/EggQuiz/EggQuizHeader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const string soundsNumberPath = "numbervoice/d_";
const string tsvPath = "eggquiz/";

const string FONT_NORMAL = "fonts/mukta-bold.ttf";
const string FONT_BOLD = "fonts/chanakya.ttf";
const string FONT_BOLD = "arial";
const Color4B FONT_COLOR = Color4B(60,60,60,255);

const Size BUTTON_SIZE_SMALL = Size(192, 300);
Expand Down
39 changes: 23 additions & 16 deletions pehlaschool/Classes/Games/EggQuiz/EggQuizPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

BEGIN_NS_EGGQUIZ;

const string curlyFont = "fonts/chanakya.ttf";
const string curlyFont = "arial";

EggQuizPopup* EggQuizPopup::create(Node* parent)
{
Expand Down Expand Up @@ -70,7 +70,8 @@ void EggQuizPopup::setCommon(char category, int level)
panel->setPosition(winSize.width/2, winSize.height-320);
this->addChild(panel);

auto panelLabel = TodoUtil::createLabel(_cur->levelTitle, 70, Size::ZERO, curlyFont, Color4B(255, 252, 236, 255));
auto panelLabel = Label::createWithSystemFont(_cur->levelTitle, curlyFont, 70, Size::ZERO);
panelLabel->setTextColor(Color4B(255, 252, 236, 255));
panelLabel->setAnchorPoint(Vec2::ANCHOR_MIDDLE);
panelLabel->setPosition(panel->getContentSize()/2);
panel->addChild(panelLabel);
Expand Down Expand Up @@ -175,8 +176,9 @@ Button* createButton(string prefix, string text) {


if (text.length()>0) {
auto localTxt = LanguageManager::getInstance()->getLocalizedString(text);
auto l = TodoUtil::createLabel(localTxt, 60, Size::ZERO, curlyFont, Color4B(255, 252, 236, 255));
auto localTxt = LanguageManager::getInstance()->getLocalizedString(text, false);
auto l = Label::createWithSystemFont(localTxt, curlyFont, 60, Size::ZERO);
l->setTextColor(Color4B(255, 252, 236, 255));
auto lPos = btn->getContentSize()/2 + Size(0, 10);
l->setPosition(lPos);
btn->addChild(l);
Expand Down Expand Up @@ -294,16 +296,18 @@ void EggQuizPopup::setPreCompleted(char category, int level)


{
auto localTxt = LanguageManager::getInstance()->getLocalizedString("Success!");
auto l = TodoUtil::createLabel(localTxt, 70, Size::ZERO, curlyFont, Color4B(255, 252, 236, 225));
auto localTxt = LanguageManager::getInstance()->getLocalizedString("Success!", false);
auto l = Label::createWithSystemFont(localTxt, curlyFont, 70, Size::ZERO);
l->setTextColor(Color4B(255, 252, 236, 225));
l->setPosition(Vec2(winSize.width/2, winSize.height-965));
this->addChild(l);
}

{
auto s = LanguageManager::getInstance()->getLocalizedString("You passed!");
auto s = LanguageManager::getInstance()->getLocalizedString("You passed!", false);

auto l = TodoUtil::createLabel(s, 50, Size::ZERO, curlyFont, Color4B(115, 61, 19, 225));
auto l = Label::createWithSystemFont(s, curlyFont, 50, Size::ZERO);
l->setTextColor(Color4B(115, 61, 19, 225));
l->setPosition(Vec2(winSize.width/2, winSize.height-1130));
this->addChild(l);
}
Expand Down Expand Up @@ -384,8 +388,9 @@ void EggQuizPopup::setPostCompleted(char category, int level)


{
auto localTxt = LanguageManager::getInstance()->getLocalizedString("Congratulations!");
auto l = TodoUtil::createLabel(localTxt, 60, Size::ZERO, curlyFont, Color4B(255, 252, 236, 225));
auto localTxt = LanguageManager::getInstance()->getLocalizedString("Congratulations!", false);
auto l = Label::createWithSystemFont(localTxt, curlyFont, 60, Size::ZERO);
l->setTextColor(Color4B(255, 252, 236, 225));
l->setPosition(Vec2(winSize.width/2, winSize.height-965-175));
this->addChild(l);
}
Expand Down Expand Up @@ -425,10 +430,11 @@ void EggQuizPopup::setPreFailed(char category, int level)


{
auto s1 = LanguageManager::getInstance()->getLocalizedString("You are not ready.");
auto s2 = LanguageManager::getInstance()->getLocalizedString("Practice more and try again later.");
auto s1 = LanguageManager::getInstance()->getLocalizedString("You are not ready.", false);
auto s2 = LanguageManager::getInstance()->getLocalizedString("Practice more and try again later.", false);

auto l = TodoUtil::createLabel(s1+"\n"+s2, 50, Size::ZERO, curlyFont, Color4B(115, 61, 19, 225), TextHAlignment::CENTER);
auto l = Label::createWithSystemFont(s1+"\n"+s2, curlyFont, 50, Size::ZERO, TextHAlignment::CENTER);
l->setTextColor(Color4B(115, 61, 19, 225));
l->setPosition(Vec2(winSize.width/2, winSize.height-1120));
this->addChild(l);
}
Expand Down Expand Up @@ -470,9 +476,10 @@ void EggQuizPopup::setPostFailed(char category, int level)


{
auto s1 = LanguageManager::getInstance()->getLocalizedString("You are not ready.");
auto s2 = LanguageManager::getInstance()->getLocalizedString("Practice more and try again later.");
auto l = TodoUtil::createLabel(s1+"\n"+s2, 50, Size::ZERO, curlyFont, Color4B(115, 61, 19, 225), TextHAlignment::CENTER);
auto s1 = LanguageManager::getInstance()->getLocalizedString("You are not ready.", false);
auto s2 = LanguageManager::getInstance()->getLocalizedString("Practice more and try again later.", false);
auto l = Label::createWithSystemFont(s1+"\n"+s2, curlyFont, 50, Size::ZERO, TextHAlignment::CENTER);
l->setTextColor(Color4B(115, 61, 19, 225));
l->setPosition(Vec2(winSize.width/2, winSize.height-1120));
this->addChild(l);
}
Expand Down
Loading