rsg-chess-rn-graphics

1.1.0-alpha.3 • Public • Published

RSG Chess Graphics API for React Native

React Native based Chess graphics

Installation

npm install rsg-chess-rn-graphics
// or
yarn add rsg-chess-rn-graphics

Usage

Check out the RSG Chess graphics API for ReactJS

// Usage example:
 
import React, { Component } from "react";
import { Platform, Text, View} from "react-native";
 
import { Game } from "rsg-chess";
import ChessBoard from "rsg-chess-rn-graphics";
 
type Props = {};
const game = Game.prototype.initializeGame();
 
export default class App extends Component<Props> {
  render() {
    return (
      <View>
        <ChessBoard
          board={game.board}
          boardWidth={...}
          boardHeight={...}
          pieceSize={...}
          showValidMoves={true}
          selected={game.board[1][1]}
          self={this}
          onPress={(x, y) => {
            alert(x, y);
          }}
        />
      </View>
    );
  }
}

This project is created by Radi Cho, published by RSG Group and licensed under Apache 2.0 LICENSE

Package Sidebar

Install

npm i rsg-chess-rn-graphics

Weekly Downloads

1

Version

1.1.0-alpha.3

License

Apache-2.0

Unpacked Size

5.85 kB

Total Files

4

Last publish

Collaborators

  • radi-cho