Skip to content
Permalink
Browse files

Add BackgroundLayer

  • Loading branch information...
koenbok committed Jun 17, 2014
1 parent 1fb5c9e commit 536cf90cbdfa75b56e901170eadbb33cb793d1de
Showing with 24 additions and 0 deletions.
  1. +23 −0 framer/BackgroundLayer.coffee
  2. +1 −0 framer/Framer.coffee
@@ -0,0 +1,23 @@
{Layer} = require "./Layer"

"""
Todo: make it work in a parent layer
"""

class exports.BackgroundLayer extends Layer

constructor: (options={}) ->

options.backgroundColor ?= "#fff"
options.name = "Background"

super options

@sendToBack()
@layout()

Screen.on "resize", @layout

layout: =>
@width = Screen.width
@height = Screen.height
@@ -7,6 +7,7 @@ Framer._ = _
Framer.Utils = (require "./Utils")
Framer.Frame = (require "./Frame").Frame
Framer.Layer = (require "./Layer").Layer
Framer.BackgroundLayer = (require "./BackgroundLayer").BackgroundLayer
Framer.Events = (require "./Events").Events
Framer.Animation = (require "./Animation").Animation
Framer.Screen = (require "./Screen").Screen

0 comments on commit 536cf90

Please sign in to comment.
You can’t perform that action at this time.