本文整理汇总了C++中View::Apply方法的典型用法代码示例。如果您正苦于以下问题:C++ View::Apply方法的具体用法?C++ View::Apply怎么用?C++ View::Apply使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类View
的用法示例。
在下文中一共展示了View::Apply方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Nebula
Meteorites::Meteorites() : Client(), Message(){
ViewBunch = new DynamicArray();
BitmapBunch = new DynamicArray();
SetName("MeteoritesGame");
printf("------------------------------------------------------------------------\n");
printf("Initializing TV-Meteorites, Copyright (C) RealityMakers Entertainment as\n");
printf("------------------------------------------------------------------------\n");
View1 = new View(Rect(0,0,1,1));
View1->SetClearState(false);
/*
Scores = new ScoreViews(View1);
*/
// 191,189
// 101
// 85
#ifdef TV2
tv2bm = new Bitmap("Textures/tv2/tv2",BITMAP_RGB);
tv2v = new View(Rect(
1-.075f*.8f-.01f,
.01f,
1-.01f,
.1f*.8f+.01f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
#ifdef SCHIBSTED
tv2bm = new Bitmap("Textures/tv2/slogo",BITMAP_RGB);
tv2v = new View(Rect(
1-.09f*.8f*1.5f-.01f,
.01f,
1-.01f,
.1f*.8f+.01f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
#ifdef JANCO
Bitmap *tv2bm = new Bitmap("Textures/tv2/janco",BITMAP_RGB);
View *tv2v = new View(Rect(
.9f,
0,
1,
.1f));
tv2bm->SetTranslusency(.5f);
tv2v->Apply(tv2bm);
tv2v->SetClearState(false);
View1->Apply(tv2v);
#endif
Info1 = new Bitmap("Textures/Interface/Instructions/Inntasting",BITMAP_RGB);
Info2 = new Bitmap("Textures/Interface/Instructions/Kontroll",BITMAP_RGB);
Info3 = new Bitmap("Textures/Interface/Instructions/Pickups",BITMAP_RGB);
//printf("%d,%d\n",Info1->GetWidth(),Info1->GetHeight());
//printf("%d,%d\n",Info2->GetWidth(),Info2->GetHeight());
//printf("%d,%d\n",Info3->GetWidth(),Info3->GetHeight());
View *InfoView = new View(Rect(.75f,.7f,.95f,.9f));
InfoView->SetClearState(false);
View *v1 = new View(Rect(0,0,1,1.3f));
View *v2 = new View(Rect(0,0,1,101.0f/189.0f*1.3f));
View *v3 = new View(Rect(0,0,1,85.0f/189.0f*1.3f));
InfoViews = new DynamicArray();
InfoViews->Add(InfoView);
InfoViews->Add(v1);
InfoViews->Add(v2);
InfoViews->Add(v3);
v1->Apply(Info1);
v2->Apply(Info2);
v3->Apply(Info3);
v1->SetClearState(false);
v2->SetClearState(false);
v3->SetClearState(false);
InfoView->Apply(v1);
InfoView->Apply(v2);
InfoView->Apply(v3);
View1->Apply(InfoView);
// Info3->SetTranslusency(.8f);
#if 1
scene = new Scene(View1);
#else
Scores = new ScoreViews(View1);
null = new Geometry();
null->SetPosition(Vector(0,0,10000));
Back = new Geometry();
Back->Node::Apply(new Background(Back));
Back->SetPosition(Vector(0,0,8000*3));
Back->Post();
null->Node::Apply(Back);
//.........这里部分代码省略.........
示例2: Planet
Meteorites::Meteorites() : Client(), Message(){
SetName("MeteoritesGame");
printf("------------------------------------------------------------------------\n");
printf("Initializing TV-Meteorites, Copyright (C) RealityMakers Entertainment as\n");
printf("------------------------------------------------------------------------\n");
// char *str = new char[strlen(GetCurrentProcess()->GetName())+];
// SetName();
extern Host *host;
// AttatchHook = host->CreateHook("Attatch");
// DetatchHook = host->CreateHook("Detatch");
// ShutDownHook = host->CreateHook("ShutDown");
View1 = new View(Rect(0,0,1,1));
View1->SetClearState(false);
/*
ScoreView = new View(Rect(.8f,0,1,.5f));
ScoreView->SetClearState(false);
ScoreView->ConsoleStream::Clear();
ScoreView->Print(" 1: 1261\n 2: 8726\n");
ScoreView->Print(" 3: 8145\n 4: 6923\n");
ScoreView->Print(" 5: 1261\n 6: 8726\n");
ScoreView->Print(" 7: 8145\n 8: 6923\n");
ScoreView->Print(" 9: 1261\n10: 8726\n");
ScoreView->Print("11: 8145\n12: 6923\n");
ScoreView->Print("13: 1261\n14: 8726\n");
ScoreView->Print("15: 8145\n16: 6923\n");
font = new Font("Fonts/Swiss");
ScoreView->ConsoleStream::Apply(font);
View1->Apply(ScoreView);
*/
// View2 = new View(Rect(.8f,0,1,.5f));
View4 = new View(Rect(.75f,0,1,.8f));
// View2->SetClearState(false);
// View4->SetClearState(false);
// MeteoritesBitmap = new Bitmap("Textures/interface/divider"/*Textures/Title/title"*/,BITMAP_RGB); //Titletv4");
// View *LoadView = new View(Rect(.2f,.2f,1-.2f,1-.2f));
// View4->Apply(MeteoritesBitmap);
//View1->Apply(View4);
// Initialize scene
// Bitmap *DividerBitmap = new Bitmap("Textures/interface/divider"/*Textures/Title/title"*/,BITMAP_RGB); //Titletv4");
Bitmap *ShadowBM = new Bitmap("Textures/Interface/Shipshadow",BITMAP_ARGB);
View *Shadow = new View(Rect(.7f,0,1,1));
// View1->Apply(Shadow);
ScoreViews = new DynamicArray();
font = new Font("Fonts/Swiss");
for(int n=0; n<4; n++){ // 12.5 x 23.3, 54.2 x 23.3
#define xofs .01f
#define yofs .1f
#define width (.233f*.8f)
#define height (((.125f+.542f)/16.0f)*.8f)
#define spacing ((0.1666667f/100.0f)*5.0f)
// View *DividerView = new View(Rect(1-width,float(n)*height,1,float(n)*height+height-spacing));
// DividerView->Apply(DividerBitmap);
// DividerView->SetClearState(false);
// View1->Apply(DividerView);
char str[1024];
sprintf(str,"Textures/interface/playernum/no%d",n+1);
Bitmap *PlayerNBitmap = new Bitmap(str,BITMAP_RGB); //Titletv4");
View *PlayerNView = new View(Rect(1-width-height+xofs,float(n)*height+yofs,1-width-spacing+xofs,float(n)*height+height-spacing+yofs));
PlayerNView->Apply(PlayerNBitmap);
PlayerNView->SetClearState(false);
View1->Apply(PlayerNView);
float scl = 1-width-height*2.0f+xofs;
float sct = float(n)*height+yofs;
float scr = 1-width-height+xofs;
float scb = float(n)*height+height+yofs;
float xs = (scr-scl)*.2f;
float ys = (scb-sct)*.2f;
scl+=xs;
scr-=xs;
sct+=ys;
scb-=ys;
switch(n){
Bitmap *PlaceBitmap;
View *PlaceView;
case 0:
PlaceBitmap = new Bitmap("Textures/interface/first",BITMAP_RGB); //Titletv4");
PlaceView = new View(Rect(scl,sct,scr,scb));
PlaceView->Apply(PlaceBitmap);
PlaceView->SetClearState(false);
View1->Apply(PlaceView);
break;
case 1:
PlaceBitmap = new Bitmap("Textures/interface/second",BITMAP_RGB); //Titletv4");
PlaceView = new View(Rect(scl,sct,scr,scb));
PlaceView->Apply(PlaceBitmap);
PlaceView->SetClearState(false);
View1->Apply(PlaceView);
//.........这里部分代码省略.........
示例3: Semaphore
ScoreViews::ScoreViews(View *parent){// : Semaphore(){
// Acquire();
msg = new Message();
Views = new DynamicArray();
BitmapBunch = new DynamicArray();
ViewBunch = new DynamicArray();
//font = new Font("Fonts/arial15pt1");
font = new Font("Fonts/swed");//Humnst777_BT_40"); //swiss"); //arial15pt1");
font->SetSize(.035f);
players = new Players();
for(int n=0; n<MAX_PLAYERS; n++){ // 12.5 x 23.3, 54.2 x 23.3
connect_log[n] = -1;
#define xofs .02f
#define yofs .1f
#define width (.233f*.65f)
#define height (((.125f+.542f)/16.0f)*.65f)
#define spacing ((0.1666667f/100.0f)*3.0f)
char str[1024];
sprintf(str,"Textures/interface/playernum/no%d",n+1);
Bitmap *PlayerNBitmap = new Bitmap(str,Bitmap::cRGB); //Titletv4");
#ifdef _DEBUG
BitmapBunch->Add(PlayerNBitmap,__FILE__,__LINE__);
#else
BitmapBunch->Add(PlayerNBitmap);
#endif
View *PlayerNView = new View(Rect(1+1-width-height+xofs,1+float(n)*height+yofs,1+1-width-spacing+xofs,1+float(n)*height+height-spacing+yofs));
#ifdef _DEBUG
ViewBunch->Add(PlayerNView,__FILE__,__LINE__);
#else
ViewBunch->Add(PlayerNView);
#endif
PlayerNView->Apply(PlayerNBitmap);
PlayerNView->SetClearState(false);
parent->Apply(PlayerNView);
float scl = 1-width-height*2.0f+xofs;
float sct = float(n)*height+yofs-.005f;
float scr = 1-width-height+xofs;
float scb = sct+height;
// float xs = (scr-scl)*.2f;
// float ys = (scb-sct)*.2f;
// scl+=xs;
// scr-=xs;
// sct+=ys;
// scb-=ys;
/* switch(n){
Bitmap *PlaceBitmap;
View *PlaceView;
case 0:
BitmapBunch->Add(PlaceBitmap = new Bitmap("Textures/interface/first",BITMAP_RGB)); //Titletv4");
ViewBunch->Add(PlaceView = new View(Rect(scl,sct,scr,scb)));
PlaceView->Apply(PlaceBitmap);
PlaceView->SetClearState(false);
parent->Apply(PlaceView);
break;
case 1:
BitmapBunch->Add(PlaceBitmap = new Bitmap("Textures/interface/second",BITMAP_RGB)); //Titletv4");
ViewBunch->Add(PlaceView = new View(Rect(scl,sct,scr,scb)));
PlaceView->Apply(PlaceBitmap);
PlaceView->SetClearState(false);
parent->Apply(PlaceView);
break;
case 2:
BitmapBunch->Add(PlaceBitmap = new Bitmap("Textures/interface/third",BITMAP_RGB)); //Titletv4");
ViewBunch->Add(PlaceView = new View(Rect(scl,sct,scr,scb)));
PlaceView->Apply(PlaceBitmap);
PlaceView->SetClearState(false);
parent->Apply(PlaceView);
break;
}
*/
#define fontscale 0
#define yo (-.0105f)
View *v = new View(Rect(1+1-width+xofs,1+float(n)*height+fontscale+yofs+yo,1+xofs,1+float(n)*height+height-spacing-fontscale+yofs));
v->/*ConsoleStream::*/Apply(font);
v->SetClearState(false);
#ifdef _DEBUG
ViewBunch->Add(v,__FILE__,__LINE__);
#else
ViewBunch->Add(v);
#endif
v->Print(" 0");
v->SetColor(ARGB(.7f,.7f,.7f));
parent->Apply(v);
#ifdef _DEBUG
Views->Add(v,__FILE__,__LINE__);
#else
Views->Add(v);
#endif
View *nv = new View(Rect(1+1-width+xofs,1+float(n)*height+fontscale+yofs+yo,1+xofs,1+float(n)*height+height-spacing-fontscale+yofs));
nv->/*ConsoleStream::*/Apply(font);
nv->SetClearState(false);
#ifdef _DEBUG
ViewBunch->Add(nv,__FILE__,__LINE__);
//.........这里部分代码省略.........