Sha256: 2fd410c148dd9cf8a1de99ad3d53d184b1e0837ac9ce4aacea649a8544fb4e56
Contents?: true
Size: 1014 Bytes
Versions: 1
Compression:
Stored size: 1014 Bytes
Contents
module Joybox module Core class LayerColor < CCLayerColor def self.scene define_singleton_method(:scene) do scene = CCScene.new menu_layer = self.new scene << menu_layer end end def onEnter super on_enter if defined? (on_enter) end def onExit super on_exit if defined? (on_exit) end def self.defaults { opacity: 255, width: Screen.width, height: Screen.height } end def self.new(options = {}) options = options.nil? ? defaults : defaults.merge!(options) options[:color] << options[:opacity] layer = CCLayerColor.layerWithColor(options[:color], width: options[:width], height: options[:height]) layer.position = options[:position] if options.has_key? :position layer end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
joybox-1.1.0 | motion/joybox/core/layer_color.rb |