Skip to content

Latest commit

 

History

History
executable file
·
22 lines (17 loc) · 505 Bytes

components-base-image.md

File metadata and controls

executable file
·
22 lines (17 loc) · 505 Bytes

Image

<Image> is one of the basic components of AVG.js, used to display a image.

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

class Game extends Component {
  render() {
    return (
      <Surface>
        <Image src='assets/h06.png' x={0} y={0}/>
      </Surface>
    );
  }
}

All standard properties can be used.

?> The resource specified by src can not only be jpg/png/webp, but also be svg.