Skip to content

The purpose of this boilerplate is to provide a starting point for anyone planning to create React-PixiJS games to be uploaded to Steam.

License

Notifications You must be signed in to change notification settings

tskazinski/electron-react-pixijs-greenworks-boilerplate

Repository files navigation

Electron-React-PixiJS-Greenworks boilerplate build upon Electron React Boilerplate with the addition of React PixiJS and Greenworks (a node.js plugin to integrate nw.js/electron games with steamworks). The purpose of this boilerplate is to provide a starting point for anyone planning to create React-PixiJS games to be uploaded on Steamworks and available on Steam.

The electron-react-boilerplate which this boilerplate is based on utilizes Electron, React, Redux, React Router, Webpack and React Hot Loader for rapid application development (HMR).

I will attempt to improve this boilerplate going forward but I welcome any forks and pull requests with any improvements.


Electron Boilerplate Demo


The following versions were used in the current boilerplate:

  • electron-react-boilerplate v0.17.1
  • electron v3.0.10
  • inlet/react-pixi v0.4.3
  • pixi.js v4.7.1
  • react v16.6.3
  • node.js v10.2.0
  • greenworks.js v0.14.0

Steps for getting boilerplate on Steam

Prerequisites:

You signed up for Steamworks and paid the product submission fee to setup a new product for distribution via Steam. You are familiar with uploading game deliverables onto steam, see this reference for details.

First, perform the install steps as outlined below under the Install section.

Next, create the steam_appid.txt file and place it in your project root, you will add your steam ap id in there.

Now go into the steam folder of root and add the following 3 files from your steamworks sdk zip file obtained from Steamworks.

  • steam_api64.dll
  • sdkencryptedappticket64.dll
  • greenworks-win64.node

Note: you will need different files for different platforms/architectures, the above is for Windows x64, see here for more details.

Then, package the app for the local platform:

$ yarn package

The above will create a release folder in your project root.

Copy the steam_appid.txt from your project root to the /release/win-unpacked folder.

Note: running \release\win-unpacked\ElectronReact.exe should work properly now and connect to steam (assuming you are logged into steam in your environment).

Now copy the entire contents of release\win-unpacked* onto your steamworks upload directory (), ie: steamworks_sdk\tools\ContentBuilder\content*

Now upload the contents onto your steam account, see here for more info.

Make the new uploaded build the default branch in steamworks.

Restart your steam and you will now see your boilerplate between your other games like so:

Install

  • If you have installation or compilation issues with this project, please see our debugging guide

First, clone the repo via git:

git clone --depth 1 --single-branch --branch master https://github.com/tskazinski/electron-react-pixijs-greenworks-boilerplate.git your-project-name

And then install the dependencies with yarn.

$ cd your-project-name
$ yarn

Run

Start the app in the dev environment. This starts the renderer process in hot-module-replacement mode and starts a webpack dev server that sends hot updates to the renderer process:

$ yarn dev

If you don't need autofocus when your files was changed, then run dev with env START_MINIMIZED=true:

$ START_MINIMIZED=true yarn dev

Packaging

To package apps for the local platform:

$ yarn package

To package apps for all platforms:

First, refer to the Multi Platform Build docs for dependencies.

Then,

$ yarn package-all

To package apps with options:

$ yarn package --[option]

To run End-to-End Test

$ yarn build-e2e
$ yarn test-e2e

# Running e2e tests in a minimized window
$ START_MINIMIZED=true yarn build-e2e
$ yarn test-e2e

💡 You can debug your production build with devtools by simply setting the DEBUG_PROD env variable:

DEBUG_PROD=true yarn package

CSS Modules

This boilerplate is configured to use css-modules out of the box.

All .css file extensions will use css-modules unless it has .global.css.

If you need global styles, stylesheets with .global.css will not go through the css-modules loader. e.g. app.global.css

If you want to import global css libraries (like bootstrap), you can just write the following code in .global.css:

@import '~bootstrap/dist/css/bootstrap.css';

SASS support

If you want to use Sass in your app, you only need to import .sass files instead of .css once:

import './app.global.scss';

Static Type Checking

This project comes with Flow support out of the box! You can annotate your code with types, get Flow errors as ESLint errors, and get type errors during runtime during development. Types are completely optional.

Dispatching redux actions from main process

See #118 and #108

License

MIT © Electron React Boilerplate

About

The purpose of this boilerplate is to provide a starting point for anyone planning to create React-PixiJS games to be uploaded to Steam.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published