mirror of
https://github.com/cyberarm/cyberarm_engine.git
synced 2025-12-18 22:02:34 +00:00
Added Container#clear to remove child elements and optionally eval block, improvements to EditLine to show current selection.
This commit is contained in:
@@ -2,6 +2,7 @@ module CyberarmEngine
|
||||
class Element
|
||||
class Container < Element
|
||||
include Common
|
||||
include CyberarmEngine::DSL
|
||||
|
||||
attr_accessor :stroke_color, :fill_color
|
||||
attr_reader :children, :gui_state
|
||||
@@ -31,6 +32,12 @@ module CyberarmEngine
|
||||
recalculate
|
||||
end
|
||||
|
||||
def clear(&block)
|
||||
@children.clear
|
||||
|
||||
block.call(self) if block
|
||||
end
|
||||
|
||||
def render
|
||||
Gosu.clip_to(@x, @y, width, height) do
|
||||
@children.each(&:draw)
|
||||
|
||||
Reference in New Issue
Block a user