void ActorWidget::draw(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); if( UMLWidget::getUseFillColour() ) p.setBrush( UMLWidget::getFillColour() ); const int w = width(); const int h = height(); p.setFont( UMLWidget::font() ); const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int textWidth = fm.width(name()); const int fontHeight = fm.lineSpacing(); const int a_height = h - fontHeight - A_MARGIN; const int h2 = a_height / 2; const int w2 = w - A_MARGIN * 2; const int a_width = (h2 > w2 || w > textWidth + A_MARGIN * 2 ? w2 : h2); const int middleX = w / 2; const int thirdY = a_height / 3; //draw actor p.drawEllipse(offsetX + middleX - a_width / 2, offsetY, a_width, thirdY); //head p.drawLine(offsetX + middleX, offsetY + thirdY, offsetX + middleX, offsetY + thirdY * 2); //body p.drawLine(offsetX + middleX, offsetY + 2 * thirdY, offsetX + middleX - a_width / 2, offsetY + a_height); //left leg p.drawLine(offsetX + middleX, offsetY + 2 * thirdY, offsetX + middleX + a_width / 2, offsetY + a_height); //right leg p.drawLine(offsetX + middleX - a_width / 2, offsetY + thirdY + thirdY / 2, offsetX + middleX + a_width / 2, offsetY + thirdY + thirdY / 2); //arms //draw text p.setPen(QPen(Qt::black)); p.drawText(offsetX + A_MARGIN, offsetY + h - fontHeight, w - A_MARGIN * 2, fontHeight, Qt::AlignCenter, name()); if(m_bSelected) drawSelected(&p, offsetX, offsetY); }
void ComponentWidget::draw(QPainter & p, int offsetX, int offsetY) { UMLComponent *umlcomp = static_cast<UMLComponent*>(m_pObject); if (umlcomp == NULL) return; UMLWidget::setPen(p); if ( umlcomp->getExecutable() ) { QPen thickerPen = p.pen(); thickerPen.setWidth(2); p.setPen(thickerPen); } if ( UMLWidget::getUseFillColour() ) { p.setBrush( UMLWidget::getFillColour() ); } else { p.setBrush( m_pView->viewport()->backgroundColor() ); } const int w = width(); const int h = height(); QFont font = UMLWidget::getFont(); font.setBold(true); const QFontMetrics &fm = getFontMetrics(FT_BOLD); const int fontHeight = fm.lineSpacing(); QString name = getName(); const QString stereotype = m_pObject->getStereotype(); p.drawRect(offsetX + 2*COMPONENT_MARGIN, offsetY, w - 2*COMPONENT_MARGIN, h); p.drawRect(offsetX, offsetY + h/2 - fontHeight/2 - fontHeight, COMPONENT_MARGIN*4, fontHeight); p.drawRect(offsetX, offsetY + h/2 + fontHeight/2, COMPONENT_MARGIN*4, fontHeight); p.setPen( QPen(Qt::black) ); p.setFont(font); int lines = 1; if (!stereotype.isEmpty()) { p.drawText(offsetX + (COMPONENT_MARGIN*4), offsetY + (h/2) - fontHeight, w - (COMPONENT_MARGIN*4), fontHeight, Qt::AlignCenter, m_pObject->getStereotype(true)); lines = 2; } if ( UMLWidget::getIsInstance() ) { font.setUnderline(true); p.setFont(font); name = UMLWidget::getInstanceName() + " : " + name; } if (lines == 1) { p.drawText(offsetX + (COMPONENT_MARGIN*4), offsetY + (h/2) - (fontHeight/2), w - (COMPONENT_MARGIN*4), fontHeight, Qt::AlignCenter, name ); } else { p.drawText(offsetX + (COMPONENT_MARGIN*4), offsetY + (h/2), w - (COMPONENT_MARGIN*4), fontHeight, Qt::AlignCenter, name ); } if(m_bSelected) { drawSelected(&p, offsetX, offsetY); } }
void Checkers::newPlay() { int term; currentPlayer = 1; GLFWwindow* window; glfwSetErrorCallback(error_callback); if (!glfwInit()) exit(EXIT_FAILURE); glfwWindowHint(GLFW_RESIZABLE, GL_FALSE); window = glfwCreateWindow(800, 800, "Checkers", NULL, NULL); if (!window) { glfwTerminate(); exit(EXIT_FAILURE); } glfwMakeContextCurrent(window); glfwSwapInterval(1); glfwSetKeyCallback(window, key_callback); glfwSetMouseButtonCallback(window, mouse_button_callback); while (!glfwWindowShouldClose(window)) { thing = currentState; if (pieceSelected) { drawSelected(window); } else currentState.Display(window); if (spotSelected) { spotSelected = false; if (player1.LegalMove(MoveStart, MoveEnd, currentState)) { canSelect = false; pieceSelected = false; currentState.FullMove(MoveStart, MoveEnd); currentState.Display(window); term = CheckTerminal(currentState); glfwSwapBuffers(window); currentPlayer = 2; //as soon as player moves, AI makes a move. if (term == 0) { AIMove = player2.getmove(currentState); MoveStart = { AIMove[0],AIMove[1] }; MoveEnd = { AIMove[2],AIMove[3] }; currentState.FullMove(MoveStart, MoveEnd); term = CheckTerminal(currentState); currentPlayer = 1; canSelect = true; } } } glfwSwapBuffers(window); glfwPollEvents(); if (term != 0) { glfwSetWindowShouldClose(window, GL_TRUE); } } }
QColor TalkablePainter::textColor() const { const QPalette::ColorGroup colorGroup = drawDisabled() ? QPalette::Disabled : QPalette::Normal; const QPalette::ColorRole colorRole = drawSelected() ? QPalette::HighlightedText : QPalette::Text; return Option.palette.color(colorGroup, colorRole); }
void BoxWidget::draw(QPainter& p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); p.drawRect( offsetX, offsetY, width(), height() ); if (m_bSelected) { drawSelected(&p, offsetX, offsetY); } }
void RNDFEditGLView::paintGL() { glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); activate3DMode(); glDisable(GL_DEPTH_TEST); glPushMatrix(); // draw imagery bool show_flat_imagery = true; double current_time = drc::Time::current(); static double last_time = 0; if (gui->show_imagery_) { if (current_time - last_time > 0.05) { try { imagery_->update(); } catch(vlr::Ex<>& e) { std::cout << "Failed to update imagery :" << e.what() << std::endl; } last_time = current_time; } glPushMatrix(); { // glTranslatef(0, 0, -DGC_PASSAT_HEIGHT); try { imagery_->draw3D(camera_pose.distance, camera_pose.x_offset, camera_pose.y_offset, gui->rndf_center.x, gui->rndf_center.y, gui->rndf_center.zone, show_flat_imagery, 1.0, 1); } catch(vlr::Ex<>& e) { std::cout << "Failed to draw imagery :" << e.what() << std::endl; } } glPopMatrix(); } // draw road network gui->rn_->draw(gui->rndf_center.x, gui->rndf_center.y, 1, true); // draw selected waypoint drawSelected(gui->rndf_center.x, gui->rndf_center.y); // draw coordinate frame draw_coordinate_frame(2.0); drawTrajectory(gui->rndf_center.x, gui->rndf_center.y); glPopMatrix(); refresh_required=false; }
//class handler void Bar::drawBar(BITMAP* buffer,int volume,bool selection){ if (selection){ drawSelected(buffer,volume); drawTextSelected(buffer); } else { drawDefault(buffer,volume); drawTextDefault(buffer); } }
void Button::drawButton(BITMAP* buffer,bool selection){ if (selection){ drawSelected(buffer); drawTextSelected(buffer); } else if (!selection){ drawDefault(buffer); drawTextDefault(buffer); } }
void ArtScene::tableCellTouched(TableView* table, TableViewCell* cell) { CCLOG("cell touched at index: %ld", cell->getIdx()); if (_selectedCell) _selectedCell->setHighlight(false); ((ArtSceneCell*)cell)->setHighlight(true); _selectedCell = (ArtSceneCell*)cell; _selectedIndex = cell->getIdx(); _selectedArt = ArtManager::getInstance()->getArt(_selectedGallary->artIds.at(_selectedIndex)); drawSelected(); }
QTextDocument *TalkablePainter::getDescriptionDocument(int width) { if (DescriptionDocument) return DescriptionDocument; fixColors(); const QColor &color = drawSelected() || drawDisabled() || !Configuration->useConfigurationColors() ? textColor() : Configuration->descriptionColor(); DescriptionDocument = createDescriptionDocument(Index.data(DescriptionRole).toString(), width, color); return DescriptionDocument; }
/** * Overrides standard method. */ void PackageWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); if ( UMLWidget::useFillColor() ) p.setBrush( UMLWidget::fillColor() ); else p.setBrush( m_scene->viewport()->palette().color(QPalette::Background) ); int w = width(); int h = height(); QFont font = UMLWidget::font(); font.setBold(true); //FIXME italic is true when a package is first created until you click elsewhere, not sure why font.setItalic(false); const QFontMetrics &fm = getFontMetrics(FT_BOLD); const int fontHeight = fm.lineSpacing(); p.drawRect(offsetX, offsetY, 50, fontHeight); if (m_pObject->stereotype() == "subsystem") { const int fHalf = fontHeight / 2; const int symY = offsetY + fHalf; const int symX = offsetX + 38; p.drawLine(symX, symY, symX, symY + fHalf - 2); // left leg p.drawLine(symX + 8, symY, symX + 8, symY + fHalf - 2); // right leg p.drawLine(symX, symY, symX + 8, symY); // waist p.drawLine(symX + 4, symY, symX + 4, symY - fHalf + 2); // head } p.drawRect(offsetX, offsetY + fontHeight - 1, w, h - fontHeight); p.setPen(textColor()); p.setFont(font); int lines = 1; if (m_pObject != NULL) { QString stereotype = m_pObject->stereotype(); if (!stereotype.isEmpty()) { p.drawText(offsetX, offsetY + fontHeight + PACKAGE_MARGIN, w, fontHeight, Qt::AlignCenter, m_pObject->stereotype(true)); lines = 2; } } p.drawText(offsetX, offsetY + (fontHeight*lines) + PACKAGE_MARGIN, w, fontHeight, Qt::AlignCenter, name() ); if(m_selected) { drawSelected(&p, offsetX, offsetY); } }
void RegionWidget::paint(QPainter & p, int offsetX, int offsetY) { setPenFromSettings(p); const int w = width(); const int h = height(); QPen pen = p.pen(); { setPenFromSettings(p); pen.setColor ( Qt::red ); pen.setStyle ( Qt::DashLine ); p.setPen( pen ); p.drawRoundRect(offsetX, offsetY, w, h, (h * 60) / w, 60); } if(m_selected) drawSelected(&p, offsetX, offsetY); }
void CategoryWidget::paint(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPenFromSettings(p); if ( UMLWidget::useFillColor() ) p.setBrush( UMLWidget::fillColor() ); QFont font = UMLWidget::font(); font.setUnderline(false); font.setBold(false); font.setItalic( m_pObject->isAbstract() ); p.setFont( font ); const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); // the height is our radius const int h = height(); const int w = width(); const int r = h > w ? h : w; //int middleX = w / 2; const int textStartY = (r / 2) - (fontHeight / 2); // draw a circle p.drawEllipse(offsetX, offsetY, r, r); p.setPen(textColor()); QString letterType('D'); switch( static_cast<UMLCategory*>( m_pObject )->getType() ) { case UMLCategory::ct_Disjoint_Specialisation: letterType = 'D'; break; case UMLCategory::ct_Overlapping_Specialisation: letterType = 'O'; break; case UMLCategory::ct_Union: letterType = 'U'; break; default: break; } p.drawText(offsetX + UC_MARGIN, offsetY + textStartY, r - UC_MARGIN * 2, fontHeight, Qt::AlignCenter, letterType ); UMLWidget::setPenFromSettings(p); if(m_selected) drawSelected(&p, offsetX, offsetY); }
void TalkablePainter::paint(QPainter *painter) { ItemRect = Option.rect; ItemRect.adjust(HFrameMargin, VFrameMargin, -HFrameMargin, -VFrameMargin); computeLayout(); fixColors(); // some bit of broken logic if (drawSelected() || drawDisabled() || !Configuration->useConfigurationColors()) painter->setPen(textColor()); else { Buddy buddy = Index.data(BuddyRole).value<Buddy>(); Contact contact = Index.data(ContactRole).value<Contact>(); if (buddy.isBlocked() || contact.isBlocking()) painter->setPen(QColor(255, 0, 0)); else painter->setPen(Configuration->fontColor()); } paintCheckbox(painter); paintIcon(painter); paintAvatar(painter); paintIdentityName(painter); paintName(painter); paintDescription(painter); /* paintDebugRect(painter, ItemRect, QColor(255, 0, 0)); paintDebugRect(painter, CheckboxRect, QColor(255, 255, 0)); paintDebugRect(painter, IconRect, QColor(0, 255, 0)); paintDebugRect(painter, AvatarRect, QColor(0, 0, 255)); paintDebugRect(painter, IdentityNameRect, QColor(255, 0, 255)); paintDebugRect(painter, NameRect, QColor(0, 255, 255)); paintDebugRect(painter, DescriptionRect, QColor(0, 0, 0)); */ }
void PreconditionWidget::paint(QPainter & p, int /*offsetX*/, int offsetY) { int w = width(); int h = height(); int x = m_pOw->getX() + m_pOw->getWidth() / 2; x -= w/2; setX(x); int y = offsetY; //test if y isn't above the object if (y <= m_pOw->getY() + m_pOw->getHeight() ) { y = m_pOw->getY() + m_pOw->getHeight() + 15; } if (y + h >= m_pOw->getEndLineY()) { y = m_pOw->getEndLineY() - h; } setY(y); setPenFromSettings(p); if ( UMLWidget::useFillColor() ) { p.setBrush( UMLWidget::fillColor() ); } { const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); const QString precondition_value = "{ " + name() + " }"; //int middleX = w / 2; int textStartY = (h / 2) - (fontHeight / 2); p.drawRoundRect(x, y, w, h, (h * 60) / w, 60); p.setPen(textColor()); p.setFont( UMLWidget::font() ); p.drawText(x + PRECONDITION_MARGIN, y + textStartY, w - PRECONDITION_MARGIN * 2, fontHeight, Qt::AlignCenter, precondition_value); } if(m_selected) drawSelected(&p, x, y); }
void GLMeshGroup::draw(int selected) { if(meshes.size() == 0) return; bool firstDraw = true; drawSelected(selected); for(std::vector<GLMeshInstance *>::iterator it = meshes.begin(); it != meshes.end(); it++) { if(!(*it)->hasDrawn()) { if((*it)->isVisible()) { if(firstDraw) { firstDraw = false; (*it)->bindBuffers(); } (*it)->transform(); (*it)->drawBuffers(); } } } if(!firstDraw) { GLMeshInstance *first = meshes[0]; first->unbindBuffers(); } }
void EntityWidget::draw(QPainter& p, int offsetX, int offsetY) { UMLWidget::setPen(p); if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColour()); else p.setBrush(m_pView -> viewport() -> backgroundColor()); const int w = width(); const int h = height(); const QFontMetrics &fm = getFontMetrics(FT_NORMAL); int fontHeight = fm.lineSpacing(); const QString name = this->getName(); p.drawRect(offsetX, offsetY, w, h); p.setPen(QPen(Qt::black)); QFont font = UMLWidget::getFont(); font.setBold(true); p.setFont(font); int y = 0; if ( !m_pObject->getStereotype().isEmpty() ) { p.drawText(offsetX + ENTITY_MARGIN, offsetY, w - ENTITY_MARGIN * 2,fontHeight, Qt::AlignCenter, m_pObject->getStereotype(true)); font.setItalic( m_pObject -> getAbstract() ); p.setFont(font); p.drawText(offsetX + ENTITY_MARGIN, offsetY + fontHeight, w - ENTITY_MARGIN * 2, fontHeight, Qt::AlignCenter, name); font.setBold(false); font.setItalic(false); p.setFont(font); y = fontHeight * 2; } else { font.setItalic( m_pObject -> getAbstract() ); p.setFont(font); p.drawText(offsetX + ENTITY_MARGIN, offsetY, w - ENTITY_MARGIN * 2, fontHeight, Qt::AlignCenter, name); font.setBold(false); font.setItalic(false); p.setFont(font); y = fontHeight; } UMLWidget::setPen(p); p.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y); QFontMetrics fontMetrics(font); UMLClassifier *classifier = (UMLClassifier*)m_pObject; UMLClassifierListItem* entityattribute = 0; UMLClassifierListItemList list = classifier->getFilteredList(Uml::ot_EntityAttribute); for (entityattribute = list.first(); entityattribute; entityattribute = list.next()) { QString text = entityattribute->getName(); p.setPen( QPen(Qt::black) ); UMLEntityAttribute* casted = dynamic_cast<UMLEntityAttribute*>( entityattribute ); if( casted && casted->getIndexType() == Uml::Primary ) { font.setUnderline( true ); p.setFont( font ); font.setUnderline( false ); } p.drawText(offsetX + ENTITY_MARGIN, offsetY + y, fontMetrics.width(text), fontHeight, Qt::AlignVCenter, text); p.setFont( font ); y+=fontHeight; } if (m_bSelected) { drawSelected(&p, offsetX, offsetY); } }
void StateWidget::draw(QPainter & p, int offsetX, int offsetY) { UMLWidget::setPen(p); const int w = width(); const int h = height(); switch (m_StateType) { case Normal : if(UMLWidget::getUseFillColour()) p.setBrush(UMLWidget::getFillColour()); { const QFontMetrics &fm = getFontMetrics(FT_NORMAL); const int fontHeight = fm.lineSpacing(); int textStartY = (h / 2) - (fontHeight / 2); const int count = m_Activities.count(); if( count == 0 ) { p.drawRoundRect(offsetX, offsetY, w, h, (h*40)/w, (w*40)/h); p.setPen(Qt::black); QFont font = UMLWidget::getFont(); font.setBold( false ); p.setFont( font ); p.drawText(offsetX + STATE_MARGIN, offsetY + textStartY, w - STATE_MARGIN * 2, fontHeight, Qt::AlignCenter, getName()); UMLWidget::setPen(p); } else { p.drawRoundRect(offsetX, offsetY, w, h, (h*40)/w, (w*40)/h); textStartY = offsetY + STATE_MARGIN; p.setPen(Qt::black); QFont font = UMLWidget::getFont(); font.setBold( true ); p.setFont( font ); p.drawText(offsetX + STATE_MARGIN, textStartY, w - STATE_MARGIN * 2, fontHeight, Qt::AlignCenter, getName()); font.setBold( false ); p.setFont( font ); UMLWidget::setPen(p); int linePosY = textStartY + fontHeight; QStringList::Iterator end(m_Activities.end()); for( QStringList::Iterator it(m_Activities.begin()); it != end; ++it ) { textStartY += fontHeight; p.drawLine( offsetX, linePosY, offsetX + w - 1, linePosY ); p.setPen(Qt::black); p.drawText(offsetX + STATE_MARGIN, textStartY, w - STATE_MARGIN * 2 - 1, fontHeight, Qt::AlignCenter, *it); UMLWidget::setPen(p); linePosY += fontHeight; }//end for }//end else } break; case Initial : p.setBrush( WidgetBase::getLineColor() ); p.drawEllipse( offsetX, offsetY, w, h ); break; case End : p.setBrush( WidgetBase::getLineColor() ); p.drawEllipse( offsetX, offsetY, w, h ); p.setBrush( Qt::white ); p.drawEllipse( offsetX + 1, offsetY + 1, w - 2, h - 2 ); p.setBrush( WidgetBase::getLineColor() ); p.drawEllipse( offsetX + 3, offsetY + 3, w - 6, h - 6 ); break; default: kWarning() << "Unknown state type:" << m_StateType << endl; break; } if(m_bSelected) drawSelected(&p, offsetX, offsetY); }
void CQSVGGroup:: drawTerm() { drawSelected(); }
void CQSVGDefs:: drawTerm() { drawSelected(); }
void CQSVGText:: drawTerm() { drawSelected(); }
void CQSVGUse:: drawTerm() { drawSelected(); }
// on "init" you need to initialize your instance bool ArtScene::init() { setTouchEnabled(false); CCLog("INIT!"); //draw a giant box behind everything Size visibleSize = Director::getInstance()->getVisibleSize(); Point origin = Director::getInstance()->getVisibleOrigin(); _selectedIndex = 0; _selectedGallary = GameManager::getInstance()->getSelectedGallary(); _selectedArt = ArtManager::getInstance()->getArt(_selectedGallary->artIds.at(_selectedIndex)); auto background = LayerColor::create(Color4B::WHITE, visibleSize.width, visibleSize.height); background->setPosition(Point(0, 0)); addChild(background); auto redBox = TopBar::create(); addChild(redBox); auto blackBox = LayerColor::create(Color4B::BLACK, visibleSize.width, 40 * G_assetScale); blackBox->setPosition(Point(0, 0)); addChild(blackBox); auto gradBox1 = LayerGradient::create(Color4B(120, 120, 120, 255), Color4B(243, 243, 243, 255), Point(1, 0)); gradBox1->setContentSize(Size(visibleSize.width * 0.5f, 60 * G_assetScale)); gradBox1->setPosition(Point(0, 40 * G_assetScale)); addChild(gradBox1); auto gradBox2 = LayerGradient::create(Color4B(243, 243, 243, 255), Color4B(120, 120, 120, 255), Point(1, 0)); gradBox2->setContentSize(Size(visibleSize.width * 0.5f, 60 * G_assetScale)); gradBox2->setPosition(Point(visibleSize.width * 0.5f, 40 * G_assetScale)); addChild(gradBox2); auto slimBar = LayerColor::create(Color4B(151, 151, 151, 255), visibleSize.width, 1); slimBar->setPosition(Point(0, 100 * G_assetScale)); addChild(slimBar); auto slimBar2 = LayerColor::create(Color4B(51, 51, 51, 255), visibleSize.width, 1); slimBar2->setPosition(Point(0, visibleSize.height - redBox->getContentSize().height - 1)); addChild(slimBar2); auto picBox = LayerColor::create(Color4B::BLACK, visibleSize.width - 50, 120 * G_assetScale); picBox->setPosition(Point(25, visibleSize.height - 240 * G_assetScale)); addChild(picBox); auto artY = 180.0f * G_assetScale; _artImage = CCSprite::create(); _artImage->setPosition(Point(visibleSize.width * 0.5f, visibleSize.height - artY)); addChild(_artImage); float starBoxSize = 75 * G_assetScale; float starBoxPadding = 18 * G_assetScale; float starY = 128 * G_assetScale; float starX1 =(visibleSize.width - starBoxSize) * 0.5f; float starX2 = starX1 - (starBoxPadding + starBoxSize); float starX3 = starX1 + starBoxPadding + starBoxSize; _starBox1 = (DifficultyButton*)DifficultyButton::create(); _starBox1->setPosition(starX2, starY); addChild(_starBox1); _starBox2 = (DifficultyButton*)DifficultyButton::create(); _starBox2->setPosition(starX1, starY); addChild(_starBox2); _starBox3 = (DifficultyButton*)DifficultyButton::create(); _starBox3->setPosition(starX3, starY); addChild(_starBox3); { FontDefinition fontDef; fontDef._fontName = Utils::getExtraBoldFont(); fontDef._fontSize = round(12 * G_assetScale) * 4; auto label = LabelTTF::createWithFontDefinition("GALLARY " + _selectedGallary->romanNumber, fontDef); label->setPosition(visibleSize.width * 0.5f, visibleSize.height - 60 * G_assetScale); label->setColor(Color3B::BLACK); label->setScale(0.25f); addChild(label); } { FontDefinition fontDef; fontDef._fontName = Utils::getBoldItalicFont(); fontDef._fontSize = round(24 * G_assetScale) * 4; auto label = LabelTTF::createWithFontDefinition(_selectedGallary->name, fontDef); label->setPosition(visibleSize.width * 0.5f, visibleSize.height - 79 * G_assetScale); label->setColor(Color3B::BLACK); label->setScale(0.25f); addChild(label); } { FontDefinition fontDef; fontDef._fontName = Utils::getBoldItalicFont(); fontDef._fontSize = round(16 * G_assetScale) * 4; _artLabel = LabelTTF::createWithFontDefinition("", fontDef); _artLabel->setPosition(visibleSize.width * 0.5f, visibleSize.height - 265 * G_assetScale); _artLabel->setColor(Color3B::BLACK); _artLabel->setScale(0.25f); addChild(_artLabel); } { FontDefinition fontDef; fontDef._fontName = Utils::getBoldItalicFont(); fontDef._fontSize = round(12 * G_assetScale) * 4; _artistLabel = LabelTTF::createWithFontDefinition("", fontDef); _artistLabel->setPosition(visibleSize.width * 0.5f, visibleSize.height - 285 * G_assetScale); _artistLabel->setColor(Color3B::BLACK); _artistLabel->setScale(0.25f); addChild(_artistLabel); } TableView* tableView = TableView::create(this, Size(Size(visibleSize.width, 60 * G_assetScale))); tableView->setDirection(ScrollView::Direction::HORIZONTAL); tableView->setPosition(Point(0, 40 * G_assetScale)); tableView->setDelegate(this); this->addChild(tableView); tableView->reloadData(); drawSelected(); return true; }