25 lines
516 B
CoffeeScript
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
|