Skip to content

scratchcpp/scratchcpp-render

Repository files navigation

Contributors Forks Stargazers Issues MIT License


ScratchCPP GUI

A Qt-based library which uses libscratchcpp and QNanoPainter to render running Scratch projects.

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License

About The Project

scratchcpp-gui is a library which provides a set of Qt Quick components that can be used to run Scratch projects.

It uses QNanoPainter on top of Qt for hardware accelerated rendering and libscratchcpp to read, run and maintain the state of Scratch projects.

NOTE

This library is still in development and it shouldn't be used in production yet.

There might be incompatible API changes anytime before version 1.0.0 releases!

(back to top)

Getting Started

We're working on the documentation, it'll be available soon.

(back to top)

Usage

The most common way to get started is to use the ProjectPlayer component.

import QtQuick
import ScratchCPPGui

Window {
    width: 480
    height: 360
	visible: true
	title: qsTr("Hello World")

    ProjectPlayer {
        id: player
        fileName: "/path/to/project.sb3"
        onLoaded: start()
    }
}

The project will start when the window opens. If you would like to have a "green flag" button instead, call player.start() from the button:

Button {
    onClicked: player.start()
}

(back to top)

Roadmap

  • JPEG and PNG rendering
  • Everything related to displaying sprites (position, rotation, size, etc.)
  • Loading projects in another thread
  • API for engine properties (FPS, turbo mode, etc.)
  • Loading projects from URL
  • SVG rendering
  • Mouse position
  • Key press events
  • Mouse press events
  • Sprite click events
  • Clones
  • Sprite dragging
  • Touching color blocks
  • Pen blocks
  • Monitors
  • Graphics effects (maybe using shaders)
  • Speech and thought bubbles
  • Question text box ("ask and wait" block)

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Format changed source files (clang-format src/some_file.cpp)
  4. Commit your Changes (git add -A && git commit -m 'Add some AmazingFeature')
  5. Push to the Branch (git push origin feature/AmazingFeature)
  6. Open a Pull Request

(back to top)

License

Distributed under the GNU Lesser General Public License. See LICENSE for more information.

(back to top)

About

Qt library for running and rendering Scratch projects

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published