Skip to content
SiteEmail

To get you up and running immediately, we have created pre-configured templates that bypass the manual setup of Vite and SolidJS.

These templates come with the gameface-specific configurations already applied so your code will render perfectly in the Gameface Player right out of the box.

Before we begin, ensure you have the following installed on your machine:

  • Node.js: We recommend the latest LTS version .
  • A Package Manager: npm, yarn, or pnpm.
  • VS Code: Or your preferred text editor.

Depending on your project requirements, you can either start with a structured blank project or a fully development ready UI component library.

To download these starter projects, we use a command line tool called degit. This tool simply grabs a clean copy of the template files from our repository and places them on your computer, without bringing along any messy version control history.

If you have limited web experience or want to skip the component creation process, we highly recommend starting with our pre-built Gameface UI template . It includes the exact same core technologies, but comes pre-loaded with a massive library of ready-to-use game components (like buttons, grids, and sliders), layout components for quick prototyping, and others.

We actively support and maintain this library, adding new components and features based on community feedback. This is our go to choice for starting new UI projects , and we highly recommend it for prototyping and production projects alike.

To get started with the Gameface UI template, run this command in your terminal:

Terminal window
npx degit CoherentLabs/Gameface-UI my-game-ui
cd my-game-ui
npm install

This will create a new folder called my-game-ui with the boilerplate code, install all dependencies, and get you ready to start developing your game UI.

Option B: Scaffold a SolidJS Project from Scratch

Section titled “Option B: Scaffold a SolidJS Project from Scratch”

If you prefer full control over your setup, you can scaffold a clean Vite + SolidJS project yourself using the official create-solid tool and then apply a few Gameface-specific configurations.

This route is ideal if you want to build your own UI architecture and components entirely from scratch, without any pre-built boilerplate.

  1. Open a terminal in the directory where you want to create your project and run:

    Terminal window
    npm init solid

    Follow the prompts to set up your project:

    • Project name: enter your desired project name (e.g. my-game-ui).
    • What type of project would you like to create? select SolidJS + Vite.
    • Use TypeScript? select Yes to use TypeScript.
    • Which template would you like to use? select basic.
  2. Navigate into your project directory and install the dependencies:

    Terminal window
    cd my-game-ui
    npm install
  3. By default, SolidJS optimizes performance by omitting the last closing tag of an element and the quotes around attributes. However, Gameface expects strict, valid HTML, so you must disable these optimizations to prevent console warnings and runtime errors.

    Set the following options to false in your vite.config.ts:

    • omitNestedClosingTags
    • omitLastClosingTag
    • omitQuotes

    Your vite.config.ts should look like this:

    import { defineConfig } from 'vite';
    import solidPlugin from 'vite-plugin-solid';
    import devtools from 'solid-devtools/vite';
    export default defineConfig({
    plugins: [devtools(), solidPlugin({
    solid: {
    omitLastClosingTag: false,
    omitNestedClosingTags: false,
    omitQuotes: false,
    }
    })],
    server: {
    port: 3000,
    },
    base: './',
    build: {
    target: 'esnext',
    },
    });

Once the configuration is complete, you can see how to preview the project in Gameface in the next section.

Regardless of which option you chose above, the steps to start your local server and view your UI in the Player are exactly the same.

  1. Open your terminal inside your new my-game-ui folder and run:

    Terminal window
    npm run dev

    This will start a local web server, usually at http://localhost:3000/.

  2. Instead of viewing your UI in a standard web browser like Chrome, you should view it directly in the Gameface Player to ensure 100% engine accuracy.

    Locate the Player.bat file included in your Gameface package. Open the file in a text editor, scroll down until you see a similar command:

    Terminal window
    start "Player" /d "%wd%" "..\Player\Player.exe" --player %*"

    and add the following parameter to the end of the line:

    Terminal window
    start "Player" /d "%wd%" "..PlayerPlayer.exe" --player "--url=http://localhost:3000/"

    Save the file and double-click the .bat file to launch the Player. It will open and display your SolidJS application. Because our setup supports Hot Module Replacement (HMR), every time you save a file in your code editor, the Player will instantly update!