The basic stuff is there
Engine and sample code have been added
This commit is contained in:
parent
7a740aa62a
commit
1b8f63563f
BIN
OpenAL32.dll
Normal file
BIN
OpenAL32.dll
Normal file
Binary file not shown.
1084
changes.txt
Normal file
1084
changes.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -42,7 +42,6 @@ function gui:newBase(tp,name, x, y, w, h, sx ,sy ,sw ,sh)
|
||||
c:SetName(name)
|
||||
c.BorderSize=1
|
||||
c.BorderColor={0,0,0}
|
||||
c.BorderVisibility=1
|
||||
c.VIS=true
|
||||
c.Visible=true
|
||||
c.oV=true
|
||||
@ -71,7 +71,7 @@ function gui:drawC()
|
||||
love.graphics.setStencilTest("notequal",0)
|
||||
end
|
||||
love.graphics.circle("fill",x,y,r,s)
|
||||
love.graphics.setColor(self.BorderColor[1], self.BorderColor[2], self.BorderColor[3],self.BorderVisibility*254)
|
||||
love.graphics.setColor(self.BorderColor[1], self.BorderColor[2], self.BorderColor[3],self.Visibility*254)
|
||||
for b=0,self.BorderSize-1 do
|
||||
love.graphics.circle("line",x,y,r+b,s)
|
||||
end
|
||||
@ -67,10 +67,10 @@ function gui:drawR()
|
||||
_GuiPro.Clips[tostring(self)]=self
|
||||
love.graphics.setScissor(self.x, self.y, self.width, self.height)
|
||||
end
|
||||
if self:hasRoundness() then
|
||||
love.graphics.stencil(self.stfunc, "replace", 1)
|
||||
love.graphics.setStencilTest("greater", 0)
|
||||
end
|
||||
if self:hasRoundness() then
|
||||
love.graphics.stencil(self.stfunc, "replace", 1)
|
||||
love.graphics.setStencilTest("greater", 0)
|
||||
end
|
||||
love.graphics.rectangle("fill", self.x, self.y, self.width, self.height,(self.rx or 1)*self.DPI,(self.ry or 1)*self.DPI,(self.segments or 1)*self.DPI)
|
||||
if string.find(self.Type, "Image") then
|
||||
self:ImageRule()
|
||||
@ -78,10 +78,10 @@ function gui:drawR()
|
||||
if self.Type=="Video" then
|
||||
self:VideoRule()
|
||||
end
|
||||
if self:hasRoundness() then
|
||||
love.graphics.setStencilTest()
|
||||
end
|
||||
love.graphics.setColor(self.BorderColor[1], self.BorderColor[2], self.BorderColor[3],self.BorderVisibility*254)
|
||||
if self:hasRoundness() then
|
||||
love.graphics.setStencilTest()
|
||||
end
|
||||
love.graphics.setColor(self.BorderColor[1], self.BorderColor[2], self.BorderColor[3],self.Visibility*254)
|
||||
for b=0,self.BorderSize-1 do
|
||||
love.graphics.rectangle("line", self.x-(b/2), self.y-(b/2), self.width+b, self.height+b,(self.rx or 1)*self.DPI,(self.ry or 1)*self.DPI,(self.segments or 1)*self.DPI)
|
||||
end
|
||||
@ -28,7 +28,7 @@ function gui:newTextBox(t,name, x, y, w, h, sx ,sy ,sw ,sh)
|
||||
c.mark=nil
|
||||
c.arrowkeys=false
|
||||
c.funcF={function()
|
||||
love.keyboard.setTextInput(true)
|
||||
love.keyboard.setTextInput(true,0,200,400,200)
|
||||
end}
|
||||
c.cooldown=false
|
||||
c.cooldown2=false
|
||||
@ -14,7 +14,7 @@ function gui:LoadInterface(file)
|
||||
if love.filesystem.exists(file..add) then
|
||||
a,b=pcall(love.filesystem.load(file..add))
|
||||
if a then
|
||||
print("Loaded: "..file)
|
||||
--print("Loaded: "..file)
|
||||
else
|
||||
print("Error loading file: "..file)
|
||||
print(a,b)
|
||||
@ -34,7 +34,6 @@ function gui.LoadAll(dir)
|
||||
end
|
||||
-- Start Of Load
|
||||
|
||||
--gui.LoadAll("GuiManager/LibCore")
|
||||
gui.LoadAll("GuiManager/Core")
|
||||
gui.LoadAll("GuiManager/Image-Animation")
|
||||
gui.LoadAll("GuiManager/Frame")
|
||||
@ -42,8 +41,7 @@ gui.LoadAll("GuiManager/Item")
|
||||
gui.LoadAll("GuiManager/Misc")
|
||||
gui.LoadAll("GuiManager/Text")
|
||||
gui.LoadAll("GuiManager/Drawing")
|
||||
gui.LoadAll("GuiManager/Combos")
|
||||
--gui.LoadAll("GuiManager/WIP")
|
||||
|
||||
multi.boost=2
|
||||
|
||||
-- End of Load
|
||||
5
game/Interface/colorpicker.int
Normal file
5
game/Interface/colorpicker.int
Normal file
@ -0,0 +1,5 @@
|
||||
function gui:newColorPicker(x,y,w)
|
||||
local c=self:newFrame("ColorPicker",x,y,w,w)
|
||||
c.wheel=c:newImageLabel("Resources/wheel.png","Wheel",0,0,w,w)
|
||||
return c
|
||||
end
|
||||
40
game/Interface/console.int
Normal file
40
game/Interface/console.int
Normal file
@ -0,0 +1,40 @@
|
||||
function gui:newConsole(x,y,w,h)
|
||||
local c=self:newTextLabel("Console","Console",x,y,w,20,sx,sy,sw)
|
||||
c.dragbut="l"
|
||||
c.Draggable=true
|
||||
c.Tween=-3
|
||||
c.BG=c:newTextLabel("","",0,20,0,h,0,0,1,1)
|
||||
c.BG.ClipDescendants=true
|
||||
c.output=c.BG:newTextLabel("","",0,0,0,0,0,0,1,1)
|
||||
c.output.Visibility=0
|
||||
c.scroll=c.BG:newScrollBar()
|
||||
c.scroll.output=c.output
|
||||
c.output.Tween=-3
|
||||
c.output.TextColor=Color.sexy_purple
|
||||
c.input=c:newTextBox("> ","> ",0,h+20,-20,20,0,0,1)
|
||||
c.input.Tween=-3
|
||||
c.input.TextFormat="left"
|
||||
c.output.TextFormat="left"
|
||||
c.output.count=0
|
||||
c:ApplyGradient({Color.Red,Color.Darken(Color.Red,.25)})
|
||||
c.BG:ApplyGradient({Color.Black,Color.Lighten(Color.Black,.15)})
|
||||
c.input:ApplyGradient({Color.Gray,Color.Darken(Color.Gray,.25)})
|
||||
c.scroll:OnScroll(function(self,pos)
|
||||
self.output:SetDualDim(0,0,0,0,0,-((pos/(h*8))*self.output.count))
|
||||
end)
|
||||
c.input:OnEnter(function(self,text)
|
||||
self.Parent.output.text=self.Parent.output.text..text.."\n"
|
||||
self.text="> "
|
||||
self.Parent.output.count=self.Parent.output.count+1
|
||||
end)
|
||||
c.input:OnFocus(function(self)
|
||||
self.text="> "
|
||||
end)
|
||||
function c:showConsole()
|
||||
self.Parent.Visible=true
|
||||
end
|
||||
function c:hideConsole()
|
||||
self.Parent.Visible=false
|
||||
end
|
||||
return c
|
||||
end
|
||||
81
game/Interface/header.int
Normal file
81
game/Interface/header.int
Normal file
@ -0,0 +1,81 @@
|
||||
function gui:newHeader()
|
||||
local header=self:newFrame(0,0,0,20,0,0,1)
|
||||
header:ApplyGradient({Color.white,Color.light_blue,Color.blue,trans=200})
|
||||
header.last={x=0,width=0}
|
||||
function header:newTab(name)
|
||||
local font=love.graphics.getFont()
|
||||
local tab=self:newTextButton(name,self.last.x+self.last.width,0,font:getWidth(name)+6,20)
|
||||
self.last=tab
|
||||
tab.Visibility=0
|
||||
tab.Tween=-3
|
||||
tab.XTween=-2
|
||||
tab.Color=Color.white
|
||||
tab.largest={x=0,width=0}
|
||||
tab.Options=tab:newFrame("Options",0,20)
|
||||
tab.Options.Visible=false
|
||||
tab.Options.Color=Color.light_gray
|
||||
tab:OnEnter(function(self)
|
||||
self.Visibility=.5
|
||||
end)
|
||||
tab:OnExit(function(self)
|
||||
self.Visibility=0
|
||||
end)
|
||||
tab:OnReleased(function(b,self)
|
||||
if b=="l" then
|
||||
self.Options.Visible=true
|
||||
self:addDominance()
|
||||
end
|
||||
end)
|
||||
tab.Options:OnExit(function(self)
|
||||
self.Visible=false
|
||||
self:removeDominance()
|
||||
end)
|
||||
function tab:newOption(name,func,HK)
|
||||
local opt=self.Options:newTextButton(name,0,#self.Options:getChildren()*20,0,20,0,0,1)
|
||||
if HK then
|
||||
if type(HK)=="table" then
|
||||
for i=1,#HK do
|
||||
opt:addHotKey(HK[i]):OnHotKey(func)
|
||||
name=name.."\t\t\t\t\t\t"
|
||||
local temp=opt:newTextLabel(HK[i],-(font:getWidth(HK[i])+2),0,font:getWidth(HK[i])+2,20,1)
|
||||
temp.Visibility=0
|
||||
temp.Tween=-3
|
||||
temp.XTween=-2
|
||||
opt.text=name
|
||||
end
|
||||
else
|
||||
opt:setHotKey(HK)
|
||||
opt:OnHotKey(func)
|
||||
name=name.."\t\t\t\t\t\t"
|
||||
local temp=opt:newTextLabel(HK,-(font:getWidth(HK)+2),0,font:getWidth(HK)+2,20,1)
|
||||
temp.Visibility=0
|
||||
temp.Tween=-3
|
||||
temp.XTween=-2
|
||||
opt.text=name
|
||||
end
|
||||
end
|
||||
opt.TextFormat="left"
|
||||
opt.Visibility=0
|
||||
opt.Color=Color.white
|
||||
opt.Tween=-3
|
||||
opt:OnEnter(function(self)
|
||||
self.Visibility=.5
|
||||
end)
|
||||
opt:OnExit(function(self)
|
||||
self.Visibility=0
|
||||
end)
|
||||
local font=love.graphics.getFont()
|
||||
local c=self:getChildren()
|
||||
if font:getWidth(name)+6>self.largest.width then
|
||||
self.largest={width=font:getWidth(name)+6}
|
||||
end
|
||||
self.Options:SetDualDim(0,20,self.largest.width,#self.Options:getChildren()*20)
|
||||
if func then
|
||||
opt:OnReleased(func)
|
||||
end
|
||||
return opt
|
||||
end
|
||||
return tab
|
||||
end
|
||||
return header
|
||||
end
|
||||
20
game/Interface/player.int
Normal file
20
game/Interface/player.int
Normal file
@ -0,0 +1,20 @@
|
||||
function gui:newPlayer(source,x,y,w,h,sx,sy,sw,sh)
|
||||
local c=self:newFrame("MediaPlayer",x,y,w,h,sx,sy,sw,sh)
|
||||
c.visuals=c:newFrame(0,0,0,-20,0,0,1,1)
|
||||
c.bar=c:newFrame(40,-20,-40,20,0,1,1)
|
||||
c.bar:ApplyGradient{Color.blue,Color.Darken(Color.blue,.25)}
|
||||
c.action=c:newTextButton("Play",0,-20,40,20,0,1)
|
||||
c.action:ApplyGradient{Color.blue,Color.Darken(Color.blue,.25)}
|
||||
c.action:OnReleased(function(b,self)
|
||||
if self.text=="Play" then
|
||||
self.Parent.Source:play()
|
||||
self.text="Pause"
|
||||
else
|
||||
self.Parent.Source:pause()
|
||||
self.text="Play"
|
||||
end
|
||||
end)
|
||||
c.action.Tween=-3
|
||||
c.VPush=multi:newStep(0,1,1,10)
|
||||
c.Source=audio:new(source)
|
||||
end
|
||||
77
game/Interface/system.int
Normal file
77
game/Interface/system.int
Normal file
@ -0,0 +1,77 @@
|
||||
function gui:addTip(tip,n,padding)
|
||||
local font=love.graphics.getFont()
|
||||
self.t=gui:newTextLabel(tip,"Tooltip",0,0,font:getWidth(tip)+(padding or 4),14)
|
||||
self.t:setNewFont(10)
|
||||
self.t.Visible=false
|
||||
self.t.Tween=1
|
||||
self.t.Color=Color.tan
|
||||
self.alarm=multi:newAlarm(0)
|
||||
self.alarm:Pause()
|
||||
self.alarm.parent=self
|
||||
self.time=n or 2
|
||||
self.padding=padding or 4
|
||||
self.alarm:OnRing(function(alarm)
|
||||
alarm.parent.t:SetDualDim(love.mouse.getX()-2,love.mouse.getY()-2)
|
||||
alarm.parent.t.Visible=true
|
||||
alarm.parent.t:addDominance()
|
||||
end)
|
||||
self:OnEnter(function(self)
|
||||
self.Visibility=.5
|
||||
self.alarm:Reset(self.time)
|
||||
end)
|
||||
self:OnExit(function(self)
|
||||
self.alarm:Pause()
|
||||
self.Visibility=0
|
||||
end)
|
||||
self.t:OnExit(function(self)
|
||||
self.Visible=false
|
||||
self:removeDominance()
|
||||
end)
|
||||
end
|
||||
function gui:newWindow(name)
|
||||
local win=self:newFrame(0,0,400,20)
|
||||
win.Draggable=true
|
||||
win.dragbut="r"
|
||||
win:OnDragStart(function(self)
|
||||
self:TopStack()
|
||||
end)
|
||||
if name then
|
||||
local font=love.graphics.getFont()
|
||||
win.title=win:newTextLabel(name,0,0,font:getWidth(name),20)
|
||||
win.title.TextFormat="left"
|
||||
win.title.Visibility=0
|
||||
win.title.XTween=3
|
||||
win.title.Tween=-3
|
||||
end
|
||||
win:ApplyGradient({Color.white,Color.light_blue,Color.blue,trans=200})
|
||||
win.close=win:newImageButton("icons/cancel.png",-20,2,16,16,1)
|
||||
win.close:OnEnter(function(self)
|
||||
self.Parent:removeDominance()
|
||||
self:addDominance()
|
||||
end)
|
||||
win.close:OnReleased(function(b,self)
|
||||
self.Parent:Destroy()
|
||||
self:removeDominance()
|
||||
love.mouse.setCursor()
|
||||
end)
|
||||
win.close:OnExit(function(self)
|
||||
self:removeDominance()
|
||||
end)
|
||||
win.holder=win:newFrame(0,0,0,280,0,1,1)
|
||||
win:OnUpdate(function(self)
|
||||
if self.y<40 then self:SetDualDim(nil,0) love.mouse.setY(50) end
|
||||
end)
|
||||
win:OnEnter(function(self)
|
||||
self:addDominance()
|
||||
end)
|
||||
win:OnExit(function(self)
|
||||
self:removeDominance()
|
||||
end)
|
||||
win.holder:OnEnter(function(self)
|
||||
self:addDominance()
|
||||
end)
|
||||
win.holder:OnExit(function(self)
|
||||
self:removeDominance()
|
||||
end)
|
||||
return win.holder,win
|
||||
end
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user