didnt work with Dlib.lua.
cause of Circle class who are rewrite into DLIB.lua :/
dlib.lua
SpoilerCircle={} function Circle.new(x, y, radius) local this = {} if type(x)=="table" then if type(y)=="table" then--center and edge this.x = center.x this.y = center.y this.radius = Vector2.new(x.x - y.x, x.y - y.y).len() else this.x = x.x this.y = x.y this.radius = x.radius end else this.x = x or 0 this.y = y or 0 this.radius = radius or 0 end function this.set(x, y, radius) if type(x)=="table" then if type(y)=="table" then--center and edge this.x = center.x this.y = center.y this.radius = Vector2.new(x.x - y.x, x.y - y.y).len() else this.x = x.x this.y = x.y this.radius = x.radius end else this.x = x or 0 this.y = y or 0 this.radius = radius or 0 end return this end function this.setPosition(x, y) if type(x)=="table" then this.x = x.x this.y = x.y else this.x = x or 0 this.y = y or 0 end return this end function this.contains(x, y) if type(x)=="table" then if x.radius==nil then local dx = this.x - x.x local dy = this.y - x.y return dx * dx + dy * dy <= this.radius * this.radius else local radiusDiff = radius - x.radius if radiusDiff < 0 then return false end local dx = this.x - x.x local dy = this.y - x.y local dst = dx * dx + dy * dy local radiusSum = this.radius + x.radius return (not(radiusDiff * radiusDiff < dst) and (dst < radiusSum * radiusSum)) end else local x = this.x - x local y = this.y - y return x * x + y * y <= this.radius * this.radius end end function this.overlaps(c) local dx = this.x - c.x local dy = this.y - c.y local distance = dx * dx + dy * dy local radiusSum = this.radius + c.radius return distance < radiusSum * radiusSum end function this.area() return this.radius * this.radius * math.pi end function this.circumference() return 2 * this.radius * math.pi end function this.toString() return this.x .. "," .. this.y .. "," .. this.radius; end function this.equals (obj) if this == obj then return true end if obj == nil or obj.x~=this.x or obj.y~=this.y or obj.radius~=this.radius then return false end return true end function this.draw (color) FillRect(this.x,this.y,this.width, this.height, color or 0x90000000) end return this endInspired.lua
Spoilerclass "Circle" -- { function Circle:__init(x, y, z, r) local pos = GetOrigin(x) or type(x) ~= "number" and x or nil self.x = pos and pos.x or x self.y = pos and pos.y or y self.z = pos and pos.z or z self.r = pos and y or r end function Circle:contains(pos) return GetDistanceSqr(Vector(self.x, self.y, self.z), pos) < self.r * self.r end function Circle:draw(color) DrawCircle(self.x, self.y, self.z, self.r, 1, 10, color or 0xffffffff) end -- }
edit : not your fault btw, i modify "Circle" occurence by "DLibCircle" into Dlib.lua
if you really want temporally way, I think the better way is save inspired's circle before got overwrite by dlib and use it in the script.
But I don't like it, hope someone can find a perfect way....