Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 663 Bytes

components-function-bgimage.md

File metadata and controls

27 lines (21 loc) · 663 Bytes

BGImage

<BGImage> is one of functional components of AVG.js, provides background image display command for Storyscript.

import { React, Component, core, components } from 'avg-core';
const { Surface, BGImage } = components;

class Game extends Component {
  render() {
    return (
      <Surface>
        <BGImage />
      </Surface>
    );
  }
}

Usage in Storyscript:

[bg file="bgimage/h01.png"]    //  Instantly change the image
[bg file="bgimage/h01.png" trans]    // Gradient to change the image

Detailed usage of the fade function refers to Transition