Getting started with a Tile-based game in Qt using QGraphicsScene and QGraphicsView

前端 未结 4 979
礼貌的吻别
礼貌的吻别 2021-02-15 15:03

I\'m going to start programming a 2D tile-based game in Qt and read about the QGraphicsScene and QGraphicsView classes which are intended for displaying and handling lots of 2D

4条回答
  •  滥情空心
    2021-02-15 15:32

    I'm working on a similar project and I'm using a 30x30 grid of persistent QGraphicsPixmapItems. When the view of the map changes, the QGraphicsscene iterates over the part of the map array that's currently in view, calling setPixmap on each tile to change it over to the new tile type. It's been working pretty smoothly and I don't have any performance complaints thus far.

提交回复
热议问题