本文整理汇总了C++中Label::alpha方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::alpha方法的具体用法?C++ Label::alpha怎么用?C++ Label::alpha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::alpha方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCollection
void setCollection(int c, int levelInC)
{
if (c < 0 || static_cast<unsigned int>(c) >=m_levels->numCollections()) {
return;
}
m_collection = c;
m_dispbase = 0;
m_dispcount = m_levels->collectionSize(c);
m_scroll->virtualSize(Vec2(SCREEN_WIDTH,150+(SCREEN_HEIGHT/ICON_SCALE_FACTOR+40)*((m_dispcount+2)/3)));
m_scroll->empty();
Box *vbox = new VBox();
vbox->add( new Spacer(), 10, 0 );
Box *hbox = new HBox();
Widget *w = new Button("<<",Event::PREVIOUS);
w->border(false);
hbox->add( w, BUTTON_WIDTH, 0 );
hbox->add( new Spacer(), 10, 0 );
Label *title = new Label(m_levels->collectionName(c));
title->font(Font::headingFont());
title->alpha(100);
hbox->add( title, BUTTON_WIDTH, 4 );
w= new Button(">>",Event::NEXT);
w->border(false);
hbox->add( new Spacer(), 10, 0 );
hbox->add( w, BUTTON_WIDTH, 0 );
vbox->add( hbox, 64, 0 );
vbox->add( new Spacer(), 10, 0 );
hbox = new HBox();
hbox->add( new Spacer(), 0, 1 );
int accumw = 0;
for (int i=0; i<m_dispcount; i++) {
accumw += SCREEN_WIDTH / ICON_SCALE_FACTOR + 10;
if (accumw >= SCREEN_WIDTH) {
vbox->add(hbox, SCREEN_HEIGHT/ICON_SCALE_FACTOR+30, 4);
vbox->add( new Spacer(), 10, 0 );
hbox = new HBox();
hbox->add( new Spacer(), 0, 1 );
accumw = SCREEN_WIDTH / ICON_SCALE_FACTOR;
}
m_thumbs[i] = new IconButton("--","",Event(Event::PLAY, //SELECT,
m_levels->collectionLevel(c,i)));
m_thumbs[i]->font(Font::blurbFont());
m_thumbs[i]->setBg(SELECTED_BG);
m_thumbs[i]->border(false);
hbox->add( m_thumbs[i], SCREEN_WIDTH / ICON_SCALE_FACTOR, 0 );
hbox->add( new Spacer(), 0, 1 );
}
vbox->add(hbox, SCREEN_HEIGHT/ICON_SCALE_FACTOR+30, 4);
vbox->add( new Spacer(), 110, 10 );
m_scroll->add(vbox,0,0);
for (int i=0; i<THUMB_COUNT && i+m_dispbase<m_dispcount; i++) {
Canvas temp( SCREEN_WIDTH, SCREEN_HEIGHT );
Scene scene( true );
unsigned char buf[64*1024];
int level = m_levels->collectionLevel(c,i);
int size = m_levels->load( level, buf, sizeof(buf) );
if ( size && scene.load( buf, size ) ) {
scene.draw( temp, FULLSCREEN_RECT );
m_thumbs[i]->text( m_levels->levelName(level) );
m_thumbs[i]->canvas( temp.scale( ICON_SCALE_FACTOR ) );
m_thumbs[i]->transparent(m_dispbase+i!=levelInC);
}
}
}