Class: Core::GUI::ContextMenu
- Defined in:
- lib/gui/context_menu.rb
Overview
Small menu available by rightclicking on the map
Instance Attribute Summary
Attributes inherited from Element
#h, #w, #x, #xoff, #y, #yoff, #zoff
Instance Method Summary collapse
- #draw ⇒ Object
-
#initialize(x, y, obj = nil) ⇒ ContextMenu
constructor
A new instance of ContextMenu.
- #update ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(x, y, obj = nil) ⇒ ContextMenu
Returns a new instance of ContextMenu.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/gui/context_menu.rb', line 6 def initialize(x, y, obj=nil) super(x, y, 128, items(obj) * 24) @zoff = 10000 if @x + @w > 1024 @x = 1024 - @w end @buttons = {} setup_defaults(obj) @buttons.each_value { |but| but.zoff = @zoff } end |