@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
26 lines (20 loc) • 593 B
JavaScript
import { NearestFilter, RepeatWrapping, TextureLoader } from 'three';
import checkersURI from './CheckersTextureURI.js';
/**
*
* @param {Vector2} [repeat]
* @returns {Texture}
*/
function make(repeat) {
const checkerTexture = (new TextureLoader()).load(checkersURI);
checkerTexture.magFilter = NearestFilter;
if (repeat !== undefined) {
checkerTexture.wrapS = RepeatWrapping;
checkerTexture.wrapT = RepeatWrapping;
checkerTexture.repeat.copy(repeat);
}
return checkerTexture;
}
export default {
create: make
};