当前位置: 首页>>代码示例>>C++>>正文


C++ GuiText::setTextBlur方法代码示例

本文整理汇总了C++中GuiText::setTextBlur方法的典型用法代码示例。如果您正苦于以下问题:C++ GuiText::setTextBlur方法的具体用法?C++ GuiText::setTextBlur怎么用?C++ GuiText::setTextBlur使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GuiText的用法示例。


在下文中一共展示了GuiText::setTextBlur方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GuiFrame


//.........这里部分代码省略.........
    okButton.setTrigger(&wpadTouchTrigger);
    okButton.setSoundClick(buttonClickSound);
    okButton.setEffectGrow();
    append(&okButton);

    titleText.setColor(glm::vec4(1.0f, 1.0f, 1.0f, 1.0f));
    titleText.setFontSize(46);
    titleText.setPosition(0, 230);
    titleText.setBlurGlowColor(5.0f, glm::vec4(0.0, 0.0, 0.0f, 1.0f));
    titleText.setText(strTitle.c_str());
    append(&titleText);

    deleteButton.setImage(&deleteButtonImg);
    deleteButton.setImageOver(&deleteButtonImgClick);
    deleteButton.setTrigger(&touchTrigger);
    deleteButton.setTrigger(&wpadTouchTrigger);
    deleteButton.setSoundClick(buttonClickSound);
    deleteButton.setPosition(-(keyPadButtonImgData->getWidth() + 5) * (MAX_COLS - 1) * 0.5f + (keyPadButtonImgData->getWidth() + 5) * MAX_COLS, -60);
    deleteButton.setEffectGrow();
    deleteButton.clicked.connect(this, &KeyPadMenu::OnDeleteButtonClick);
    append(&deleteButton);


    for(int i = 0; i < MAX_FIELDS; i++)
    {
        char fieldTxt[2];
        fieldTxt[0] = (i < (int)currentText.size()) ? currentText[i] : 0;
        fieldTxt[1] = 0;

        GuiText *text = new GuiText(fieldTxt, 46, glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));
        GuiImage *image = new GuiImage(fieldImageData);
        GuiButton *button = new GuiButton(image->getWidth(), image->getHeight());
        button->setImage(image);
        button->setLabel(text);
        button->setPosition(-(image->getWidth() + 8) * (MAX_FIELDS - 1) * 0.5f + (image->getWidth() + 8) * i, 120);
        button->setTrigger(&touchTrigger);
        button->setTrigger(&wpadTouchTrigger);
        button->setSoundClick(buttonClickSound);
        button->clicked.connect(this, &KeyPadMenu::OnTextPositionChange);
        append(button);

        textFieldText.push_back(text);
        textFieldImg.push_back(image);
        textFieldBtn.push_back(button);
    }

    fieldBlinkerImg.setAlignment(ALIGN_LEFT | ALIGN_LEFT);
    fieldBlinkerImg.setPosition(5, 0);

    if(textPosition < MAX_FIELDS)
        textFieldBtn[textPosition]->setIcon(&fieldBlinkerImg);

    int row = 0, column = 0;

    for(int i = 0; cpKeyPadButtons[i]; i++)
    {
        char buttonTxt[2];
        buttonTxt[0] = cpKeyPadButtons[i];
        buttonTxt[1] = 0;


        GuiImage *image = new GuiImage(keyPadButtonImgData);
        GuiImage *imageClick = new GuiImage(keyPadButtonClickImgData);
        GuiButton *button = new GuiButton(image->getWidth(), image->getHeight());
        GuiText *text = new GuiText(buttonTxt, 46, glm::vec4(0.0f, 0.0f, 0.0f, 1.0f));
        text->setTextBlur(5.0f);


        button->setImage(image);
        button->setImageOver(imageClick);
        button->setLabel(text);
        button->setPosition(-(image->getWidth() + 5) * (MAX_COLS - 1) * 0.5f + (image->getWidth() + 5) * column, -60 - (image->getHeight() + 5) * row);
        button->setTrigger(&touchTrigger);
        button->setTrigger(&wpadTouchTrigger);
        button->setSoundClick(buttonClickSound);
        button->setEffectGrow();
        button->clicked.connect(this, &KeyPadMenu::OnKeyPadButtonClick);
        append(button);


        keyText.push_back(text);
        keyButton.push_back(button);
        keyImg.push_back(image);
        keyImgOver.push_back(imageClick);

        column++;
        if(column >= MAX_COLS)
        {
            column = 0;
            row++;
        }
    }

    DPADButtons.setTrigger(&buttonATrigger);
    DPADButtons.setTrigger(&buttonBTrigger);
    DPADButtons.clicked.connect(this, &KeyPadMenu::OnDPADClick);
    append(&DPADButtons);

    UpdateTextFields();
}
开发者ID:Axel-F,项目名称:loadiine_gx2,代码行数:101,代码来源:KeyPadMenu.cpp


注:本文中的GuiText::setTextBlur方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。