littlejsengine
Version:
LittleJS - Tiny and Fast HTML5 Game Engine
12 lines • 552 B
JavaScript
function gameRender()
{
// show the full texture
let pos = vec2(0,0); // world position to draw
let size = vec2(15); // world size of the tile
let color = hsl(0,0,1); // color to multiply the tile by
let tilePos = vec2(0,0); // top left corner in pixels
let tileSize = vec2(256); // source size in pixels
let tileInfo = new TileInfo(tilePos, tileSize); // tile info
drawRect(pos, size, GRAY); // draw background
drawTile(pos, size, tileInfo, color);
}