mirror of
https://github.com/TangentFoxy/Pop.Box.git
synced 2024-12-15 12:44:20 +00:00
testing window/example in ReadMe, is broken
This commit is contained in:
parent
dc119e2dc6
commit
3f5cace9b3
@ -57,7 +57,9 @@ function love.load()
|
|||||||
print(b.horizontal, b.vertical)
|
print(b.horizontal, b.vertical)
|
||||||
print(c.horizontal, c.vertical)
|
print(c.horizontal, c.vertical)
|
||||||
|
|
||||||
--TODO make rounding to nearest pixel DEFAULT BEHAVIOR
|
local window = pop.window():align("center", "center"):setTitle("Welcome!")
|
||||||
|
--window:addChild(pop.text("Welcome to Pop.Box()!"))
|
||||||
|
|
||||||
--TODO make debugDraw better
|
--TODO make debugDraw better
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -21,6 +21,9 @@ do
|
|||||||
child.parent = self
|
child.parent = self
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
getChildren = function(self)
|
||||||
|
return self.child
|
||||||
|
end,
|
||||||
move = function(self, x, y)
|
move = function(self, x, y)
|
||||||
if x then
|
if x then
|
||||||
self.x = self.x + x
|
self.x = self.x + x
|
||||||
|
@ -44,6 +44,14 @@ do
|
|||||||
graphics.print("w", self.x, self.y)
|
graphics.print("w", self.x, self.y)
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
addChild = function(self, child)
|
||||||
|
self.window.child[#self.window.child + 1] = child
|
||||||
|
child.parent = self.window
|
||||||
|
return self
|
||||||
|
end,
|
||||||
|
getChildren = function(self)
|
||||||
|
return self.window.child
|
||||||
|
end,
|
||||||
setSize = function(self, w, h)
|
setSize = function(self, w, h)
|
||||||
local x = 0
|
local x = 0
|
||||||
local y = 0
|
local y = 0
|
||||||
@ -109,6 +117,10 @@ do
|
|||||||
self.title:move(nil, y)
|
self.title:move(nil, y)
|
||||||
self.window:move(nil, y)
|
self.window:move(nil, y)
|
||||||
return self
|
return self
|
||||||
|
end,
|
||||||
|
setTitle = function(self, title)
|
||||||
|
self.title:setText(title)
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
_base_0.__index = _base_0
|
_base_0.__index = _base_0
|
||||||
|
@ -21,6 +21,9 @@ do
|
|||||||
child.parent = self
|
child.parent = self
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
getChildren = function(self)
|
||||||
|
return self.child
|
||||||
|
end,
|
||||||
move = function(self, x, y)
|
move = function(self, x, y)
|
||||||
if x then
|
if x then
|
||||||
self.x = self.x + x
|
self.x = self.x + x
|
||||||
|
@ -44,6 +44,14 @@ do
|
|||||||
graphics.print("w", self.x, self.y)
|
graphics.print("w", self.x, self.y)
|
||||||
return self
|
return self
|
||||||
end,
|
end,
|
||||||
|
addChild = function(self, child)
|
||||||
|
self.window.child[#self.window.child + 1] = child
|
||||||
|
child.parent = self.window
|
||||||
|
return self
|
||||||
|
end,
|
||||||
|
getChildren = function(self)
|
||||||
|
return self.window.child
|
||||||
|
end,
|
||||||
setSize = function(self, w, h)
|
setSize = function(self, w, h)
|
||||||
local x = 0
|
local x = 0
|
||||||
local y = 0
|
local y = 0
|
||||||
@ -109,6 +117,10 @@ do
|
|||||||
self.title:move(nil, y)
|
self.title:move(nil, y)
|
||||||
self.window:move(nil, y)
|
self.window:move(nil, y)
|
||||||
return self
|
return self
|
||||||
|
end,
|
||||||
|
setTitle = function(self, title)
|
||||||
|
self.title:setText(title)
|
||||||
|
return self
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
_base_0.__index = _base_0
|
_base_0.__index = _base_0
|
||||||
|
@ -207,3 +207,7 @@ class window extends element
|
|||||||
@window\move nil, y
|
@window\move nil, y
|
||||||
|
|
||||||
return @
|
return @
|
||||||
|
|
||||||
|
setTitle: (title) =>
|
||||||
|
@title\setText title
|
||||||
|
return @
|
||||||
|
Loading…
Reference in New Issue
Block a user