Skip to Content
Game Programming Using Qt Beginner's Guide
book

Game Programming Using Qt Beginner's Guide

by Witold Wysota, Lorenz Haas
January 2016
Beginner
512 pages
12h 35m
English
Packt Publishing
Content preview from Game Programming Using Qt Beginner's Guide

Time for action – creating an item for drawing outlined text

The goal of the current exercise is to be able to make the following QML code work:

import QtQuick 2.3
import OutlineTextItem 1.0

Rectangle {
  width: 800; height: 400
  OutlineTextItem {
    anchors.centerIn: parent
    text: "This is outlined text"
    fontFamily: "Arial"
    fontPixelSize: 64
    color: "#33ff0000"
    antialiasing: true
    border {
      color: "blue"
      width: 2
      style: Qt.DotLine
    }
  }
}

And produce the following result:

Time for action – creating an item for drawing outlined text

Start with an empty Qt project with the core, gui, and quick modules activated. Create a new class and call it OutlineTextItemBorder. Delete the implementation file as we are going to put all ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Game Programming using Qt 5 Beginner's Guide - Second Edition

Game Programming using Qt 5 Beginner's Guide - Second Edition

Pavel Strakhov, Witold Wysota, Lorenz Haas
Programming with Qt, 2nd Edition

Programming with Qt, 2nd Edition

Matthias Kalle Dalheimer

Publisher Resources

ISBN: 9781782168874Supplemental Content