本文整理汇总了C++中ARGB函数的典型用法代码示例。如果您正苦于以下问题:C++ ARGB函数的具体用法?C++ ARGB怎么用?C++ ARGB使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ARGB函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void ClosingCinematicScreen::draw(float dt)
{
if (currentScene == Scenes::GROTESQUE_CLOSEUP)
{
currentSprite->Render(0.0, 0.0);
if (timeInScene > 1.5)
{
tongueAngle -= 1.3 * dt;
tongueOffset -= 550.0 * dt;
//tongueAngle -= 1.7 * dt;
//tongueOffset -= 900.0 * dt;
smh->resources->GetSprite("hugeTongue")->RenderEx(-100, tongueOffset, tongueAngle, 1.0, 1.0);
}
}
smh->drawScreenColor(Colors::BLACK, fadeInAlpha);
if (currentScene > 0)
{
currentSprite->SetColor(ARGB(fadeOutAlpha, 255, 255, 255));
currentSprite->Render(512.0 - 220.0, 284.0 - 170.0 + pictureOffset);
smh->resources->GetFont("inventoryFnt")->SetColor(ARGB(textAlpha, 255.0, 255.0, 255.0));
smh->resources->GetFont("inventoryFnt")->printf(512.0, 600.0, HGETEXT_CENTER, text.c_str());
smh->resources->GetFont("inventoryFnt")->SetColor(ARGB(255.0, 255.0, 255.0, 255.0));
}
}
示例2: getDetailedInformation
void SimplePopup::Render()
{
mClosed = false;
float modX = (SCREEN_WIDTH_F / 2)-5;
JRenderer *r = JRenderer::GetInstance();
string detailedInformation = getDetailedInformation(mDeckInformation->getFilename());
#if !defined (PSP)
JQuadPtr statsholder = WResourceManager::Instance()->RetrieveTempQuad("statsholder.png");//new graphics statsholder
//const float textHeight = mTextFont->GetHeight() * mMaxLines;
//r->FillRect(0,0,SCREEN_WIDTH_F,SCREEN_HEIGHT_F,ARGB(220,15,15,15));
if(statsholder.get())
r->RenderQuad(statsholder.get(),0,0,0,SCREEN_WIDTH_F/statsholder->mWidth,SCREEN_HEIGHT_F/statsholder->mHeight);
#endif
r->FillRoundRect(mX+modX+3, mY + 7, 190.f, 148.f, 0, ARGB( 240, 15, 15, 15 ) );
// currently causes a crash on the PSP when drawing the corners.
// TODO: clean up the image ot make it loook cleaner. Find solution to load gfx to not crash PSP
#if 0
r->DrawRoundRect(mX, mY + 2, mWidth + 11, textHeight - 12, 2.0f, ARGB( 255, 125, 255, 0) );
drawBoundingBox( mX-3, mY, mWidth + 3, textHeight );
#endif
mTextFont->DrawString(detailedInformation.c_str(), modX+mX + 9 , mY + 15);
}
示例3: GUIAppObject
GUIAppListBox::GUIAppListBox ( int _id, float x, float y, float w, float h,
const char *btn11, const char *btn12, const char *btn13,
const char *btn21, const char *btn22, const char *btn23) : GUIAppObject () {
bStatic=false;
bVisible=true;
bEnabled=true;
id = _id;
rect.Set(x,y,x+w,y+h);
bgColor = ARGB(0xaf,0xA0,0xA0,0xA0);
frameColor = ARGB(0xff,0xFF,0xFF,0xFF);
selColor = ARGB(0xaf,0xF0,0xF0,0xF0);
sepHeight = 1;
oldVValue = 0;
oldHValue = 0;
selectIndex = 0;
// scrollers
vscroll = new GUIAppScrollBar(VSCROLL,GUIAppScrollBar::V_SCROLL,x+w,y,h,btn11,btn12,btn13);
vscroll->SetParent(this);
hscroll = new GUIAppScrollBar(HSCROLL,GUIAppScrollBar::H_SCROLL,x,y+h,w,btn21,btn22,btn23);
hscroll->SetParent(this);
// moving
vscroll->Move(vscroll->GetWidth(),0);
hscroll->Move(0,hscroll->GetHeight());
// set size
SetupSize(w,h);
SetupSelection();
}
示例4: Location
void AStar::render()
{
_Recorder::render();
// 绘制路径
if (m_navigator->getSearchResult() == Navigator::SearchResult_Completed)
{
CellCoord prevCellCoord = g_Game.getStartCoord();
std::list<int> path;
m_navigator->getPath(path);
for (std::list<int>::iterator it = path.begin(); it != path.end(); ++it)
{
Location prevCenterLocation = util::cellCoordToLocation(prevCellCoord);
prevCenterLocation += Location(CELL_SIZE_X/2, CELL_SIZE_Y/2);
CellCoord currentCellCoord = g_Board.toNodeCoord(*it);
Location currentCenterLocation = util::cellCoordToLocation(currentCellCoord);
currentCenterLocation += Location(CELL_SIZE_X/2, CELL_SIZE_Y/2);
g_HGE->Gfx_RenderLine(prevCenterLocation.x, prevCenterLocation.y,
currentCenterLocation.x, currentCenterLocation.y,
ARGB(255, 132, 38, 64)
);
g_HGE->Gfx_RenderLine(prevCenterLocation.x, prevCenterLocation.y+1,
currentCenterLocation.x, currentCenterLocation.y+1,
ARGB(255, 132, 38, 64)
);
prevCellCoord = currentCellCoord;
}
g_Font.printf(2, 2, HGETEXT_LEFT, "path total cost: %d", m_navigator->getPathCost());
}
}
示例5: switch
void DamagerDamaged::Render(CombatStep mode)
{
TransientCardView::Render();
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetBase(0);
switch (mode)
{
case BLOCKERS:
case TRIGGERS:
case ORDER:
mFont->SetColor(ARGB(92,255,255,255));
break;
case FIRST_STRIKE:
case END_FIRST_STRIKE:
case DAMAGE:
case END_DAMAGE:
mFont->SetColor(ARGB(255, 255, 64, 0));
break;
}
char buf[6];
sprintf(buf, "%i", sumDamages());
mFont->DrawString(buf, actX - 14 * actZ + 5, actY - 14 * actZ);
}
示例6: ARGB
bool Garden::Garden_Render_GOODS(int j, int i)
{
//显示光环
for(int k = 0; k < 30; ++k)
{
if(goods[k].first == 0 && goods[k].vis == true && goods[k].eat == false && goods[k].x == i && goods[k].y == j)
{
int id = 11;
bgQuads[id]->v[0].x = mx[j][i] - 25.0f, bgQuads[id]->v[0].y = my[j][i] - 10.0f;
bgQuads[id]->v[1].x = mx[j][i] + 25.0f, bgQuads[id]->v[1].y = my[j][i] - 10.0f;
bgQuads[id]->v[2].x = mx[j][i] + 25.0f, bgQuads[id]->v[2].y = my[j][i] + 40.0f;
bgQuads[id]->v[3].x = mx[j][i] - 25.0f, bgQuads[id]->v[3].y = my[j][i] + 40.0f;
hge->Gfx_RenderQuad(bgQuads[id]);
}
}
//显示物品
for(int k = 0; k < 30; ++k)
{
int id = goods[k].id + 8;
float xx = mx[j][i];
float yy = my[j][i];
if(goods[k].skill)
{
xx = goods[k].xx;
yy = goods[k].yy;
}
bgQuads[id]->v[0].x = xx - 15.0f, bgQuads[id]->v[0].y = yy;
bgQuads[id]->v[1].x = xx + 15.0f, bgQuads[id]->v[1].y = yy;
bgQuads[id]->v[2].x = xx + 15.0f, bgQuads[id]->v[2].y = yy + 30.0f;
bgQuads[id]->v[3].x = xx - 15.0f, bgQuads[id]->v[3].y = yy + 30.0f;
for(int p = 0; p < 4; ++p)
bgQuads[id]->v[p].col = ARGB(0x5f, 0xff, 0xff, 0xff);
if(goods[k].free == true && goods[k].eat == false && goods[k].x == i && goods[k].y == j)
{
for(int p = 0; p < 4; ++p)
bgQuads[id]->v[p].col = ARGB(0xff, 0xff, 0xff, 0xff);
hge->Gfx_RenderQuad(bgQuads[id]);
}
if(goods[k].first == 0 && goods[k].vis == true && goods[k].eat == false && goods[k].x == i && goods[k].y == j)
{
hge->Gfx_RenderQuad(bgQuads[id]);
}
if(goods[k].first == 1 && goods[k].eat == false && goods[k].x == i && goods[k].y == j)
{
//方案一,移动
id = goods[k].id + 8;
hge->Gfx_RenderQuad(bgQuads[id]);
//方案二,光束
id = 12;
hge->Gfx_RenderQuad(bgQuads[id]);
}
}
return false;
}
示例7: drawSillyPads
/**
* Draws all silly pads that have been created.
*/
void SpecialTileManager::drawSillyPads(float dt) {
std::list<SillyPad>::iterator i;
for(i = sillyPadList.begin(); i != sillyPadList.end(); i++) {
//Fade out during the last 2 seconds
float timeLeft = (float)SILLY_PAD_TIME - smh->timePassedSince(i->timePlaced);
if (timeLeft < 1.0f) {
smh->resources->GetSprite("sillyPad")->SetColor(ARGB((timeLeft/1.0f)*255.0f,255,255,255));
}
smh->resources->GetSprite("sillyPad")->Render(smh->getScreenX(i->gridX*64.0), smh->getScreenY(i->gridY*64.0));
smh->resources->GetSprite("sillyPad")->SetColor(ARGB(255,255,255,255));
}
}
示例8: ARGB
void CCockpit::DrawArrow( Sint32 bx , Sint32 by )
{
//------------------------------------
//アロー表示
//------------------------------------
Sint32 z = PRIO_GAMETOP;
Float32 fScl=1.f;
Sint32 sCol = 0xA0*m_sArrowWait/100;
Sint32 sRot = viiSub::GameCounter()%360;//m_sArrowWait;
Sint32 x,y;
fScl = 1.f+m_sArrowWait/100.f;
x = bx;
y = by;
if( m_sArrowRot == 1000 )
{
//ビックリマーク
// viiSub::MenuSprite( x,y,z, enTexPageSystemUI,16,80 ,16,32,8,16 ,ATR_DFLT, ARGB((0xA0-sCol),0xFF,0xFF,0xFF) , 0 );
// viiSub::MenuSprite( x,y,z, enTexPageGrowObj,0,208 ,192,48,96,24 ,ATR_DFLT, ARGB((sCol),0xFF,0xFF,0xFF) , 0 , 2.f , 1.f);
viiSub::MenuSprite( x,y,z, enTexPageGrowObj,0,208 ,192,48,96,24 ,ATR_DFLT, ARGB((sCol),0xFF,0xFF,0xFF) , 0 , 0.5f , 0.5f);
return;
}
else if( m_sArrowRot == 2000 )
{
viiSub::MenuSprite( WINDOW_W-64,WINDOW_H/2,z, enTexPageGrowObj,0,208 ,192,48,96,24 ,ATR_DFLT, ARGB((sCol),0xFF,0xFF,0xFF) , 0 , 0.5f , 0.5f);
return;
}
else if( m_sArrowRot == 3000 )
{
viiSub::MenuSprite( WINDOW_W/2,WINDOW_H-32,z, enTexPageGrowObj,0,208 ,192,48,96,24 ,ATR_DFLT, ARGB((sCol),0xFF,0xFF,0xFF) , 0 , 0.5f , 0.5f);
return;
}
else if( m_sArrowRot == 4000 )
{
viiSub::MenuSprite( 64,WINDOW_H/2,z, enTexPageGrowObj,0,208 ,192,48,96,24 ,ATR_DFLT, ARGB((sCol),0xFF,0xFF,0xFF) , 0 , 0.5f , 0.5f);
return;
}
else
{
//アロー
Sint32 ax = (viiMath::Cos100(m_sArrowRot)*(100-m_sArrowWait))/1000;
Sint32 ay = (viiMath::Sin100(m_sArrowRot)*(100-m_sArrowWait))/1000;
viiSub::MenuSprite( x+ax,y+ay,z, enTexPageSystemUI,32,80 ,16,32,8,16 ,ATR_DFLT, ARGB((sCol),251,245,198) , m_sArrowRot*1.f );
}
viiSub::MenuSprite( x,y,z, enTexPageSystemUI,48,80 ,32,32,16,16 ,ATR_DFLT, ARGB(sCol,32,243,198) , sRot*1.f ,fScl,fScl);
// viiSub::MenuSprite( x,y,z, enTexPageSystemUI,48,80 ,32,32,16,16 ,ATR_DFLT, ARGB(sCol,0xFF,0xFF,0xFF) ,-sRot*1.f ,fScl);
}
示例9: ARGB
void GuiGameZone::Render()
{
//Texture
JQuadPtr quad = WResourceManager::Instance()->GetQuad(kGenericCardThumbnailID);
float scale = defaultHeight / quad->mHeight;
quad->SetColor(ARGB((int)(actA),255,255,255));
if(type == GUI_EXILE)
{
quad->SetColor(ARGB((int)(actA),255,240,255));
}
JRenderer::GetInstance()->RenderQuad(quad.get(), actX, actY, 0.0, scale * actZ, scale * actZ);
float x0 = actX;
if (x0 < SCREEN_WIDTH / 2)
{
x0 += 7;
}
if (mHasFocus)
JRenderer::GetInstance()->FillRect(actX, actY, quad->mWidth * scale * actZ, quad->mHeight * scale * actZ,
ARGB(abs(128 - wave),255,255,255));
//Number of cards
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
char buffer[11];
int mAlpha = (int) (actA);
/*if(type == GUI_GRAVEYARD)
sprintf(buffer, "%i\ng", zone->nb_cards);
else if(type == GUI_LIBRARY)
sprintf(buffer, "%i\nl", zone->nb_cards);
else if(type == GUI_OPPONENTHAND)
sprintf(buffer, "%i\nh", zone->nb_cards);
else if(type == GUI_EXILE)
sprintf(buffer, "%i\ne", zone->nb_cards);
else*/
sprintf(buffer, "%i", zone->nb_cards);
mFont->SetColor(ARGB(mAlpha,0,0,0));
mFont->DrawString(buffer, x0 + 1, actY + 1);
if (actA > 120)
mAlpha = 255;
mFont->SetColor(ARGB(mAlpha,255,255,255));
mFont->DrawString(buffer, x0, actY);
if (showCards)
cd->Render();
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
(*it)->Render();
PlayGuiObject::Render();
}
示例10: DrawWorkMeter
void DrawWorkMeter( AGDrawBuffer* DBuf ) {
u32 Start = 32;
u32 DrawWidth = g_FBWidth - 32*2;
u32 Height = g_FBHeight;
u32 Width;
int i;
int j;
int dw;
if( aglGetMainDisplay() == 0 ) { // 表示A
Width = AG4REG.DSPAVPRM0.VSC * g_VWidth;
dw = AG4REG.DSPAVPRM0.VSC*DrawWidth;
}
else {
Width = AG4REG.DSPBVPRM0.VSC * g_VWidth;
dw = AG4REG.DSPBVPRM0.VSC*DrawWidth;
};
AG_DRAW_SETATEST( *DBuf , 0 , 7 , 0 );
AG_DRAW_SETDTEST( *DBuf , 7 , 0 );
for( i=0 ; i<WorkMeterCount ; i++ ) {
u32 Pos = WorkMeterPos[i] * DrawWidth / Width + 32;
AG_DRAW_SETFCOLOR_ARGB( *DBuf , WorkMeterColor[i] );
AG_DRAW_RECTANGLE( *DBuf , Start<<2 , (Height-32)<<2 , Pos<<2 , (Height-32+5)<<2 );
Start = Pos;
};
for( i=0 ; i<=g_VWidth ; i++ ) {
AG_DRAW_SETFCOLOR_ARGB( *DBuf , ARGB( 255 , 255 , 255 , 255 ) );
AG_DRAW_RECTANGLE( *DBuf , (i*dw/Width+32)<<2 , (Height-32-2)<<2 , (i*dw/Width+32+1)<<2 , (Height-32+5+2)<<2 );
if( i < g_VWidth ) {
AG_DRAW_SETFCOLOR_ARGB( *DBuf , ARGB( 255 , 128 , 128 , 128 ) );
for( j=1 ; j<10 ; j++ ) {
int dh = 0;
if( j == 5 ) {
dh = 1;
};
AG_DRAW_RECTANGLE( *DBuf , ((i*dw + (dw*j/10))/Width+32)<<2 , (Height-32-dh)<<2 ,
((i*dw + (dw*j/10))/Width+32+1)<<2 , (Height-32+5+dh)<<2 );
};
};
};
}
示例11: main
int main(void) {
BImage img1 = { 966, 1165, (BColor*)malloc(966 * 1165 * sizeof(BColor)) };
BImage img2 = { 966, 1165, (BColor*)malloc(966 * 1165 * sizeof(BColor)) };
for (int i = 0; i < 966 * 1165; i++) {
img1.data[i] = ARGB((byte)255, (byte)255, (byte)255, (byte)0);
img2.data[i] = ARGB((byte)255, (byte)255, (byte)255, (byte)0);
}
auto diffResult = diff_img_byte(img1, img2, DiffOptions{ ARGB((byte)255, (byte)0, (byte)0, (byte)255), 0.2f, 1.0f, OverlayType::Flat, 0, 0 });
free_img_mem(diffResult.img.data);
}
示例12: ARGB
void OptionKey::Overlay()
{
JRenderer * renderer = JRenderer::GetInstance();
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::OPTION_FONT);
mFont->SetColor(ARGB(255, 0, 0, 0));
if (grabbed)
{
static const float x = 30, y = 45;
renderer->FillRoundRect(x, y, SCREEN_WIDTH - 2 * x, 50, 2, ARGB(200, 200, 200, 255));
string msg = _("Press a key to associate.");
mFont->DrawString(msg, (SCREEN_WIDTH - mFont->GetStringWidth(msg.c_str())) / 2, y + 20);
}
else if (btnMenu)
btnMenu->Render();
}
示例13: sprintf
void Damage::Render()
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
mFont->SetBase(0);
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
char buffer[200];
sprintf(buffer, _("Deals %i damage to").c_str(), damage);
//mFont->DrawString(buffer, x + 20, y, JGETEXT_LEFT);
mFont->DrawString(buffer, x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT);
JRenderer * renderer = JRenderer::GetInstance();
JQuadPtr quad = WResourceManager::Instance()->RetrieveCard(source, CACHE_THUMB);
if (quad.get())
{
//float scale = 30 / quad->mHeight;
//renderer->RenderQuad(quad.get(), x, y, 0, scale, scale);
quad->SetColor(ARGB(255,255,255,255));
float scale = mHeight / quad->mHeight;
renderer->RenderQuad(quad.get(), x + (quad->mWidth * scale / 2), y + (quad->mHeight * scale / 2), 0, scale, scale);
}
else
{
//mFont->DrawString(_(source->getName()).c_str(), x, y - 15);
mFont->DrawString(_(source->getName()).c_str(), x, y + GetVerticalTextOffset() - 15);
}
quad = target->getIcon();
if (quad.get())
{
//float scale = 30 / quad->mHeight;
//renderer->RenderQuad(quad.get(), x + 150, y, 0, scale, scale);
float backupX = quad->mHotSpotX;
float backupY = quad->mHotSpotY;
quad->SetColor(ARGB(255,255,255,255));
quad->SetHotSpot(quad->mWidth / 2, quad->mHeight / 2);
float scale = mHeight / quad->mHeight;
renderer->RenderQuad(quad.get(), x + 130, y - 0.5f + ((mHeight - quad->mHeight) / 2) + quad->mHotSpotY, 0, scale, scale);
quad->SetHotSpot(backupX, backupY);
}
else
{
//if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
//mFont->DrawString(_(((MTGCardInstance *) target)->getName()).c_str(), x + 120, y);
if (target->type_as_damageable == Damageable::DAMAGEABLE_MTGCARDINSTANCE)
mFont->DrawString(_(((MTGCardInstance *) target)->getName()).c_str(), x + 35, y+15 + GetVerticalTextOffset());
else if(target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
mFont->DrawString(_(((Player *) target)->getDisplayName()).c_str(), x + 35, y+15 + GetVerticalTextOffset());
}
}
示例14: clearSurface
void Button_t::paint()
{
cr = graphics.getContext();
clearSurface();
bounds = getBounds();
if (enabled)
{
if (shapeColor == ARGB(120, 211, 211, 211)) shapeColor = previous;
if (state.focused) border = RGB(0, 200, 0);
else border = RGB(180, 180, 180);
}
else
{
previous = shapeColor;
shapeColor = ARGB(120, 211, 211, 211);
}
// prepare
double x = 0.5;
double y = 0.5;
double width = bounds.width - 1;
double height = bounds.height - 1;
double radius = 2.5;
double degrees = M_PI / 180.0;
cairo_new_sub_path(cr);
cairo_arc(cr, x + width - radius, y + radius, radius, -90 * degrees, 0 * degrees);
cairo_arc(cr, x + width - radius, y + height - radius, radius, 0 * degrees, 90 * degrees);
cairo_arc(cr, x + radius, y + height - radius, radius, 90 * degrees, 180 * degrees);
cairo_arc(cr, x + radius, y + radius, radius, 180 * degrees, 270 * degrees);
cairo_close_path(cr);
cairo_set_source_rgba(cr, ARGB_TO_CAIRO_PARAMS(shapeColor));
cairo_fill_preserve(cr);
cairo_set_source_rgba(cr, ARGB_TO_CAIRO_PARAMS(border));
cairo_set_line_width(cr, 1);
cairo_stroke(cr);
if (pathToLoad)
{
pngSurface = graphics.getContext();
cairo_set_source_surface(pngSurface, png, pngPosition.x, pngPosition.y);
cairo_paint(pngSurface);
}
}
示例15: drawSet
void drawSet(AGDrawBuffer* DBuf, struct Field* field, struct Player* player)
{
int i;
//Init
agDrawBufferInit( DBuf , DrawBuffer );
agDrawSETDAVR( DBuf , 0 , 0 , aglGetDrawFrame() , 0 , 0 );
agDrawSETDAVF( DBuf, 0, 0, s(FB_WIDTH), s(FB_HEIGHT) );
//白背景
agDrawSETFCOLOR( DBuf, ARGB( 255, 255, 255, 255 ) );
agDrawSETDBMODE( DBuf, 0xff, 0, 0, 1 );
agDrawSPRITE( DBuf, 0, 0, 0, s(FB_WIDTH), s(FB_HEIGHT) );
//フィールド
drawField( DBuf, field);
//戦艦
for(i=0;i<5;i++){
drawBattleShip(DBuf, &(player->battleShip[i]));
}
/*
//数字を描画する場所の白い四角
agDrawSETFCOLOR( DBuf, ARGB( 255, 255, 255, 255 ) );
agDrawSETDBMODE( DBuf, 0xff, 0, 0, 1 );
agDrawSPRITE( DBuf, 0, 100-20, 100-20, 100+50*10+20, 100+90+20);
//数字の描画
drawNumberGraph(20131120, 100,100,50,90,10,DBuf);
*/
}