// Synthetic scene only: this package does NOT read CS2 or any other process.
bool labels = true;
bool skeleton = true;
void actor(float x, float y, const string &in name, uint color) {
const float w = 54, h = 132;
render::line(x-w/2,y,x+w/2,y,color,1.5f);
render::line(x-w/2,y,x-w/2,y+h,color,1.5f);
render::line(x+w/2,y,x+w/2,y+h,color,1.5f);
render::line(x-w/2,y+h,x+w/2,y+h,color,1.5f);
if (labels) render::text(x-w/2,y-22,name,color);
if (skeleton) {
render::circle(x,y+17,9,color);
render::line(x,y+26,x,y+78,color,1.5f);
render::line(x-22,y+55,x,y+35,color,1.5f);
render::line(x+22,y+55,x,y+35,color,1.5f);
render::line(x,y+78,x-17,y+124,color,1.5f);
render::line(x,y+78,x+17,y+124,color,1.5f);
}
}
void on_frame() {
render::text(24,24,"Easy / synthetic visualization",0xff994dff);
render::text(24,48,"Demo coordinates only. Not connected to CS2.",0x9898a3ff);
labels=ui::checkbox("labels","Labels",labels,24,80,150,30);
skeleton=ui::checkbox("skeleton","Skeleton",skeleton,184,80,170,30);
float x=screen::width()*0.5f + (demo::x()-120)*0.12f;
float y=screen::height()*0.43f;
actor(x-130,y,"Demo A",0xff994dff);
actor(x,y+12,"Demo B",0x72c57dff);
actor(x+130,y-8,"Demo C",0x70aaddff);
}
Easy Universal / Примеры и шаблоны