Pop.Box/extensions/utility.moon

20 lines
691 B
Plaintext
Raw Normal View History

2017-04-30 21:13:56 +00:00
--- @todo doc me
--- Functions I am not certain should be part of base classes, but nevertheless
--- may be useful.
import graphics from love
import sub, len from string
2017-04-30 23:40:29 +00:00
path = sub ..., 1, len(...) - len "/extensions/utility"
2017-04-30 21:13:56 +00:00
element = require "#{path}/elements/element"
--box = require "#{path}/elements/box"
--text = require "#{path}/elements/text"
2017-04-30 23:40:29 +00:00
--- @todo make this built-in as maximize for window elements
--- @todo rewrite to take into account margin!
2017-04-30 21:13:56 +00:00
element.__base.fill = =>
2017-05-01 01:01:19 +00:00
@data.x = @parent.data.x + @parent.data.padding
@data.y = @parent.data.y + @parent.data.padding
@data.w = @parent.data.w - @parent.data.padding*2
@data.h = @parent.data.h - @parent.data.padding*2