Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArg = {...}
- local Path = tArg[1]
- local X = tArg[2]
- local Y = tArg[3]
- local Width = tArg[4]
- local Height = tArg[5]
- function Resize()
- local TileSize = {1,1}
- local file = fs.open(Path,"r")
- local Content = file.readLine()
- local W = string.len(Content)
- TileSize[1] = Width/W
- local H = 1
- repeat
- Content = file.readLine()
- if Content ~= nil then H = H + 1 end
- until Content == nil
- TileSize[2] = Height/H
- file.close()
- local Doc = fs.open(Path,"r")
- local x = X
- local y = Y
- for i = 1, W * H do
- local X1 = x
- local Y1 = y
- local TileColor = Doc.read()
- for I = 1, TileSize[1] * TileSize[2] do
- paintutils.drawPixel(X1,Y1,TileColor)
- if X1 < TileSize[1] then
- X1 = X1 + 1
- else
- X1 = x
- Y1 = Y1 + 1
- end
- end
- if x < X + Width then
- x = x + TileSize[1]
- else
- x = X
- y = y + TileSize[2]
- end
- end
- Doc.close()
- end
- Resize()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement