avocado-old/packages/react/layer.coffee
2019-03-17 23:45:48 -05:00

25 lines
516 B
CoffeeScript

import PropTypes from 'prop-types'
import React from 'react'
import {TileLayer2D, TileLayer2DView, Tileset} from '@truss/environment'
class Layer2D extends React.Component
@propTypes =
layer: PropTypes.instanceOf TileLayer2D
tileset: PropTypes.instanceOf Tileset
constructor: (props) ->
super props
@layerView = new TileLayer2DView()
render: ->
@layerView.setLayer @props.layer
@layerView.setTileset @props.tileset
@props.setIntoContainer @layerView
export default Layer2D