MCPcopy Create free account
hub / github.com/creationix/node-sdl / draw

Function draw

examples/img.js:41–46  ·  view source on GitHub ↗
(surface, name, x, y)

Source from the content-addressed store, hash-verified

39
40
41function draw(surface, name, x, y) {
42 if (!spriteData.hasOwnProperty(name)) throw new Error("Invalid image name");
43 var offsets = spriteData[name];
44// var image = images[name]
45 SDL.blitSurface(tiles, [offsets[0], offsets[1], 101, 171], surface, [x, y + (offsets[2] || 0)]);
46}
47
48
49SDL.events.on("QUIT", function (evt) { process.exit(0); }); // Window close

Callers 1

img.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected