本文整理汇总了C++中Drawing::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ Drawing::draw方法的具体用法?C++ Drawing::draw怎么用?C++ Drawing::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Drawing
的用法示例。
在下文中一共展示了Drawing::draw方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_lake
void test_lake() {
sf::RenderWindow window(sf::VideoMode(200, 200), "Map Test");
Random r;
window.clear(sf::Color(128, 128, 128));
Drawing * lake = Drawing::new_lake(r, 100);
lake->draw(window, 100, 100);
window_loop(window);
}
示例2: test_drawing
void test_drawing() {
sf::RenderWindow window(sf::VideoMode(200, 200), "Wave Test");
Random r;
Drawing *mnt = Drawing::new_mountain(r, 100);
Drawing *tree = Drawing::new_tree(r, 80);
Drawing *wave = Drawing::new_wave(r, 80);
window.clear(sf::Color(128, 128, 128));
mnt->draw(window, 100, 180);
tree->draw(window, 110, 100);
wave->draw(window, 100, 40);
sf::CircleShape cs(2, 4);
cs.setPosition(100, 40);
window.draw(cs);
window.display();
window_loop(window);
}
示例3: test_shield
void test_shield() {
sf::RenderWindow window(sf::VideoMode(200, 200), "Wave Test");
Random r;
window.clear(sf::Color(128, 128, 128));
Drawing *shield = Drawing::new_shield(r, 100);
shield->draw(window, 100, 100);
window.display();
window_loop(window);
}
示例4: refreshScreenshotToShow
// Refresh the pixmap of the displayed screenshot by redraw everything
void EditWindow::refreshScreenshotToShow()
{
// Take the screenshot without any drawings
QPixmap screenshotPixmap = screenshot->getImage();
painterScreenshot->drawPixmap(screenshotPixmap.rect(), screenshotPixmap);
// Draw every drawing one by one on the clean screenshot
Drawing* drawing;
foreach(drawing, newDrawingsList)
{
drawing->draw(painterScreenshot);
}
示例5: test_drawing2
void test_drawing2() {
sf::RenderWindow window(sf::VideoMode(200, 200), "Drawing Test");
Random r;
// Drawing *d = Drawing::new_mountain(r, 100);
// Drawing *d = Drawing::new_tree(r, 100);
// Drawing *d = Drawing::new_wave(r, 100);
// Drawing *d = Drawing::new_hill(r, 100);
Drawing *d = Drawing::new_person(r, 100);
window.clear(sf::Color(128, 128, 128));
d->draw(window, 100, 120);
sf::CircleShape cs(2, 4);
cs.setPosition(100, 120);
window.draw(cs);
window_loop(window);
}