Skip to content

Commit

Permalink
copied new LICK folder
Browse files Browse the repository at this point in the history
  • Loading branch information
redlock committed Mar 10, 2011
1 parent d407dfe commit 12b4dce
Show file tree
Hide file tree
Showing 4 changed files with 288 additions and 40 deletions.
82 changes: 71 additions & 11 deletions examples/empty_template/LICK/lib/hlpr.lua
@@ -1,23 +1,83 @@
-- hlpr libary: it's not about nice coding, ist about fast and easy coding
-- by Rukano and Headchant, 2011


-- global math
pi = math.pi
sin = math.sin
deg = math.deg
rad = math.rad

setColor = love.graphics.setColor
rectangle = love.graphics.rectangle
getWidth = love.graphics.getWidth

require "LICK/lib/color"

-- syntax shortcuts
checkMode = love.graphics.checkMode
circle = love.graphics.circle
clear = love.graphics.clear
draw = love.graphics.draw
drawq = love.graphics.drawq
getBackgroundColor = love.graphics.getBackgroundColor
getBlendMode = love.graphics.getBlendMode
getCaption =love.graphics.getCaption
getColor = love.graphics.getColor
getColorMode = love.graphics.getColorMode
getFont = love.graphics.getFont
getHeight = love.graphics.getHeight
push = love.graphics.push
getLineStipple = love.graphics.getLineStipple
getLineStyle = love.graphics.getLineStyle
getLineWidth = love.graphics.getLineWidth
getMaxPointSize = love.graphics.getMaxPointSize
getModes = love.graphics.getModes
getPointSize = love.graphics.getPointSize
getPointStyle = love.graphics.getPointStyle
getScissor = love.graphics.getScissor
getWidth = love.graphics.getWidth
isCreated = love.graphics.isCreated
line = love.graphics.line
newFont = love.graphics.newFont
newFrameBuffer = love.graphics.newFramebuffer
newImage = love.graphics.newImage
newImageFont = love.graphics.newImageFont
newParticleSystem = love.graphics.newParticleSystem
newQuad = love.graphics.newQuad
newScreenshot = love.graphics.newScreenshot
newSpriteBatch = love.graphics.newSpriteBatch
point = love.graphics.point
polygon = love.graphics.polygon
pop = love.graphics.pop
translate = love.graphics.translate
present = love.graphics.present
print = love.graphics.print
printf = love.graphics.printf
push = love.graphics.push
quad = love.graphics.quad
rectagle = love.graphics.rectangle
reset = love.graphics.reset
rotate = love.graphics.rotate
scale = love.graphics.scale
circle = love.graphics.circle
sin = math.sin
deg = math.deg
rad = math.rad
setBackgroundColor = love.graphics.setBackgroundColor
setBlendMode = love.graphics.setBlendMode
setCaption = love.graphics.setCaption
setColor = love.graphics.setColor
setColorMode = love.graphics.setColorMode
setFont = love.graphics.setFont
setIcon = love.graphics.setIcon
setLine = love.graphics.setLine
setLineStipple = love.graphics.setLineStipple
setLineStyle = love.graphics.setLineStyle
setLineWidth = love.graphics.setLineWidth
setMode = love.graphics.setMode
setPoint = love.graphics.setPoint
setPointSize = love.graphics.setPointSize
setPointStyle = love.graphics.setPointStyle
setRenderTarget = love.graphics.setRenderTarget
setScissor = love.graphics.setScissor
toggleFullscreen = love.graphics.toggleFullscreen
translate = love.graphics.translate
triangle = love.graphics.triangle



require "LICK/lib/color"

module(...,package.seeall)

Expand All @@ -38,7 +98,7 @@ function color(r, g,b,a)
return color
end

-- clip withing range (by redlock)
-- clip withing range
function clip(n,min,max)
return math.min(math.max(n, min or -math.huge), max or math.huge)
end
Expand Down
82 changes: 73 additions & 9 deletions examples/empty_template/LICK/lib/object.lua
Expand Up @@ -101,7 +101,7 @@ function SCSynth:free()
"i",
self.nodeid,
"i",
0,
0
}
}
Expand Down Expand Up @@ -194,18 +194,82 @@ end
----------------------------------------
-- Experimental Objects
----------------------------------------
--[[
LINE
--]]
-- @Line: draw a line
Line = Class(function(self, x, y, tx, ty)
self.tx = tx or 0
self.ty = ty or 0
-- call constructor of Drawable
Drawable.construct()
end)
Line:inherit(Object)
Line = Class(function(self, x, y, tx, ty, color) -- wats the dealio for polylines?
self.x = x or 0
self.y = y or 0
self.tx = tx or 0
self.ty = ty or 0
-- call constructor of Drawable
Drawable.construct(self, x, y, color)
end)
Line:inherit(Drawable)
-- TODO: FIX the :set("key", value) ... dunno how it works..!
-- #draw the line
function Line:draw(width, style)
local width=width or 1
if style ~= "smooth" and style ~= "rough" then
style = "smooth"
end
love.graphics.setLine(width, style)
love.graphics.setColor(unpack(self.color))
love.graphics.line(self.position.x, self.position.y, self.tx, self.ty)
end
--[[
IMAGE
--]]
-- @Image: Image from file
Image = Class(function(self, file, x, y, color, size, orientation)
self.image = love.graphics.newImage(file)
-- put positions, size, orientation...
-- call constructor of Drawable
Drawable.construct(self,x,y,color)
end)
Image:inherit(Drawable)
-- #draw the image
function Image:draw()
love.graphics.setColor(unpack(self.color))
love.graphics.draw(self.image, self.position.x, self.position.y)
end
--[[
POINT
--]]
-- @Point
Point = Class(function(self, x, y, color, size, style)
local color=color or ""
local size=size or 1
local style=style or "smooth"
-- should this be here? or in the constructor?
self.size = size
self.style = style
-- call constructor of Drawable
Drawable.construct(self,x,y,color)
end)
Point:inherit(Drawable)
-- #draw the point
function Point:draw()
love.graphics.setColor(unpack(self.color))
love.graphics.setPoint(self.size, self.style)
love.graphics.point(self.position.x, self.position.y)
end
-- EXAMPLE:
Expand Down
82 changes: 71 additions & 11 deletions examples/rotate/LICK/lib/hlpr.lua
@@ -1,23 +1,83 @@
-- hlpr libary: it's not about nice coding, ist about fast and easy coding
-- by Rukano and Headchant, 2011


-- global math
pi = math.pi
sin = math.sin
deg = math.deg
rad = math.rad

setColor = love.graphics.setColor
rectangle = love.graphics.rectangle
getWidth = love.graphics.getWidth

require "LICK/lib/color"

-- syntax shortcuts
checkMode = love.graphics.checkMode
circle = love.graphics.circle
clear = love.graphics.clear
draw = love.graphics.draw
drawq = love.graphics.drawq
getBackgroundColor = love.graphics.getBackgroundColor
getBlendMode = love.graphics.getBlendMode
getCaption =love.graphics.getCaption
getColor = love.graphics.getColor
getColorMode = love.graphics.getColorMode
getFont = love.graphics.getFont
getHeight = love.graphics.getHeight
push = love.graphics.push
getLineStipple = love.graphics.getLineStipple
getLineStyle = love.graphics.getLineStyle
getLineWidth = love.graphics.getLineWidth
getMaxPointSize = love.graphics.getMaxPointSize
getModes = love.graphics.getModes
getPointSize = love.graphics.getPointSize
getPointStyle = love.graphics.getPointStyle
getScissor = love.graphics.getScissor
getWidth = love.graphics.getWidth
isCreated = love.graphics.isCreated
line = love.graphics.line
newFont = love.graphics.newFont
newFrameBuffer = love.graphics.newFramebuffer
newImage = love.graphics.newImage
newImageFont = love.graphics.newImageFont
newParticleSystem = love.graphics.newParticleSystem
newQuad = love.graphics.newQuad
newScreenshot = love.graphics.newScreenshot
newSpriteBatch = love.graphics.newSpriteBatch
point = love.graphics.point
polygon = love.graphics.polygon
pop = love.graphics.pop
translate = love.graphics.translate
present = love.graphics.present
print = love.graphics.print
printf = love.graphics.printf
push = love.graphics.push
quad = love.graphics.quad
rectagle = love.graphics.rectangle
reset = love.graphics.reset
rotate = love.graphics.rotate
scale = love.graphics.scale
circle = love.graphics.circle
sin = math.sin
deg = math.deg
rad = math.rad
setBackgroundColor = love.graphics.setBackgroundColor
setBlendMode = love.graphics.setBlendMode
setCaption = love.graphics.setCaption
setColor = love.graphics.setColor
setColorMode = love.graphics.setColorMode
setFont = love.graphics.setFont
setIcon = love.graphics.setIcon
setLine = love.graphics.setLine
setLineStipple = love.graphics.setLineStipple
setLineStyle = love.graphics.setLineStyle
setLineWidth = love.graphics.setLineWidth
setMode = love.graphics.setMode
setPoint = love.graphics.setPoint
setPointSize = love.graphics.setPointSize
setPointStyle = love.graphics.setPointStyle
setRenderTarget = love.graphics.setRenderTarget
setScissor = love.graphics.setScissor
toggleFullscreen = love.graphics.toggleFullscreen
translate = love.graphics.translate
triangle = love.graphics.triangle



require "LICK/lib/color"

module(...,package.seeall)

Expand All @@ -38,7 +98,7 @@ function color(r, g,b,a)
return color
end

-- clip withing range (by redlock)
-- clip withing range
function clip(n,min,max)
return math.min(math.max(n, min or -math.huge), max or math.huge)
end
Expand Down

0 comments on commit 12b4dce

Please sign in to comment.