本文整理汇总了C++中displayText函数的典型用法代码示例。如果您正苦于以下问题:C++ displayText函数的具体用法?C++ displayText怎么用?C++ displayText使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了displayText函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: glClearColor
void TestApp::init() {
glClearColor(0.18f, 0.18f, 0.22f, 1.0f);
m_camera.setPosition({0.0, -0.5, 14.0});
m_shader = uptr<OGLW::Shader>(new OGLW::Shader("default.frag", "default.vert"));
m_meshes = OGLW::loadOBJ("suzanne.obj");
m_quad = OGLW::quad(1.f);
m_backgroundShader = uptr<OGLW::Shader>(new OGLW::Shader("background.frag", "background.vert"));
for (int i = 0; i < N_SEM; ++i) {
std::string file = "sem-" + std::to_string(i) + ".jpg";
m_textures[file] = uptr<OGLW::Texture>(new OGLW::Texture(file));
}
m_texture = m_textures.begin();
m_textId = displayText(30.f, {10.f, 30.f}, m_texture->first);
displayText(20.f, {10.f, m_height - 30.f}, "'N' for next SEM");
}
开发者ID:karimnaaji,项目名称:sem-viewer,代码行数:19,代码来源:main.cpp
示例2: displayText
void TestApp::update(float _dt) {
static float time = 0.f;
time += _dt;
m_xrot += m_cursorX;
m_yrot += m_cursorY;
displayText(15.f, {m_width - 80.f, 20.f}, std::to_string(_dt).c_str() + std::string("ms"), true);
if(glfwGetKey(m_window, 'N') && time > 0.5f) {
m_texture++;
if (m_texture == m_textures.end()) {
m_texture = m_textures.begin();
}
clearText(m_textId);
m_textId = displayText(30.f, {10.f, 30.f}, m_texture->first);
time = 0.f;
}
}
开发者ID:karimnaaji,项目名称:sem-viewer,代码行数:19,代码来源:main.cpp
示例3: drawCheckBox
void drawCheckBox(GLshort x, GLshort y, const char* text)
{
glColor3f(0,0,0);
glBegin(GL_LINE_LOOP);
glVertex2s(x, y);
glVertex2s(x+20, y);
glVertex2s(x+20, y+20);
glVertex2s(x, y+20);
glEnd();
displayText(text, x+25, y+5, 'm');
}
开发者ID:Emulai,项目名称:ICT289-Project,代码行数:11,代码来源:uiControls.c
示例4: Q_UNUSED
bool PlaylistDelegateBase::helpEvent(QHelpEvent* event, QAbstractItemView* view,
const QStyleOptionViewItem& option,
const QModelIndex& index) {
// This function is copied from QAbstractItemDelegate, and changed to show
// displayText() in the tooltip, rather than the index's naked
// Qt::ToolTipRole text.
Q_UNUSED(option);
if (!event || !view) return false;
QHelpEvent* he = static_cast<QHelpEvent*>(event);
QString text = displayText(index.data(), QLocale::system());
// Special case: we want newlines in the comment tooltip
if (index.column() == Playlist::Column_Comment) {
text = Qt::escape(index.data(Qt::ToolTipRole).toString());
text.replace("\\r\\n", "<br />");
text.replace("\\n", "<br />");
text.replace("\r\n", "<br />");
text.replace("\n", "<br />");
}
if (text.isEmpty() || !he) return false;
switch (event->type()) {
case QEvent::ToolTip: {
QRect displayed_text;
QSize real_text;
bool is_elided = false;
real_text = sizeHint(option, index);
displayed_text = view->visualRect(index);
is_elided = displayed_text.width() < real_text.width();
if (is_elided) {
QToolTip::showText(he->globalPos(), text, view);
} else { // in case that another text was previously displayed
QToolTip::hideText();
}
return true;
}
case QEvent::QueryWhatsThis:
return true;
case QEvent::WhatsThis:
QWhatsThis::showText(he->globalPos(), text, view);
return true;
default:
break;
}
return false;
}
开发者ID:Atrament666,项目名称:Clementine,代码行数:54,代码来源:playlistdelegates.cpp
示例5: Q_UNUSED
void QgsComposerLabel::paint( QPainter *painter, const QStyleOptionGraphicsItem *itemStyle, QWidget *pWidget )
{
Q_UNUSED( itemStyle );
Q_UNUSED( pWidget );
if ( !painter )
{
return;
}
if ( !shouldDrawItem() )
{
return;
}
drawBackground( painter );
painter->save();
//antialiasing on
painter->setRenderHint( QPainter::Antialiasing, true );
double penWidth = hasFrame() ? ( pen().widthF() / 2.0 ) : 0;
double xPenAdjust = mMarginX < 0 ? -penWidth : penWidth;
double yPenAdjust = mMarginY < 0 ? -penWidth : penWidth;
QRectF painterRect( xPenAdjust + mMarginX, yPenAdjust + mMarginY, rect().width() - 2 * xPenAdjust - 2 * mMarginX, rect().height() - 2 * yPenAdjust - 2 * mMarginY );
if ( mHtmlState )
{
if ( mFirstRender )
{
contentChanged();
mFirstRender = false;
}
painter->scale( 1.0 / mHtmlUnitsToMM / 10.0, 1.0 / mHtmlUnitsToMM / 10.0 );
mWebPage->setViewportSize( QSize( painterRect.width() * mHtmlUnitsToMM * 10.0, painterRect.height() * mHtmlUnitsToMM * 10.0 ) );
mWebPage->settings()->setUserStyleSheetUrl( createStylesheetUrl() );
mWebPage->mainFrame()->render( painter );
}
else
{
const QString textToDraw = displayText();
painter->setFont( mFont );
//debug
//painter->setPen( QColor( Qt::red ) );
//painter->drawRect( painterRect );
QgsComposerUtils::drawText( painter, painterRect, textToDraw, mFont, mFontColor, mHAlignment, mVAlignment, Qt::TextWordWrap );
}
painter->restore();
drawFrame( painter );
if ( isSelected() )
{
drawSelectionBoxes( painter );
}
}
开发者ID:ndavid,项目名称:QGIS,代码行数:54,代码来源:qgscomposerlabel.cpp
示例6: connectOk
// Will be called when WiFi station was connected to AP
void connectOk()
{
Serial.println("I'm CONNECTED");
displayText("I'm CONNECTED to AP");
// Run MQTT client
startMqttClient();
// Start publishing loop
procTimer.initializeMs(60*1000, publishMessage).start();
}
开发者ID:godstale,项目名称:ESP8266_Sming_Examples,代码行数:12,代码来源:application.cpp
示例7: display
void display(void)
{
char buffer[256];
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/* keep in mind that `D` and `E` are simply pointers to the
corresponding control points of `spline`. */
for (i = 0; i < 3; i++) {
D[i] = A[i] + t*v[i];
E[i] = C[i] + t*w[i];
}
ts_bspline_set_control_points(&spline, ctrlp, NULL);
/* draw spline */
glColor3f(1.0, 1.0, 1.0);
glLineWidth(3);
gluBeginCurve(theNurb);
gluNurbsCurve(
theNurb,
(GLint)ts_bspline_num_knots(&spline),
knots,
(GLint)ts_bspline_dimension(&spline),
ctrlp,
(GLint)ts_bspline_order(&spline),
GL_MAP1_VERTEX_3
);
gluEndCurve(theNurb);
/* draw control points */
glColor3f(1.0, 0.0, 0.0);
glPointSize(5.0);
glBegin(GL_POINTS);
for (i = 0; i < ts_bspline_num_control_points(&spline); i++)
glVertex3fv(&ctrlp[i * ts_bspline_dimension(&spline)]);
glEnd();
/* draw B */
glColor3f(0.0, 0.0, 1.0);
glBegin(GL_POINTS);
glVertex3fv(B);
glEnd();
/* display t */
sprintf(buffer, "t: %.2f", t);
displayText(-.2f, 1.2f, 0.0, 1.0, 0.0, buffer);
glutSwapBuffers();
glutPostRedisplay();
t += 0.001f;
if (t > 1.f) {
t = 0.f;
}
}
开发者ID:retuxx,项目名称:tinyspline,代码行数:54,代码来源:triangle.c
示例8: QMainWindow
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
isBot=false;
started = false;
ui->setupUi(this);
displayText("Start");
// Load sounds
bullet = new QSound("/sounds/bullet.wav");
networkThread = new QThread();
networkManager = new NetworkManager();
networkManager->moveToThread(networkThread);
networkThread->start();
//connect(networkThread, SIGNAL(started()), networkManager, SLOT(network_init()));
connect(ui->connectButton,SIGNAL(clicked()),this,SLOT(connect_clicked()));
connect(networkManager, SIGNAL(writeText(QString)), this, SLOT(displayText(QString)));
connect(ui->disconnectButton, SIGNAL(released()), this, SLOT(stopPlay()));
connect(this, SIGNAL(sendKeyEvent(QKeyEvent*,int)), networkManager, SLOT(process_key(QKeyEvent*,int)));
connect(networkManager, SIGNAL(newPlayerScore(int)), ui->playerScore, SLOT(setNum(int)));
connect(networkManager, SIGNAL(newHealthPoints(int)), ui->healthPoints, SLOT(setValue(int)));
connect(networkManager, SIGNAL(newPlayerId(int)), ui->playerIdLabel, SLOT(setNum(int)));
connect(networkManager, SIGNAL(newTeamId(int)),ui->equipe, SLOT(setNum(int)));
connect(networkManager, SIGNAL(newIdInTeam(int)), this, SLOT(setSprite(int)));
connect(ui->checkBoxBot, SIGNAL(stateChanged(int)), this, SLOT(setBot(int)));
connect(ui->nameEdit, SIGNAL(textChanged(QString)), networkManager, SLOT(setLogin(QString)));
connect(ui->disconnectButton, SIGNAL(released()), networkManager, SLOT(disconnectClient()));
connect(this, SIGNAL(setIP(QString,int)), networkManager, SLOT(setIP(QString,int)));
connect(this, SIGNAL(setRequestedTeam(int)), networkManager, SLOT(setRequestedTeam(int)));
connect(networkManager, SIGNAL(disconnected()), this, SLOT(stopPlay()));
connect(this, SIGNAL(startNetworkManager()), networkManager, SLOT(network_init()));
readSettings();
}
开发者ID:cassou,项目名称:PFEAirstrike,代码行数:41,代码来源:mainwindow.cpp
示例9: QMenu
void InputBox::contextMenuEvent(QContextMenuEvent *event) {
QMenu *const menu = new QMenu(this);
menu->addAction(tr("&Copy"), this, SLOT(copy()))->setEnabled(hasSelectedText());
menu->addSeparator();
menu->addAction(tr("&Select All"), this, SLOT(selectAll()))->setEnabled(!displayText().isEmpty());
menu->addSeparator();
menu->addAction(tr("C&lear"), this, SLOT(clearData()))->setEnabled(getData().value != NULL_VALUE);
menu->exec(event->globalPos());
delete menu;
}
开发者ID:CatalystG,项目名称:gambatte-libretro,代码行数:12,代码来源:inputbox.cpp
示例10: al_clear_to_color
void Display::updateDisplay(Entities &entities){
al_clear_to_color(al_map_rgba(0, 0, 0, 255));
std::list<Entity*> entitiesTemp = entities.getEntities();
for (std::list<Entity*>::iterator it = entitiesTemp.begin(); it != entitiesTemp.end(); it++){
(*it)->draw();
}
displayText(score, Coordinates(80, 10), font2);
al_flip_display();
}
开发者ID:Feroxius,项目名称:Projet-ift232,代码行数:12,代码来源:Display.cpp
示例11: keyPressed
void keyPressed(int k){
int miniIdx=-1;
float miniTime=1000000000.0;
for(int i = 0; i < vecKeyTexts.size(); i++){
if(vecKeyTexts[i].limb == k){
if(miniTime > vecKeyTexts[i].timeCreated){
miniIdx = i;
miniTime = vecKeyTexts[i].timeCreated;
}
}
}
if(miniIdx != -1){
displayText(vecDiscoReactionsGood[rand()%vecDiscoReactionsGood.size()], 0);
vecKeyTexts.erase(vecKeyTexts.begin()+miniIdx);
score++;
}
else{
displayText(vecDiscoReactionsBad[rand()%vecDiscoReactionsBad.size()], 0);
score--;
}
}
开发者ID:StylishTriangles,项目名称:TadzikEngine,代码行数:21,代码来源:isayparty.hpp
示例12: clearScreen
void CTFTSerial::setIdleInt()
{
// Clear the screen
clearScreen();
setFontSize(FONT_LARGE);
// Draw MMDVM logo
displayBitmap(0U, 0U, "MMDVM_sm.bmp");
char text[30];
::sprintf(text, "%-6s / %u", m_callsign.c_str(), m_dmrid);
gotoPosPixel(18U, 55U);
displayText(text);
gotoPosPixel(45U, 90U);
displayText("IDLE");
m_mode = MODE_IDLE;
}
开发者ID:Boromatic,项目名称:MMDVMHost,代码行数:21,代码来源:TFTSerial.cpp
示例13: assert
void CTFTSerial::writeFusionInt(const char* source, const char* dest, const char* type, const char* origin)
{
assert(source != NULL);
assert(dest != NULL);
assert(type != NULL);
assert(origin != NULL);
if (m_mode != MODE_YSF) {
// Clear the screen
clearScreen();
setFontSize(FONT_MEDIUM);
// Draw the System Fusion insignia
displayBitmap(0U, 0U, "YSF_sm.bmp");
}
char text[30U];
::sprintf(text, "%s %.10s", type, source);
gotoPosPixel(5U, 70U);
displayText(text);
::sprintf(text, " %.10s", dest);
gotoPosPixel(5U, 90U);
displayText(text);
if (::strcmp(origin, " ") != 0) {
::sprintf(text, "at %.10s", origin);
gotoPosPixel(5U, 110U);
displayText(text);
} else {
gotoPosPixel(5U, 110U);
displayText(" ");
}
m_mode = MODE_YSF;
}
开发者ID:Boromatic,项目名称:MMDVMHost,代码行数:39,代码来源:TFTSerial.cpp
示例14: Display
void Display() {
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(0, 0, 1);
drawCircle(playerx,playery, 20);
glPushMatrix();
glColor3f(0, 0, 0);
drawRect(0,320 ,300, 20);
glColor3f(1, 0, 1);
drawRect(0,340, 20, 200);
glColor3f(1, 0, 1);
drawRect(200,0, 50, 20);
glPopMatrix();
// if(freez){
// playerx =700;
// playery =600;
// freez = 0;
// }
std::string name="TIME : ",result;
char numstr[2];
sprintf(numstr, "%i",t);
result = name + numstr;
displayText(600, 700, 0, 0, 0, result);
if(won){
displayText(400, 600, 0, 1,0, " CHARGES DROPED :D YOU ARE FREE TO GO!!!");
}
if(lost){
displayText(400, 600, 1, 0,0, "JURIES FOUND THAT YOU ARE GUILTY :/ !!");
// usleep(1500000);
t = 0;
}
glFlush();
}
开发者ID:Youmna-Salah,项目名称:Projects,代码行数:38,代码来源:assign1.cpp
示例15: charPos_Push
void TextMgr::displayTextInsideWindow(const char *textPtr, int16 windowRow, int16 windowColumn) {
int16 textRow = 0;
int16 textColumn = 0;
if (!_messageState.window_Active)
return;
charPos_Push();
textRow = _messageState.textPos.row + windowRow;
textColumn = _messageState.textPos.column + windowColumn;
charPos_Set(textRow, textColumn);
displayText(textPtr);
charPos_Pop();
}
开发者ID:Lybr4,项目名称:scummvm,代码行数:14,代码来源:text.cpp
示例16: displayInitials
/* displayInitials
Input: char initials[NUM_INITIALS] The current initials entered
Polygon* theFont The game font
Output: none
Displays the screen asking the user to enter his initials for the high score table
*/
void displayInitials(char initials[NUM_INITIALS], Polygon* theFont)
{
int i; /* Counter */
GLfloat currentY = INITIAL_INFO_MAX_Y; /* coordinate for the text */
GLfloat currentX = INITIALS_X; /* coordinate for the text */
displayText ( INITIAL_INFO_X, currentY, "your score is one of the ten best", INFO_SIZE, theFont);
currentY -= INFO_SPACING_Y;
displayText ( INITIAL_INFO_X, currentY, "please enter your initials", INFO_SIZE, theFont);
currentY -= INFO_SPACING_Y;
displayText (INITIAL_INFO_X, currentY, "push rotate to select letter", INFO_SIZE, theFont);
currentY -= INFO_SPACING_Y;
displayText ( INITIAL_INFO_X, currentY, "push hyperspace when letter is correct",INFO_SIZE, theFont);
currentY -= INFO_SPACING_Y;
for ( i = 0; i < NUM_INITIALS; i++)
{
char* display = (char*) malloc ( 2 *sizeof(char) );
display[0] = initials[i];
display[1] = '\0';
currentX = displayText ( currentX, INITIALS_Y, display, INITIALS_SIZE, theFont );
}
}
开发者ID:spaetzel,项目名称:RockBlaster,代码行数:29,代码来源:HiScoreImplementation.c
示例17: QString
bool PSDResourceBlock::write(QIODevice* io) const
{
dbgFile << "Writing Resource Block" << PSDImageResourceSection::idToString((PSDImageResourceSection::PSDResourceID)identifier) << identifier;
if (resource && !resource->valid()) {
error = QString("Cannot write an invalid Resource Block");
return false;
}
if (identifier == PSDImageResourceSection::LAYER_STATE ||
identifier == PSDImageResourceSection::LAYER_GROUP ||
identifier == PSDImageResourceSection::LAYER_COMPS ||
identifier == PSDImageResourceSection::LAYER_GROUP_ENABLED_ID ||
identifier == PSDImageResourceSection::LAYER_SELECTION_ID) {
/**
* We can actually handle LAYER_SELECTION_ID. It consists
* of a number of layers and a list of IDs to select, which
* are retrieved from 'lyid' additional layer block.
*/
dbgFile << "Skip writing resource block" << identifier << displayText();
return true;
}
QByteArray ba;
// createBlock returns true by default but does not change the data.
if (resource && !resource->createBlock(ba)) {
error = resource->error;
return false;
}
else if (!resource) {
// reconstruct from the data
QBuffer buf(&ba);
buf.open(QBuffer::WriteOnly);
buf.write("8BIM", 4);
psdwrite(&buf, identifier);
psdwrite_pascalstring(&buf, name);
psdwrite(&buf, dataSize);
buf.write(data);
buf.close();
}
if (io->write(ba.constData(), ba.size()) != ba.size()) {
error = QString("Could not write complete resource");
return false;
}
return true;
}
开发者ID:KDE,项目名称:krita,代码行数:50,代码来源:psd_resource_block.cpp
示例18: clearDim
void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) {
static const uint8 textColors256[] = { 0xfe, 0xa2, 0x84, 0x97, 0x9F };
static const uint8 textColors16[] = { 0x33, 0xaa, 0x88, 0x55, 0x99 };
static const uint8 soundEffect[] = { 0x0B, 0x00, 0x2B, 0x1B, 0x00 };
const uint8 *textColors = _vm->gameFlags().use16ColorMode ? textColors16 : textColors256;
if (type & 4)
type ^= 4;
else
_vm->stopPortraitSpeechAnim();
uint16 col = textColors[type & 0x7fff];
int od = _screen->curDimIndex();
if (_vm->_updateFlags & 2) {
clearDim(4);
_textDimData[4].color1 = col;
} else {
clearDim(3);
if (_vm->gameFlags().use16ColorMode) {
_textDimData[3].color1 = col;
} else {
_screen->copyColor(192, col);
_textDimData[3].color1 = 192;
}
_vm->enableTimer(11);
}
va_list args;
va_start(args, str);
vsnprintf((char *)_buffer, 240, str, args);
va_end(args);
displayText(_buffer);
_screen->setScreenDim(od);
_lineCount = 0;
if (!(type & 0x8000)) {
if (soundEffect[type])
_vm->sound()->playSoundEffect(soundEffect[type]);
}
_vm->_textColorFlag = type & 0x7fff;
_vm->_fadeText = false;
}
开发者ID:chrisws,项目名称:scummvm,代码行数:50,代码来源:text_lol.cpp
示例19: main
// main task
task main ()
{
int _dirDC = 0;
int _dirAC = 0;
int dcS1, dcS2, dcS3, dcS4, dcS5 = 0;
int acS1, acS2, acS3, acS4, acS5 = 0;
string tmpString;
// show the user what to do
displayInstructions();
eraseDisplay();
for (int i = 0; i < 8; ++i)
sTextLines[i] = "";
// display the current DSP mode
// When connected to a SMUX, the IR Seeker V2 can only be
// used in 1200Hz mode.
nxtDisplayTextLine(0, " DC 1200");
// The sensor is connected to the first port
// of the SMUX which is connected to the NXT port S1.
// To access that sensor, we must use msensor_S1_1. If the sensor
// were connected to 3rd port of the SMUX connected to the NXT port S4,
// we would use msensor_S4_3
while (true)
{
// Read the current non modulated signal direction
_dirDC = HTIRS2readDCDir(HTIRS2);
if (_dirDC < 0)
break; // I2C read error occurred
// read the current modulated signal direction
_dirAC = HTIRS2readACDir(HTIRS2);
if (_dirAC < 0)
break; // I2C read error occurred
// Read the individual signal strengths of the internal sensors
// Do this for both unmodulated (DC) and modulated signals (AC)
if (!HTIRS2readAllDCStrength(HTIRS2, dcS1, dcS2, dcS3, dcS4, dcS5))
break; // I2C read error occurred
if (!HTIRS2readAllACStrength(HTIRS2, acS1, acS2, acS3, acS4, acS5 ))
break; // I2C read error occurred
displayText(1, "D", _dirDC, _dirAC);
displayText(2, "0", dcS1, acS1);
displayText(3, "1", dcS2, acS2);
displayText(4, "2", dcS3, acS3);
displayText(5, "3", dcS4, acS4);
displayText(6, "4", dcS5, acS5);
if (HTSMUXreadPowerStatus(HTSMUX))
nxtDisplayTextLine(7, "Batt: bad");
else
nxtDisplayTextLine(7, "Batt: good");
}
}
开发者ID:2000andrewbowen,项目名称:FTC-2013-2014,代码行数:58,代码来源:hitechnic-irseeker-v2-SMUX-test1.c
示例20: displayText
void CtrlText::onUpdate( Subject<VarBool> &rVariable, void *arg )
{
(void)arg;
// Visibility changed
if( &rVariable == m_pVisible )
{
if( isVisible() )
{
displayText( m_rVariable.get() );
notifyLayout( getPosition()->getWidth(), getPosition()->getHeight() );
}
else
{
notifyLayout();
}
}
}
开发者ID:vlcchina,项目名称:vlc-player-experimental,代码行数:17,代码来源:ctrl_text.cpp
注:本文中的displayText函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论