1.0.84-1 • Published 8 months ago

@game8.io/plugin v1.0.84-1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

npm GitHub version license

Game8.io HTML5 Plugin

This is the documentation of the "Game8.io HTML5 Plugin" project.

Game8.io is the biggest collections of high quality, cross-platform games. We provide great games for your website within minutes!

Running into any issues? Check out the F.A.Q. within the Wiki of the github repository before mailing to support@game8.io

Implementation

Implement the following snippet within your game or within the <head> section of your index.html.

<!-- Pogame Plugin -->
<link rel="stylesheet" href="https://unpkg.com/@game8.io/plugin/dist/g8plugin.css">
<script type="text/javascript" src="https://unpkg.com/@game8.io/plugin/dist/g8plugin.js"></script>

How to publish this package to npmjs?

For production environment, To release new version path: (Eg: from v1.0.70 to v1.0.71)

npm version patch -m "Release %s"
git push origin main --follow-tags

For staging environment, using prerelease (Eg: from v1.0.70 to v1.0.71-0)

npm version prerelease --preid=stag -m "Prerelease %s"
git push origin stag --follow-tags

Usage

Create container where the game screen will be rendered.

<!-- Container -->
<div id="game-screen" style="background: rgba(0, 0, 0, 0.5);height:600px;"></div>

Render game screen with window.g8plugin.init method.

<script>
    window.g8plugin.init({
        container: 'game-screen',
        gameId: 'df0a60ffc1e344adb308b5e9a8a0bd04',
        preload: true,
    });
</script>
  • This plugin provides a range of flexible options to help you fine-tune your experience during usage. npm.io

  • When you start the game, if your device is not oriented correctly, a warning will appear on your screen. This is a gentle reminder to keep your device in a fixed position for the best gaming experience possible

Options:

window.g8plugin.init({
    // The container where the game screen will be rendered
    container: "game-screen",

    // you need to provide either gameId or gameUrl
    // if no `gameData` is used, the game won't be able to fetch from the server, so you don't need to provide gameId, you can provide gameUrl directly
    gameId: "df0a60ffc1e344adb308b5e9a8a0bd04",
    // gameUrl: "https://h5.ga8.io/df0a60ffc1e344adb308b5e9a8a0bd04/",

    preload: true, // will be 'preload' or 'direct'

    //can be 'portrait' or 'landscape' or a function that returns either 'portrait' or 'landscape'
    orientation: (gameData) => { return gameData.orientation },
    gameControls: {
        // can be a string that represents the game title or a function that returns the game title
        gameTitle: (gameData) => { return gameData.title },
        // can be a string that represents the game thumb or a function that returns the game thumb
        gameThumb: (gameData) => { return gameData.thumb },
        // You can provide a custom full screen button icon or hide the full screen button by setting fullScreenButton=false
        fullScreenButton: {
            icon: "https://static.ga8.io/plugins/g8plugin/images/full-screen.svg"
        },
        // Determines the visibility of the game controls.
        // You can set the visibility for mobile, mobile_fullscreen, pc, pc_fullscreen or visibility=false to hide the game controls
        visibility: {
            mobile: true,
            mobile_fullscreen: false,
            pc: true,
            pc_fullscreen: true,
        }
    },
    //Button will float on mobile devices on fullscreen mode and will be hidden on PC as default
    floatingButton: {
        // Determines the visibility of the floating button.
        // You can set the visibility for mobile, mobile_fullscreen, pc, pc_fullscreen or visibility=false to hide the floating button
        visibility: {
            mobile: false,
            mobile_fullscreen: true,
            pc: false,
            pc_fullscreen: false,
        },
        // Default position of the floating button, default is bottom right corner
        defaultPosition: {
            right: "0px",
            bottom: "0px"
        }
    },
})
1.0.84-1

8 months ago

1.0.85-stag.1

10 months ago

1.0.85-stag.0

11 months ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.66

11 months ago

1.0.65

12 months ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.69

11 months ago

1.0.68

11 months ago

1.0.67

11 months ago

1.0.70

11 months ago

1.0.37

1 year ago

1.0.36

1 year ago

1.0.79

11 months ago

1.0.78

11 months ago

1.0.39

1 year ago

1.0.38

1 year ago

1.0.80

11 months ago

1.0.84

11 months ago

1.0.40

1 year ago

1.0.83

11 months ago

1.0.82

11 months ago

1.0.79-stag.0

11 months ago

1.0.81

11 months ago

1.0.78-6

11 months ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.48

1 year ago

1.0.47

1 year ago

1.0.46

1 year ago

1.0.45

1 year ago

1.0.49

1 year ago

1.0.51

1 year ago

1.0.50

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.52

1 year ago

1.0.59

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.35

1 year ago

1.0.34

1 year ago

1.0.22-dev

1 year ago

1.0.26-dev

1 year ago

1.0.25-dev

1 year ago

1.0.24-dev

1 year ago

1.0.23-dev

1 year ago

1.0.31

1 year ago

1.0.18-dev

1 year ago

1.0.21-dev

1 year ago

1.0.20-dev

1 year ago

1.0.33-dev

1 year ago

1.0.32-dev

1 year ago

1.0.19-dev

1 year ago

1.0.29

1 year ago

1.0.30

1 year ago

1.0.26

1 year ago

1.0.25

1 year ago

1.0.28

1 year ago

1.0.27

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.17-dev

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago