A converter for use with BmpGlyph. Converts the fnt format into coffeescript.
A Pen by Matt Colman on CodePen.
| const a = 'a' | |
| const b = 'been' | |
| const c = () => { | |
| return a | |
| } |
| function helloWorld() { | |
| return <ShoppingList | |
| name="Sunday Shop" | |
| items={7} | |
| status={2} | |
| /> | |
| } |
| CustomLoader = function(item) { | |
| this.AbstractLoader_constructor(item, false, 'loader') | |
| } | |
| CustomLoader.getPreloadHandlers = function() { | |
| return { | |
| types: [ 'some_custom_type' ] | |
| callback: CustomLoader.preloadHandler | |
| } | |
| } |
| # ---------------------------------------------------------- # | |
| # EXAMPLE 1 | |
| # ---------------------------------------------------------- # | |
| # | |
| # BAD | |
| addPoints: -> | |
| pts = [] | |
| for i in [0...100] | |
| pts.push @getRandomPointFromRect new Rectangle(0, i * 20, 20, 20) |
| $(document).bind("keydown", function (e) { | |
| if (e.keyCode == 8) { // backspace | |
| e.preventDefault() | |
| // do whatever the backspace should do | |
| } | |
| } | |
A converter for use with BmpGlyph. Converts the fnt format into coffeescript.
A Pen by Matt Colman on CodePen.
| # Fat arrow implementation | |
| box.on 'go', @handleGo | |
| handleGo: (e) => | |
| e.target.removeListener 'go', @handleGo | |
| @game.nextState() | |
| # Thin arrow implementation | |
| scope = @ | |
| box.on 'go', -> | |
| @removeListener 'go', @ |
| @documentMC = @newMovieClip('movieclip_filename', 'MyClassName') | |
| # If you enter the class name as the filename you can import the main timeline from the FLA, | |
| # unless you have specifically changed the name of the Document class. | |
| @mainCnt.addChild @documentMC | |
| # **** MONSTER **** # | |
| monster = @documentMC.monster | |
| monster.onClick = => | |
| monster.gotoAndPlay('correct') |
| # add a bitmap | |
| newBitmap = @bitmap('my_bitmap') | |
| @stage.addChild(newBitmap) | |
| # extract frame 2 from a spriteSheet and use it as a bitmap | |
| newSpriteSheet = @spriteSheet('my_spritesheet') | |
| newSpriteSheet.bitmapFromFrame(2) | |
| @stage.addChild(newSpriteSheet) | |
| # add a BitmapAnimation |
| :variables: | |
| <<: *caper_common | |
| <<: *tally | |
| tally_spacing: | |
| :content: | |
| - 35 |