This module is a simple, lightweight and flexible way to generate QR codes in Godot

Overview

QRCodeTexture Godot Module

Screenshot

Summary

This module is a simple, lightweight and flexible way to generate QR codes in Godot. It provides a new type of texture that constitutes a QR code based on its properties.

This module uses the fantastic Nayuki QR code generator library under the hood.

Usage

With this module you will be able to select QRCodeTexture from any texture drop-drop menu (e.g. sprite nodes, material albedo texture, etc.). All QRCodeTexture properties are exposed to the editor so it's easy to use without scripting.

That said, here's an example of a script attached to a Sprite that makes itself a QRCodeTexture in GDScript:

extends Sprite

func _ready():
	var new_qr_code_texture = QRCodeTexture.new()
	new_qr_code_texture.text = "https://godotengine.org"
	self.texture = new_qr_code_texture

Properties

QRCodeTexture has several properties to control the way the QR code is generated.

  • text is a string of the information the QR code contains.
    • Default: ""
  • error_correction is an integer that controls the amount of error correction. Higher levels increase how much of the QR code can be obscured for a scan to work, but it also increases the size of the code.
    • Default: QRCodeTexture.ERROR_CORRECTION_MEDIUM
    • Possible values:
      • QRCodeTexture.ERROR_CORRECTION_LOW - Approx 7% error correction capability
      • QRCodeTexture.ERROR_CORRECTION_MEDIUM - Approx 15% error correction capability
      • QRCodeTexture.ERROR_CORRECTION_QUARTILE - Approx 25% error correction capability
      • QRCodeTexture.ERROR_CORRECTION_HIGH - Approx 30% error correction capability
  • border is an integer that controls the border size of background color around the QR code.
    • Default: 2
  • enable_colors is a bool that determines the use of colors and the format of the texture.
    • Default: false
    • If set to false the texture data format will be Image.FORMAT_L8
    • If set to true the texture data format will be Image.FORMAT_RGB8
    • A more efficient way to apply colors is to set this property to false and render the colors in a shader.
  • background_color
    • Default: Color(1.0, 1.0, 1.0)
    • Only used if enable_colors is true
  • foreground_color
    • Default: Color(0.0, 0.0, 0.0)
    • Only used if enable_colors is true

Tips for scanner compatibility

There are many different programs for scanning QR codes, and not all can deal with the same amount of variance in QR codes. Don't assume that because you can scan a code that everyone can. Keep the following in mind:

  • A dark foreground with light background works best. Some QR scanners can deal with a dark background and light foreground, but not all.
  • Try and maintain a high level of contrast between the foreground and background.
  • Keep a thick border of background color around the QR code.
  • Use a high amount of error correction, especially if your code will be partially obscured, distorted or decorated.

Installation

  1. Download the source code for Godot
  2. Place this code in the Godot modules directory under the name qrcodetexture (e.g. godot_src/modules/qrcodetexture/)
  3. Compile the engine (Instructions here)

License

MIT License

Copyright © 2022 Benjamin Armstrong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

  • THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

QR Code Generator Library License

Copyright © 2021 Project Nayuki. (MIT License)
https://www.nayuki.io/page/qr-code-generator-library

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  • The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

  • The Software is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the Software or the use or other dealings in the Software.

Issues
  • Cant compile

    Cant compile

    I am getting this error.

    i am using "scons -j 6" to compile

    modules\qrcodetexture\qr_code_texture.cpp(2): fatal error C1083: Cannot open include file: 'qrcodegen.hpp': No such file or directory scons: *** [modules\qrcodetexture\qr_code_texture.windows.tools.64.obj] Error 2 scons: building terminated because of errors. [Time elapsed: 00:01:02.785]

    opened by asciiboi 2
Owner
Ben Armstrong
Ben Armstrong
Source Codes for Injective Deformation Processing (IDP) with Incremental Potential Contact (IPC)

Source Codes for Injective Deformation Processing Reference This repository provides source code for: Yu Fang*, Minchen Li* (equal contribution), Chen

null 33 Jun 22, 2022
ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources

null 2.3k Jun 30, 2022
Plugin implementing Kirchhoff rods to simulate any 1D flexible structure

BeamAdapter plugin This SOFA plugin implements a 1-dimensional Finite Element Method (FEM) in the context of coil embolization in neurology. The metho

SOFA Framework 6 Jan 30, 2022
Utility on top of the Flutter Driver API that facilitates measuring the performance of your app in an automated way created by Very Good Ventures 🦄

Very Good Performance Developed with ?? by Very Good Ventures ?? Utility on top of the Flutter Driver API that facilitates measuring the performance o

Very Good Open Source 72 Jun 24, 2022
Verisilicon Tensor Interface Module for OpenVX

TIM-VX is a software integration module provided by VeriSilicon to facilitate deployment of Neural-Networks on OpenVX enabled ML accelerators. It serves as the backend binding for runtime frameworks such as Android NN, Tensorflow-Lite, MLIR, TVM and more.

VeriSilicon, INC. 139 Jun 27, 2022
This is a fast module to probing an area in a 2d plane for physic objects

Godot AreaProber 2D Checking for neighbour colliders made easy AreaProber allows you to probe for colliders anywhere in your 2D game's world, no need

Strauji 8 Feb 14, 2022
kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics

kaun kaun is a replacement for löve's built-in love.graphics module intended for 3D graphics. It is a Lua module you can require from a shared library

Joel Schumacher 4 Apr 5, 2021
Horde3D is a small 3D rendering and animation engine. It is written in an effort to create an engine being as lightweight and conceptually clean as possible.

Horde3D Horde3D is a 3D rendering engine written in C++ with an effort being as lightweight and conceptually clean as possible. Horde3D requires a ful

Volker Vogelhuber 1.2k Jun 22, 2022
Lightweight and modular C++11 graphics middleware for games and data visualization

Magnum — Lightweight and modular C++11/C++14 graphics middleware for games and data visualization Looking for an open-source library that gives you gr

Vladimír Vondruš 4.1k Jul 3, 2022
A set of open c++ game development tools that are lightweight, easy-to-integrate and free to use. Currently hosting a magicavoxel .vox full scene loader.

open game tools Open game tools is a set of unencumbered, free, lightweight, easy-to-integrate tools for use in game development. So far it contains:

null 265 Jun 27, 2022
Lightweight OpenCL-Wrapper to greatly simplify OpenCL software development with C++ while keeping functionality and performance

OpenCL-Wrapper OpenCL is the most powerful programming language ever created. Yet the OpenCL C++ bindings are very cumbersome and the code overhead pr

Moritz Lehmann 26 Jun 21, 2022
GAMEDEV - Lightweight crash reporter for Unreal Engine

Mayday Mayday is a lightweight crash reporter for Unreal Engine games that uploads the crash context and minidump to an HTTP(S) server of your choosin

Gwennaël Arbona 15 Jun 24, 2022
Graphlite is a lightweight C++ generic graph library

Introduction Graphlite is a lightweight generic graph library that supports node properties edge properties directed/undirected graphs multi-edges & s

null 50 Jun 22, 2022
An immediate-mode, renderer agnostic, lightweight debug drawing API for C++

Debug Draw An immediate-mode, renderer agnostic, lightweight debug drawing API for C++. License This software is in the public domain. Where that dedi

Guilherme Lampert 433 Jun 25, 2022
SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications.

SPIRV-Reflect SPIRV-Reflect is a lightweight library that provides a C/C++ reflection API for SPIR-V shader bytecode in Vulkan applications. SPIRV-Ref

The Khronos Group 407 Jun 18, 2022
A very simple and light-weight drawing app made with qt and C++.

Blackboard A very simple and light-weight drawing app made with qt and C++. It supports tablet and pen pressure with the help of QTabletEvents. So you

null 1 Nov 15, 2021
A C++ commandline for use in servers and chat software. Provides very simple asynchronous input/output.

commandline A C++ commandline for use in servers and terminal chat software. Provides very simple asynchronous input/output. Supports reading and writ

Lion 68 Jun 14, 2022
Simple and efficient screen recording utility for Windows.

simple and efficient screen recording utility for Windows

Mārtiņš Možeiko 414 Jun 30, 2022
A simple single point light shadow mapping with OpenGL 3.3 and C++

omni-directional-light-example Using OpenGL 3.3 with C++ Basically a single light map, no lighting model was used Usage Build the executable outside A

Mohammad Issawi 4 Feb 10, 2022