本文整理汇总了C++中VisualServer::canvas_item_add_set_transform方法的典型用法代码示例。如果您正苦于以下问题:C++ VisualServer::canvas_item_add_set_transform方法的具体用法?C++ VisualServer::canvas_item_add_set_transform怎么用?C++ VisualServer::canvas_item_add_set_transform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VisualServer
的用法示例。
在下文中一共展示了VisualServer::canvas_item_add_set_transform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _update_dirty_quadrants
//.........这里部分代码省略.........
if (c.flip_h)
rect.pos.x-=s.x-center.x;
else
rect.pos.x-=center.x;
if (c.flip_v)
rect.pos.y-=s.y-center.y;
else
rect.pos.y-=center.y;
}
if (r==Rect2()) {
tex->draw_rect(canvas_item,rect,false,Color(1,1,1),c.transpose);
} else {
tex->draw_rect_region(canvas_item,rect,r,Color(1,1,1),c.transpose);
}
Vector< Ref<Shape2D> > shapes = tile_set->tile_get_shapes(c.id);
for(int i=0;i<shapes.size();i++) {
Ref<Shape2D> shape = shapes[i];
if (shape.is_valid()) {
Vector2 shape_ofs = tile_set->tile_get_shape_offset(c.id);
Matrix32 xform;
xform.set_origin(offset.floor());
_fix_cell_transform(xform,c,shape_ofs+center_ofs,s);
if (debug_canvas_item) {
vs->canvas_item_add_set_transform(debug_canvas_item,xform);
shape->draw(debug_canvas_item,debug_collision_color);
}
ps->body_add_shape(q.body,shape->get_rid(),xform);
ps->body_set_shape_metadata(q.body,shape_idx++,Vector2(E->key().x,E->key().y));
}
}
if (debug_canvas_item) {
vs->canvas_item_add_set_transform(debug_canvas_item,Matrix32());
}
if (navigation) {
Ref<NavigationPolygon> navpoly = tile_set->tile_get_navigation_polygon(c.id);
if (navpoly.is_valid()) {
Vector2 npoly_ofs = tile_set->tile_get_navigation_polygon_offset(c.id);
Matrix32 xform;
xform.set_origin(offset.floor()+q.pos);
_fix_cell_transform(xform,c,npoly_ofs+center_ofs,s);
int pid = navigation->navpoly_create(navpoly,nav_rel * xform);
Quadrant::NavPoly np;
np.id=pid;
np.xform=xform;
q.navpoly_ids[E->key()]=np;
}
}