Pop.Box/extensions/utility.moon

19 lines
616 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
2017-04-30 21:13:56 +00:00
element.__base.fill = =>
@data.x = @parent.data.x + @data.padding
@data.y = @parent.data.y + @data.padding
@data.w = @parent.data.w - @data.padding*2
@data.h = @parent.data.h - @data.padding*2