设计一个棋盘 [英] Design a chess board

查看:115
本文介绍了设计一个棋盘的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿伙计......我初学者..我决定设计一个国际象棋棋盘,我需要设计一个国际象棋棋盘。我用c ++写了一个国际象棋,但我不知道如何设计一个图形板可以运行我的c ++国际象棋源代码..实际上我需要源代码来设计一个棋盘可以用我的国际象棋来源运行。

这是我的gmail:[删除] @gmail.com

i happy知道你对我的问题家伙的想法。

谢谢你做了很多



电子邮件删除 - OriginalGriff [/ edit]



我尝试过:



设计一个棋盘可以运行我的国际象棋c ++游戏

解决方案

对于2D国际象棋游戏,您可以使用图形视图框架| Qt Widgets 5.6 [ ^ ]。



然后可以在 QGraphicsScene类| Qt Widgets 5.6 [ ^ ]。设计电路板应该没问题。只需画出填充了交替颜色的64个矩形。



可以使用 QGraphicsItem类| Qt Widgets 5.6 [ ^ ]时由代码绘制。如果已将这些部分创建为位图图像,请使用 QGraphicsPixmapItem类| Qt Widgets 5.6 [ ^ ]。



后一个选项应该更简单。您可以在网上搜索现有的国际象棋文章(但如果您想发布您的程序,请注意图像版权)。


hey guy...Im beginner..i decide to design a chess game and i need to design a chess board.i wrote a chess in c++ but i don t know how to design a graphical board can running my c++ chess source code ..actually i need source code to design a chess board can run with my chess source.
this is my gmail:[DELETED]@gmail.com
i happy known your idea about my problem guy.
thank you do much

[edit]Email removed - OriginalGriff[/edit]

What I have tried:

design a chess board can running my chess c++ game

解决方案

For a 2D chess game you may use the Graphics View Framework | Qt Widgets 5.6[^].

The chess board can be then drawn on the background layer of the QGraphicsScene Class | Qt Widgets 5.6[^]. Designing the board should be no problem. Just draw the 64 rectangles filled with alternating colours.

The pieces can be implemented using the QGraphicsItem Class | Qt Widgets 5.6[^] when drawn by code. If the pieces has been created as bitmap images, use the QGraphicsPixmapItem Class | Qt Widgets 5.6[^].

The latter option should be the simpler one. You might search the web for existing chess pieces (but be aware of image copyrights if you want to publish your program).


这篇关于设计一个棋盘的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆