本文整理汇总了C++中BitmapRef::GetTransparentColor方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapRef::GetTransparentColor方法的具体用法?C++ BitmapRef::GetTransparentColor怎么用?C++ BitmapRef::GetTransparentColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapRef
的用法示例。
在下文中一共展示了BitmapRef::GetTransparentColor方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: src
Window_ShopParty::Window_ShopParty(int ix, int iy, int iwidth, int iheight) :
Window_Base(ix, iy, iwidth, iheight) {
SetContents(Bitmap::Create(width - 16, height - 16));
contents->SetTransparentColor(windowskin->GetTransparentColor());
cycle = 0;
item_id = 0;
const std::vector<Game_Actor*>& actors = Game_Party::GetActors();
for (size_t i = 0; i < actors.size() && i < 4; i++) {
Game_Actor *actor = actors[i];
const std::string& sprite_name = actor->GetCharacterName();
int sprite_id = actor->GetCharacterIndex();
BitmapRef bm = Cache::Charset(sprite_name);
int width = bm->GetWidth() / 4 / 3;
int height = bm->GetHeight() / 2 / 4;
for (int j = 0; j < 3; j++) {
int sx = ((sprite_id % 4) * 3 + j) * width;
int sy = ((sprite_id / 4) * 4 + 2) * height;
Rect src(sx, sy, width, height);
for (int k = 0; k < 2; k++) {
BitmapRef bm2 = Bitmap::Create(width, height, true);
bm2->SetTransparentColor(bm->GetTransparentColor());
bm2->Clear();
bm2->Blit(0, 0, *bm, src, 255);
if (k == 0)
bm2->ToneBlit(0, 0, *bm2, bm2->GetRect(), Tone(0, 0, 0, 255));
bitmaps[i][j][k] = bm2;
}
}
}
Refresh();
}
示例2: OnCharsetSpriteReady
void Window_ShopParty::OnCharsetSpriteReady(FileRequestResult* result, int party_index) {
Game_Actor *actor = Main_Data::game_party->GetActors()[party_index];
const std::string& sprite_name = actor->GetSpriteName();
int sprite_id = actor->GetSpriteIndex();
BitmapRef bm = Cache::Charset(sprite_name);
int width = bm->GetWidth() / 4 / 3;
int height = bm->GetHeight() / 2 / 4;
for (int j = 0; j < 3; j++) {
int sx = ((sprite_id % 4) * 3 + j) * width;
int sy = ((sprite_id / 4) * 4 + 2) * height;
Rect src(sx, sy, width, height);
for (int k = 0; k < 2; k++) {
BitmapRef bm2 = Bitmap::Create(width, height, true);
bm2->SetTransparentColor(bm->GetTransparentColor());
bm2->Clear();
bm2->Blit(0, 0, *bm, src, 255);
if (k == 0)
bm2->ToneBlit(0, 0, *bm2, bm2->GetRect(), Tone(128, 128, 128, 0), Opacity::opaque);
bitmaps[party_index][j][k] = bm2;
}
}
}