Advertisement
Pirnogion

LAPIShell

Nov 30th, 2014
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. ----------------------------
  2. -- Programm: LAPIShell    --
  3. -- Author:  JaggerDer     --
  4. -- Created: --.--.14      --
  5. ----------------------------
  6.  
  7. DrawLine = function(anX1, anY1, anX2, anY2, asChar, anCharColor, anColor, aloLayer)
  8.  local _nx1 = anX1
  9.  local _ny1 = anY1
  10.  local _nx2 = anX2
  11.  local _ny2 = anY2
  12.  
  13.  local _nSteep = math.abs(anY2 - anY1) > math.abs(anX2 - anX1)
  14.  if (_nSteep) then
  15.   _nx1 = anY1
  16.   _ny1 = anX1
  17.   _nx2 = anY2
  18.   _ny2 = anX2
  19.  end
  20.  if (_nx1 > _nx2) then
  21.   _nx1 = anX2
  22.   _nx2 = anX1
  23.   _ny1 = anY2
  24.   _ny2 = anY1
  25.  end
  26.  
  27.  local _ndx = _nx2 - _nx1
  28.  local _ndy = math.abs(_ny2 - _ny1)
  29.  local _nerr = _ndx / 2
  30.  local _nystep = -1
  31.  if (_ny1 < _ny2) then _nystep = 1 end
  32.  
  33.  local _ny = _ny1
  34.  local _nx = _nx1
  35.  
  36.  while (_nx < _nx2) do
  37.   aloLayer:SetPixel(_nx, _ny, asChar, anCharColor, anColor)
  38.  
  39.   _nerr = _nerr - _ndy
  40.   if (_nerr < 0) then
  41.    _ny = _ny + _nystep
  42.    _nerr = _nerr + _ndx
  43.   end
  44.  
  45.   _nx = _nx + 1
  46.  end
  47. end
  48.  
  49. DrawBox = function(anX1, anY1, anX2, anY2, asChar, anCharColor, anColor, aloLayer)
  50.  for y = anY1, anY2, 1 do
  51.   for x = anX1, anX2, 1 do
  52.    aloLayer:SetPixel(x, y, asChar, anCharColor, anColor)
  53.   end
  54.  end
  55. end
  56.  
  57. DrawCircle = function(anX, anY, anR, asText, anTextColor, anColor, anLayerName)
  58.  
  59. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement