chore: port menu to rect
This commit is contained in:
parent
e58f197049
commit
82cf59588a
1 changed files with 5 additions and 9 deletions
|
@ -21,7 +21,9 @@
|
|||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
]]
|
||||
|
||||
local Menu = Object:extend()
|
||||
local Rect = require "birb.objects.2D.rect"
|
||||
|
||||
local Menu = Rect:extend()
|
||||
|
||||
local function updateWidgetByOrder(a, b)
|
||||
if a.order ~= b.order then
|
||||
|
@ -38,10 +40,7 @@ function Menu:new(menusystem, name, x, y, w, h)
|
|||
self.menusystem = menusystem
|
||||
self.name = name
|
||||
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.w = w
|
||||
self.h = h
|
||||
Menu.super.new(self, x, y, w, h)
|
||||
|
||||
self.widget = {}
|
||||
self.widget.list = {}
|
||||
|
@ -137,10 +136,7 @@ function Menu:clear()
|
|||
end
|
||||
|
||||
function Menu:resize(x,y,w,h)
|
||||
self.x = x
|
||||
self.y = y
|
||||
self.w = w
|
||||
self.h = h
|
||||
self:set(x,y,w,h)
|
||||
|
||||
self:updateWidgetSize()
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue