Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --]] Lua buffer map API ideas
- getMap(w, h) -- Returns map in table format
- -------------
- --]] Map Functions -- "FF*", where FF is text color, then back color, and * is the graphic
- changePixelGraphic(x,y,to) -- Changes a pixels graphic at an X and Y to a specific string "Text-Back-Str"
- setSolid(x,y,tf) -- Sets a pixel at X, Y to be solid or not (map[y][x].solid = tf)
- getRegionMap(fx,fy,tx,ty) -- Returns a map of pixels from a specific region
- setPixelAttribute(x,y,att) -- Concatenates att table onto the Pixels table at X, Y
- getPixelAttribute(x,y,name)-- Returns Attribute by name
- setPixel(x,y,g,s) -- sets pixel at x, y to graphic - g and solid - s
- getPixel(x,y) -- returns entire pixel at x and y
- drawPixel(x,y) -- draws pixel from map x, y
- drawPixelAt(x,y,sx,sy) -- draws pixel from map x, y at screen sx, sy
- ---------------
- createCamera(fx,fy) -- Returns camera table with focal pointed offsets of - fx and fy
- --]] Camera Functions -- store local buffer
- render(map,mx,my,ox,oy) -- render map starting ox, oy and ending at mx+ox and my+oy, viewx = ox, viewy = oy, vieww = mx, viewh = my : checks buffer for smart rendering
- updateView(map,cx,cy) -- Updates cam view by adding cx and cy to it, renders
- clearBuffer() -- Clears the buffer
- isOutsideView(x,y) -- Check view variables to see of coord is outside view
- setBuffer(buff) -- Sets buffer table to, buff
- ---------------
- Transparent pixel utils - render used to draw pixels unrelated to the table map
- -]] Transparent pixel functions -- Returns renderer
- setProjection(x,y) -- sets starting point for adding offsets too
- addProjection(xo,yo) -- adds xo, yo to projection
- drawTPixel(x,y,g) -- draws pixel at x, y with g as graphic
- moveTPixel(map,xo,yo,g,a) -- takes map and draws map[y][x] at projection then draws g, at projection +xo, +yo boolean a is add offset to projection.
- clearTPixel(map,x,y) -- redraws x, y to map[y][x]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement