1.0.84-1 • Published 1 year ago

@game8.io/plugin v1.0.84-1

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year 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

1 year ago

1.0.85-stag.1

1 year ago

1.0.85-stag.0

1 year ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.66

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.69

1 year ago

1.0.68

1 year ago

1.0.67

1 year ago

1.0.70

1 year ago

1.0.37

2 years ago

1.0.36

2 years ago

1.0.79

1 year ago

1.0.78

1 year ago

1.0.39

2 years ago

1.0.38

2 years ago

1.0.80

1 year ago

1.0.84

1 year ago

1.0.40

2 years ago

1.0.83

1 year ago

1.0.82

1 year ago

1.0.79-stag.0

1 year ago

1.0.81

1 year ago

1.0.78-6

1 year ago

1.0.44

2 years ago

1.0.43

2 years ago

1.0.42

2 years ago

1.0.41

2 years ago

1.0.48

2 years ago

1.0.47

2 years ago

1.0.46

2 years ago

1.0.45

2 years ago

1.0.49

2 years ago

1.0.51

2 years ago

1.0.50

2 years ago

1.0.55

2 years ago

1.0.54

2 years ago

1.0.53

2 years ago

1.0.52

2 years ago

1.0.59

2 years ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.33

2 years ago

1.0.32

2 years ago

1.0.35

2 years ago

1.0.34

2 years ago

1.0.22-dev

2 years ago

1.0.26-dev

2 years ago

1.0.25-dev

2 years ago

1.0.24-dev

2 years ago

1.0.23-dev

2 years ago

1.0.31

2 years ago

1.0.18-dev

2 years ago

1.0.21-dev

2 years ago

1.0.20-dev

2 years ago

1.0.33-dev

2 years ago

1.0.32-dev

2 years ago

1.0.19-dev

2 years ago

1.0.29

2 years ago

1.0.30

2 years ago

1.0.26

2 years ago

1.0.25

2 years ago

1.0.28

2 years ago

1.0.27

2 years ago

1.0.19

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.22

2 years ago

1.0.21

2 years ago

1.0.20

2 years ago

1.0.17-dev

2 years ago

1.0.24

2 years ago

1.0.23

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago