static int lua_cocos2dx_UICheckBox_addEventListenerCheckBox(lua_State* L) { if (nullptr == L) return 0; int argc = 0; UICheckBox* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(L,1,"UICheckBox",0,&tolua_err)) goto tolua_lerror; #endif self = static_cast<UICheckBox*>(tolua_tousertype(L,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { tolua_error(L,"invalid 'self' in function 'lua_cocos2dx_UICheckBox_addEventListenerCheckBox'\n", NULL); return 0; } #endif argc = lua_gettop(L) - 1; if (1 == argc) { #if COCOS2D_DEBUG >= 1 if (!toluafix_isfunction(L,2,"LUA_FUNCTION",0,&tolua_err)) { goto tolua_lerror; } #endif LuaCocoStudioEventListener* listener = LuaCocoStudioEventListener::create(); if (nullptr == listener) { tolua_error(L,"LuaCocoStudioEventListener create fail\n", NULL); return 0; } LUA_FUNCTION handler = ( toluafix_ref_function(L,2,0)); ScriptHandlerMgr::getInstance()->addObjectHandler((void*)listener, handler, ScriptHandlerMgr::HandlerType::EVENT_LISTENER); self->setUserObject(listener); self->addEventListenerCheckBox(listener, checkboxselectedeventselector(LuaCocoStudioEventListener::eventCallbackFunc)); return 0; } CCLOG("'addEventListenerCheckBox' function of UICheckBox has wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(L,"#ferror in function 'addEventListenerCheckBox'.",&tolua_err); return 0; #endif }
UICheckBox* UIFactory::createCheckBox(vec2 pos, float rot, vec2 scale, const char* filename, UIController* uiController){ UICheckBox* checkbox = new UICheckBox(filename, uiController); //Creo un estado externo UIState* externalState = UIFactory::createState(pos, rot, scale, 1.0f, NULL); //Informo que debe destruirse el estado luego de efectuar una transicion externalState->setDestroyedAfterTransition(true); //Asigno el estado checkbox->getExternalState()->makeStateTransition(externalState); return checkbox; }
UICheckBox* UICheckBox::create() { UICheckBox* widget = new UICheckBox(); if (widget && widget->init()) { return widget; } CC_SAFE_DELETE(widget); return NULL; }
void DeferredRenderingApp::HDRHandler(UICheckBox const & sender) { if (DeferredRenderingLayer::DT_Final == buffer_type_) { hdr_enabled_ = sender.GetChecked(); RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance(); re.HDREnabled(hdr_enabled_); } }
void DeferredRenderingApp::AntiAliasHandler(UICheckBox const & sender) { if (DeferredRenderingLayer::DT_Final == buffer_type_) { anti_alias_enabled_ = sender.GetChecked(); RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance(); re.PPAAEnabled(anti_alias_enabled_); } }
void GlobalIlluminationApp::CtrlCameraHandler(UICheckBox const & sender) { if (sender.GetChecked()) { fpcController_.AttachCamera(this->ActiveCamera()); } else { fpcController_.DetachCamera(); } }
void CascadedShadowMapApp::CtrlCameraHandler(UICheckBox const & sender) { if (sender.GetChecked()) { fpcController_.AttachCamera(this->ActiveCamera()); } else { fpcController_.DetachCamera(); } }
void PostProcessingApp::FPSCameraHandler(UICheckBox const & sender) { if (sender.GetChecked()) { fpcController_.AttachCamera(this->ActiveCamera()); } else { fpcController_.DetachCamera(); } }
void DeferredRenderingApp::CtrlCameraHandler(UICheckBox const & sender) { if (sender.GetChecked()) { fpcController_.AttachCamera(this->ActiveCamera()); } else { fpcController_.DetachCamera(); } }
void SoundApp::Music2Handler(UICheckBox const & sender) { AudioFactory& af = Context::Instance().AudioFactoryInstance(); AudioEngine& ae = af.AudioEngineInstance(); if (sender.GetChecked()) { ae.Play(2, true); } else { ae.Stop(2); } }
UICheckBox *LandscapeToolsPanel::CreateCkeckbox(const Rect &rect, const WideString &text) { UICheckBox *checkbox = new UICheckBox("~res:/Gfx/UI/chekBox", rect); checkbox->SetDelegate(this); AddControl(checkbox); Rect textRect; textRect.x = rect.x + rect.dx + OFFSET; textRect.y = rect.y; textRect.dx = TEXT_WIDTH; textRect.dy = rect.dy; UIStaticText *textControl = new UIStaticText(textRect); textControl->SetText(text); textControl->SetFont(ControlsFactory::GetFont12()); textControl->SetTextColor(ControlsFactory::GetColorLight()); textControl->SetAlign(ALIGN_VCENTER | ALIGN_LEFT); AddControl(textControl); SafeRelease(textControl); return checkbox; }
void TessellationApp::TessellationOnHandler(UICheckBox const & sender) { bool enabled = sender.GetChecked(); checked_pointer_cast<TriangleObject>(polygon_)->TessEnabled(enabled); dialog_->Control<UIStatic>(id_edge0_static_)->SetEnabled(enabled); dialog_->Control<UISlider>(id_edge0_slider_)->SetEnabled(enabled); dialog_->Control<UIStatic>(id_edge1_static_)->SetEnabled(enabled); dialog_->Control<UISlider>(id_edge1_slider_)->SetEnabled(enabled); dialog_->Control<UIStatic>(id_edge2_static_)->SetEnabled(enabled); dialog_->Control<UISlider>(id_edge2_slider_)->SetEnabled(enabled); dialog_->Control<UIStatic>(id_inside_static_)->SetEnabled(enabled); dialog_->Control<UISlider>(id_inside_slider_)->SetEnabled(enabled); }
void DeferredRenderingApp::SSVOHandler(UICheckBox const & sender) { if ((DeferredRenderingLayer::DT_Final == buffer_type_) || (DeferredRenderingLayer::DT_SSVO == buffer_type_)) { ssvo_enabled_ = sender.GetChecked(); deferred_rendering_->SSVOEnabled(0, ssvo_enabled_); RenderEngine& re = Context::Instance().RenderFactoryInstance().RenderEngineInstance(); if (DeferredRenderingLayer::DT_SSVO == buffer_type_) { re.HDREnabled(false); } else { re.HDREnabled(hdr_enabled_); } } }
void GlobalIlluminationApp::ColorGradingHandler(UICheckBox const & sender) { Context::Instance().RenderFactoryInstance().RenderEngineInstance().ColorGradingEnabled(sender.GetChecked()); }
void GlobalIlluminationApp::AAHandler(UICheckBox const & sender) { Context::Instance().RenderFactoryInstance().RenderEngineInstance().PPAAEnabled(sender.GetChecked() ? 1 : 0); }
void GlobalIlluminationApp::SSVOHandler(UICheckBox const & sender) { deferred_rendering_->SSVOEnabled(0, sender.GetChecked()); }
void RasterizationOrderApp::ColorMapHandler(UICheckBox const & sender) { checked_pointer_cast<RenderQuad>(render_quad_)->ColorMapOn(sender.GetChecked()); }
UIWidget* UI::WrapWidget(tb::TBWidget* widget) { if (!widget) return NULL; if (widgetWrap_.Contains(widget)) return widgetWrap_[widget]; // switch this to use a factory? // this is order dependent as we're using IsOfType which also works if a base class if (widget->IsOfType<TBPopupWindow>()) { UIPopupWindow* popupWindow = new UIPopupWindow(context_, false); popupWindow->SetWidget(widget); widgetWrap_[widget] = popupWindow; return popupWindow; } if (widget->IsOfType<TBDimmer>()) { UIDimmer* dimmer = new UIDimmer(context_, false); dimmer->SetWidget(widget); widgetWrap_[widget] = dimmer; return dimmer; } if (widget->IsOfType<TBScrollContainer>()) { UIScrollContainer* container = new UIScrollContainer(context_, false); container->SetWidget(widget); widgetWrap_[widget] = container; return container; } if (widget->IsOfType<TBInlineSelect>()) { UIInlineSelect* select = new UIInlineSelect(context_, false); select->SetWidget(widget); widgetWrap_[widget] = select; return select; } if (widget->IsOfType<TBSection>()) { UISection* section = new UISection(context_, false); section->SetWidget(widget); widgetWrap_[widget] = section; return section; } if (widget->IsOfType<TBSeparator>()) { UISeparator* sep = new UISeparator(context_, false); sep->SetWidget(widget); widgetWrap_[widget] = sep; return sep; } if (widget->IsOfType<TBContainer>()) { UIContainer* container = new UIContainer(context_, false); container->SetWidget(widget); widgetWrap_[widget] = container; return container; } if (widget->IsOfType<TBSelectDropdown>()) { UISelectDropdown* select = new UISelectDropdown(context_, false); select->SetWidget(widget); widgetWrap_[widget] = select; return select; } if (widget->IsOfType<TBButton>()) { // don't wrap the close button of a TBWindow.close if (widget->GetID() == TBIDC("TBWindow.close")) return 0; UIButton* button = new UIButton(context_, false); button->SetWidget(widget); widgetWrap_[widget] = button; return button; } if (widget->IsOfType<TBTextField>()) { UITextField* textfield = new UITextField(context_, false); textfield->SetWidget(widget); widgetWrap_[widget] = textfield; return textfield; } if (widget->IsOfType<TBEditField>()) { UIEditField* editfield = new UIEditField(context_, false); editfield->SetWidget(widget); widgetWrap_[widget] = editfield; return editfield; } if (widget->IsOfType<TBSkinImage>()) { UISkinImage* skinimage = new UISkinImage(context_, "", false); skinimage->SetWidget(widget); widgetWrap_[widget] = skinimage; return skinimage; } if (widget->IsOfType<TBImageWidget>()) { UIImageWidget* imagewidget = new UIImageWidget(context_, false); imagewidget->SetWidget(widget); widgetWrap_[widget] = imagewidget; return imagewidget; } if (widget->IsOfType<TBClickLabel>()) { UIClickLabel* nwidget = new UIClickLabel(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<TBCheckBox>()) { UICheckBox* nwidget = new UICheckBox(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<TBSelectList>()) { UISelectList* nwidget = new UISelectList(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<TBMessageWindow>()) { UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<TBTabContainer>()) { UITabContainer* nwidget = new UITabContainer(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<SceneViewWidget>()) { UISceneView* nwidget = new UISceneView(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } if (widget->IsOfType<TBLayout>()) { UILayout* layout = new UILayout(context_, (UI_AXIS) widget->GetAxis(), false); layout->SetWidget(widget); widgetWrap_[widget] = layout; return layout; } if (widget->IsOfType<TBWidget>()) { UIWidget* nwidget = new UIWidget(context_, false); nwidget->SetWidget(widget); widgetWrap_[widget] = nwidget; return nwidget; } return 0; }
UIWidget* UI::WrapWidget(tb::TBWidget* widget) { if (!widget) return NULL; if (widgetWrap_.Contains(widget)) return widgetWrap_[widget]; // switch this to use a factory? // this is order dependent as we're using IsOfType which also works if a base class if (widget->IsOfType<TBPopupWindow>()) { UIPopupWindow* popupWindow = new UIPopupWindow(context_, false); popupWindow->SetWidget(widget); WrapWidget(popupWindow, widget); return popupWindow; } if (widget->IsOfType<TBDimmer>()) { UIDimmer* dimmer = new UIDimmer(context_, false); dimmer->SetWidget(widget); WrapWidget(dimmer, widget); return dimmer; } if (widget->IsOfType<TBScrollContainer>()) { UIScrollContainer* container = new UIScrollContainer(context_, false); container->SetWidget(widget); WrapWidget(container, widget); return container; } if (widget->IsOfType<TBInlineSelect>()) { UIInlineSelect* select = new UIInlineSelect(context_, false); select->SetWidget(widget); WrapWidget(select, widget); return select; } if (widget->IsOfType<TBSlider>()) { UISlider* slider = new UISlider(context_, false); slider->SetWidget(widget); WrapWidget(slider, widget); return slider; } if (widget->IsOfType<TBScrollBar>()) { UIScrollBar* slider = new UIScrollBar(context_, false); slider->SetWidget(widget); WrapWidget(slider, widget); return slider; } if (widget->IsOfType<TBColorWidget>()) { UIColorWidget* colorWidget = new UIColorWidget(context_, false); colorWidget->SetWidget(widget); WrapWidget(colorWidget, widget); return colorWidget; } if (widget->IsOfType<TBColorWheel>()) { UIColorWheel* colorWheel = new UIColorWheel(context_, false); colorWheel->SetWidget(widget); WrapWidget(colorWheel, widget); return colorWheel; } if (widget->IsOfType<TBSection>()) { UISection* section = new UISection(context_, false); section->SetWidget(widget); WrapWidget(section, widget); return section; } if (widget->IsOfType<TBSeparator>()) { UISeparator* sep = new UISeparator(context_, false); sep->SetWidget(widget); WrapWidget(sep, widget); return sep; } if (widget->IsOfType<TBContainer>()) { UIContainer* container = new UIContainer(context_, false); container->SetWidget(widget); WrapWidget(container, widget); return container; } if (widget->IsOfType<TBSelectDropdown>()) { UISelectDropdown* select = new UISelectDropdown(context_, false); select->SetWidget(widget); WrapWidget(select, widget); return select; } if (widget->IsOfType<TBPulldownMenu>()) { UIPulldownMenu* select = new UIPulldownMenu(context_, false); select->SetWidget(widget); WrapWidget(select, widget); return select; } if (widget->IsOfType<TBButton>()) { // don't wrap the close button of a TBWindow.close if (widget->GetID() == TBIDC("TBWindow.close")) return 0; UIButton* button = new UIButton(context_, false); button->SetWidget(widget); WrapWidget(button, widget); return button; } if (widget->IsOfType<TBTextField>()) { UITextField* textfield = new UITextField(context_, false); textfield->SetWidget(widget); WrapWidget(textfield, widget); return textfield; } if (widget->IsOfType<TBEditField>()) { UIEditField* editfield = new UIEditField(context_, false); editfield->SetWidget(widget); WrapWidget(editfield, widget); return editfield; } if (widget->IsOfType<TBSkinImage>()) { UISkinImage* skinimage = new UISkinImage(context_, "", false); skinimage->SetWidget(widget); WrapWidget(skinimage, widget); return skinimage; } if (widget->IsOfType<TBImageWidget>()) { UIImageWidget* imagewidget = new UIImageWidget(context_, false); imagewidget->SetWidget(widget); WrapWidget(imagewidget, widget); return imagewidget; } if (widget->IsOfType<TBClickLabel>()) { UIClickLabel* nwidget = new UIClickLabel(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBCheckBox>()) { UICheckBox* nwidget = new UICheckBox(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBRadioButton>()) { UIRadioButton* nwidget = new UIRadioButton(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBBarGraph>()) { UIBargraph* nwidget = new UIBargraph(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBSelectList>()) { UISelectList* nwidget = new UISelectList(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBMessageWindow>()) { UIMessageWindow* nwidget = new UIMessageWindow(context_, NULL, "", false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBPromptWindow>()) { UIPromptWindow* nwidget = new UIPromptWindow(context_, NULL, "", false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBFinderWindow>()) { UIFinderWindow* nwidget = new UIFinderWindow(context_, NULL, "", false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBTabContainer>()) { UITabContainer* nwidget = new UITabContainer(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<SceneViewWidget>()) { UISceneView* nwidget = new UISceneView(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } if (widget->IsOfType<TBLayout>()) { UILayout* layout = new UILayout(context_, (UI_AXIS) widget->GetAxis(), false); layout->SetWidget(widget); WrapWidget(layout, widget); return layout; } if (widget->IsOfType<TBWidget>()) { UIWidget* nwidget = new UIWidget(context_, false); nwidget->SetWidget(widget); WrapWidget(nwidget, widget); return nwidget; } return 0; }
PolycodeProjectEditor::PolycodeProjectEditor(PolycodeProjectManager *projectManager) : PolycodeEditor(true){ this->projectManager = projectManager; Config *conf = CoreServices::getInstance()->getConfig(); String fontName = conf->getStringValue("Polycode", "uiDefaultFontName"); int fontSize = conf->getNumericValue("Polycode", "uiDefaultFontSize"); Number padding = conf->getNumericValue("Polycode", "uiWindowSkinPadding"); headerBg = new ScreenShape(ScreenShape::SHAPE_RECT,10,10); addChild(headerBg); headerBg->setPositionMode(ScreenEntity::POSITION_TOPLEFT); headerBg->setColor(0.1, 0.1, 0.1, 1.0); ScreenLabel *label = new ScreenLabel("PROJECT SETTINGS", 22, "section", Label::ANTIALIAS_FULL); label->color.a = 0.4; addChild(label); label->setPosition(10, 0); moduleSettingsWindow = new UIElement(); moduleSettingsWindow->setPosition(350,10); addChild(moduleSettingsWindow); Number lastYPos = 40; label = new ScreenLabel("PROJECT MODULES", 22, "section", Label::ANTIALIAS_FULL); label->color.a = 0.4; moduleSettingsWindow->addChild(label); label->setPosition(0, lastYPos); lastYPos += 40; String polycodeBasePath = CoreServices::getInstance()->getCore()->getDefaultWorkingDirectory(); std::vector<OSFileEntry> moduleFolders = OSBasics::parseFolder(polycodeBasePath+"/Standalone/Modules", false); for(int i=0; i < moduleFolders.size(); i++) { OSFileEntry entry = moduleFolders[i]; if(entry.type == OSFileEntry::TYPE_FOLDER) { UICheckBox *moduleCheckBox = new UICheckBox(entry.name, false); moduleCheckBox->setPosition(0, lastYPos); lastYPos += moduleCheckBox->getHeight() + 5; moduleSettingsWindow->addChild(moduleCheckBox); moduleCheckboxes.push_back(moduleCheckBox); } } lastYPos += 20; label = new ScreenLabel("PROJECT FONTS", 22, "section", Label::ANTIALIAS_FULL); label->color.a = 0.4; moduleSettingsWindow->addChild(label); label->setPosition(0, lastYPos); lastYPos += 30; fontEntryBase = new UIElement(); moduleSettingsWindow->addChild(fontEntryBase); fontEntryBase->setPosition(0, lastYPos); addFontButton = new UIButton("Add Font", 100); fontEntryBase->addChild(addFontButton); addFontButton->addEventListener(this, UIEvent::CLICK_EVENT); mainSettingsWindow = new UIElement(); mainSettingsWindow->setPosition(0,10); addChild(mainSettingsWindow); ScreenLabel *label2 = new ScreenLabel(L"DEFAULT VIDEO OPTIONS", 22, "section", Label::ANTIALIAS_FULL); label2->setColor(1.0, 1.0, 1.0, 0.4); mainSettingsWindow->addChild(label2); label2->setPosition(padding, 40); label2 = new ScreenLabel(L"Width:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding, 80); defaultWidthInput = new UITextInput(false, 60, 12); mainSettingsWindow->addChild(defaultWidthInput); defaultWidthInput->setPosition(label2->getPosition().x, label2->getPosition().y+18); defaultWidthInput->setNumberOnly(true); label2 = new ScreenLabel(L"Height:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding + 80, 80); defaultHeightInput = new UITextInput(false, 60, 12); mainSettingsWindow->addChild(defaultHeightInput); defaultHeightInput->setPosition(label2->getPosition().x, label2->getPosition().y+18); defaultHeightInput->setNumberOnly(true); label2 = new ScreenLabel(L"Anti-aliasing:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding + 160, 80); aaLevelComboBox = new UIComboBox(globalMenu, 120); aaLevelComboBox->addComboItem("No AA"); aaLevelComboBox->addComboItem("2x MSAA"); aaLevelComboBox->addComboItem("4x MSAA"); aaLevelComboBox->addComboItem("6x MSAA"); aaLevelComboBox->setPosition(label2->getPosition().x, label2->getPosition().y+18); label2 = new ScreenLabel(L"Anisotropic filtering:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding, defaultHeightInput->getPosition().y+30); afLevelComboBox = new UIComboBox(globalMenu, 250); afLevelComboBox->addComboItem("No Anisotropic Filtering"); afLevelComboBox->addComboItem("1x Anisotropic Filtering"); afLevelComboBox->addComboItem("2x Anisotropic Filtering"); afLevelComboBox->addComboItem("4x Anisotropic Filtering"); afLevelComboBox->addComboItem("8x Anisotropic Filtering"); afLevelComboBox->addComboItem("16x Anisotropic Filtering"); afLevelComboBox->setPosition(label2->getPosition().x, label2->getPosition().y+18); label2 = new ScreenLabel(L"Framerate:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding, afLevelComboBox->getPosition().y+30); framerateInput = new UITextInput(false, 60, 12); mainSettingsWindow->addChild(framerateInput); framerateInput->setPosition(label2->getPosition().x, label2->getPosition().y+18); framerateInput->setNumberOnly(true); vSyncCheckBox = new UICheckBox("V-Sync", false); vSyncCheckBox->setPosition(padding, framerateInput->getPosition().y+framerateInput->getHeight()+10); mainSettingsWindow->addChild(vSyncCheckBox); label2 = new ScreenLabel(L"STARTUP OPTIONS", 22, "section", Label::ANTIALIAS_FULL); label2->setColor(1.0, 1.0, 1.0, 0.4); mainSettingsWindow->addChild(label2); label2->setPosition(padding, vSyncCheckBox->getPosition().y+vSyncCheckBox->getHeight()+20); label2 = new ScreenLabel(L"Entry point file:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding, vSyncCheckBox->getPosition().y+70); entryPointInput = new UITextInput(false, 200, 12); mainSettingsWindow->addChild(entryPointInput); entryPointInput->setPosition(label2->getPosition().x, label2->getPosition().y+18); mainSettingsWindow->addChild(afLevelComboBox); mainSettingsWindow->addChild(aaLevelComboBox); label2 = new ScreenLabel(L"Background color:", fontSize, fontName, Label::ANTIALIAS_FULL); mainSettingsWindow->addChild(label2); label2->setPosition(padding, entryPointInput->getPosition().y+entryPointInput->getHeight()+10); bgColorBox = new UIColorBox(globalColorPicker, Color(1.0, 0.5, 0.0, 0.9), 30,30); bgColorBox->setPosition(label2->getPosition().x, label2->getPosition().y+18); mainSettingsWindow->addChild(bgColorBox); }