Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Making a custom QML type element or just use regular elements

$
0
0
I am making a game. There are two characters in the game like ‘hero’ and ‘enemy’. I have made separate classes of them. Should I declare a new custom type for each character like import QtQuick 1.1 import hero 1.0 Hero{ power:100 energy:100 image:”/src/hero.png” } or just use a regular element like import QtQuick 1.1 Image{ source:hero.getImgSource() //method declared in hero class } So, I am in confusion to make a new element or just use the existing one and use the C++ bindings with QML. Is there any other approach to do so? Thanks in advance…

Viewing all articles
Browse latest Browse all 13965

Latest Images

Trending Articles



Latest Images