├── .gitignore ├── LICENSE ├── README.md ├── build.sbt ├── project ├── build.properties └── build.sbt ├── sbt-launch-0.13.8.jar ├── sbt.bat ├── sbt.sh └── src └── main └── scala └── com └── scalawarrior └── scalajs └── createjs ├── CreateJSLib.scala ├── EaselJS.scala ├── PreloadJS.scala ├── SoundJS.scala └── TweenJS.scala /.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | *.log 3 | 4 | # sbt specific 5 | dist/* 6 | target/ 7 | lib_managed/ 8 | src_managed/ 9 | project/boot/ 10 | project/plugins/project/ 11 | 12 | # Scala-IDE specific 13 | .scala_dependencies 14 | .classpath 15 | .project 16 | .cache 17 | .settings 18 | 19 | # IntelliJ specific 20 | .idea/ 21 | .idea_modules/ 22 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "[]" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright 2015-2-16 Scala-Warrior Team 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | scalajs-createjs 2 | =============== 3 | 4 | Static types for the [CreateJS](http://createjs.com/) API for [Scala.js](http://www.scala-js.org/) programs. 5 | 6 | Usage 7 | ----- 8 | 9 | Add the following to your sbt build definition: 10 | 11 | ```scala 12 | resolvers += "amateras-repo" at "http://amateras.sourceforge.jp/mvn/" 13 | 14 | libraryDependencies += "com.scalawarrior" %%% "scalajs-createjs" % "0.0.2" 15 | ``` 16 | and add following import statement to the head of your Scala.js program: 17 | 18 | ```scala 19 | import com.scalawarrior.scalajs.createjs._ 20 | ``` 21 | 22 | then enjoy CreateJS in Scala.js! 23 | 24 | ```scala 25 | // Declare the stage 26 | val stage = new Stage("demoCanvas") 27 | val w = stage.canvas.width 28 | val h = stage.canvas.height 29 | 30 | // Define images 31 | val manifest = js.Array( 32 | js.Dictionary("src" -> "background.png", "id" -> "background"), 33 | js.Dictionary("src" -> "knight.png", "id" -> "knight") 34 | ) 35 | 36 | // Pre-load images 37 | val loader = new LoadQueue(false) 38 | loader.addEventListener("complete", (e: Object) => { 39 | // Assemble shapes on the stage 40 | val background = new Shape() 41 | background.graphics.beginBitmapFill(loader.getResult("background")).drawRect(0, 0, w, h) 42 | 43 | var spriteSheet = new SpriteSheet(js.Dictionary( 44 | "framerate" -> 30, 45 | "images" -> js.Array(loader.getResult("knight")), 46 | "frames" -> js.Dictionary("regX" -> -70, "height" -> 88, "count" -> 64, "regY" -> -60, "width" -> 74) 47 | )) 48 | val knight = new Sprite(spriteSheet); 49 | 50 | stage.addChild(background, knight); 51 | stage.update(); 52 | true 53 | }) 54 | loader.loadManifest(manifest) 55 | ``` 56 | -------------------------------------------------------------------------------- /build.sbt: -------------------------------------------------------------------------------- 1 | lazy val root = project.in(file(".")). 2 | enablePlugins(ScalaJSPlugin) 3 | 4 | name := "Scala.js CreateJS" 5 | 6 | normalizedName := "scalajs-createjs" 7 | 8 | version := "0.0.2-SNAPSHOT" 9 | 10 | organization := "com.scalawarrior" 11 | 12 | scalaVersion := "2.11.8" 13 | 14 | //crossScalaVersions := Seq("2.10.4", "2.11.5") 15 | 16 | libraryDependencies += 17 | "org.scala-js" %%% "scalajs-dom" % "0.9.1" 18 | 19 | //jsDependencies += 20 | // "org.webjars" % "jquery" % "2.1.3" / "2.1.3/jquery.js" 21 | 22 | scalacOptions ++= Seq( 23 | "-deprecation", 24 | "-encoding", "UTF-8", 25 | "-feature", 26 | "-unchecked", 27 | "-Xlint", 28 | "-Yno-adapted-args", 29 | "-Ywarn-numeric-widen", 30 | "-Ywarn-value-discard", 31 | "-Xfuture", 32 | "-Ywarn-unused-import" 33 | ) 34 | 35 | publishTo <<= (version) { version: String => 36 | val repoInfo = 37 | if (version.trim.endsWith("SNAPSHOT")) 38 | ("amateras snapshots" -> "/home/groups/a/am/amateras/htdocs/mvn-snapshot/") 39 | else 40 | ("amateras releases" -> "/home/groups/a/am/amateras/htdocs/mvn/") 41 | Some(Resolver.ssh( 42 | repoInfo._1, 43 | "shell.sourceforge.jp", 44 | repoInfo._2) as(System.getProperty("user.name"), (Path.userHome / ".ssh" / "id_rsa").asFile) withPermissions("0664")) 45 | } 46 | -------------------------------------------------------------------------------- /project/build.properties: -------------------------------------------------------------------------------- 1 | sbt.version=0.13.8 2 | -------------------------------------------------------------------------------- /project/build.sbt: -------------------------------------------------------------------------------- 1 | addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.14") 2 | -------------------------------------------------------------------------------- /sbt-launch-0.13.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scalawarrior/scalajs-createjs/f72b6622e874d536ea9d56716bea4482a9e07ec4/sbt-launch-0.13.8.jar -------------------------------------------------------------------------------- /sbt.bat: -------------------------------------------------------------------------------- 1 | set SCRIPT_DIR=%~dp0 2 | java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar "%SCRIPT_DIR%\sbt-launch-0.13.8.jar" %* 3 | -------------------------------------------------------------------------------- /sbt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | java -Dsbt.log.noformat=true -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m -Xmx512M -Xss2M -jar `dirname $0`/sbt-launch-0.13.8.jar "$@" 3 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/createjs/CreateJSLib.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs.createjs 2 | 3 | import scala.scalajs.js 4 | import js.annotation._ 5 | 6 | //@JSName("createjs.EventDispatcher") 7 | //object EventDispatcher extends js.Object { 8 | // def initialize(target: Object): Unit = js.native 9 | //} 10 | 11 | @js.native 12 | @JSName("createjs.Event") 13 | class Event protected () extends js.Object { 14 | def this(`type`: String, bubbles: Boolean, cancelable: Boolean) = this() 15 | var bubbles: Boolean = js.native 16 | var cancelable: Boolean = js.native 17 | var currentTarget: js.Any = js.native 18 | var defaultPrevented: Boolean = js.native 19 | var eventPhase: Double = js.native 20 | var immediatePropagationStopped: Boolean = js.native 21 | var propagationStopped: Boolean = js.native 22 | var removed: Boolean = js.native 23 | var target: js.Any = js.native 24 | var timeStamp: Double = js.native 25 | var `type`: String = js.native 26 | var data: js.Any = js.native 27 | var delta: Double = js.native 28 | var error: String = js.native 29 | var id: String = js.native 30 | var item: js.Any = js.native 31 | var loaded: Double = js.native 32 | var name: String = js.native 33 | var next: String = js.native 34 | var params: js.Any = js.native 35 | var paused: Boolean = js.native 36 | var progress: Double = js.native 37 | var rawResult: js.Any = js.native 38 | var result: js.Any = js.native 39 | var runTime: Double = js.native 40 | var src: String = js.native 41 | var time: Double = js.native 42 | var total: Double = js.native 43 | override def clone(): Event = js.native 44 | def preventDefault(): Unit = js.native 45 | def remove(): Unit = js.native 46 | def set(props: Object): Event = js.native 47 | def stopImmediatePropagation(): Unit = js.native 48 | def stopPropagation(): Unit = js.native 49 | override def toString(): String = js.native 50 | } 51 | 52 | @js.native 53 | @JSName("createjs.EventDispatcher") 54 | class EventDispatcher extends js.Object { 55 | def addEventListener(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): js.Function = js.native 56 | //def addEventListener(`type`: String, listener: js.Any, useCapture: Boolean = ???): Object = js.native 57 | def dispatchEvent(eventObj: Object, target: Object = ???): Boolean = js.native 58 | def hasEventListener(`type`: String): Boolean = js.native 59 | def off(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): Unit = js.native 60 | def on(`type`: String, listener: js.Function1[Object, Boolean], scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): js.Function = js.native 61 | //def on(`type`: String, listener: js.Any, scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): Object = js.native 62 | def removeAllEventListeners(`type`: String = ???): Unit = js.native 63 | def removeEventListener(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): Unit = js.native 64 | override def toString(): String = js.native 65 | def willTrigger(`type`: String): Boolean = js.native 66 | } 67 | 68 | // //@JSName("createjs") 69 | // @JSName("createjs.EventDispatcher") 70 | // class EventDispatcher extends js.Object { 71 | // def initialize(target: Object): Unit = js.native 72 | // } 73 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/createjs/EaselJS.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs.createjs 2 | 3 | import org.scalajs.dom.raw._ 4 | import scala.scalajs.js 5 | import js.| 6 | import js.annotation._ 7 | 8 | @js.native 9 | class NativeMouseEvent extends MouseEvent { 10 | } 11 | 12 | @js.native 13 | @JSName("createjs.AlphaMapFilter") 14 | class AlphaMapFilter protected () extends Filter { 15 | def this(alphaMap: HTMLImageElement) = this() 16 | var alphaMap: HTMLImageElement = js.native // TODO or HTMLCanvasElement 17 | override def clone(): AlphaMapFilter = js.native 18 | } 19 | 20 | @js.native 21 | @JSName("createjs.AlphaMaskFilter") 22 | class AlphaMaskFilter protected () extends Filter { 23 | def this(mask: HTMLImageElement) = this() 24 | def this(mask: HTMLCanvasElement) = this() 25 | var mask: HTMLImageElement = js.native // TODO or HTMLCanvasElement 26 | override def clone(): AlphaMaskFilter = js.native 27 | } 28 | 29 | @js.native 30 | @JSName("createjs.Bitmap") 31 | class Bitmap protected () extends DisplayObject { 32 | def this(imageOrUrl: HTMLImageElement) = this() 33 | def this(imageOrUrl: HTMLCanvasElement) = this() 34 | def this(imageOrUrl: HTMLVideoElement) = this() 35 | def this(imageOrUrl: String) = this() 36 | var image: HTMLImageElement = js.native // TODO or HTMLCanvasElement | HTMLVideoElement 37 | var sourceRect: Rectangle = js.native 38 | override def clone(): Bitmap = js.native 39 | } 40 | 41 | @js.native 42 | @JSName("createjs.BitmapText") 43 | class BitmapText protected () extends DisplayObject { 44 | def this(text: String = ???, spriteSheet: SpriteSheet = ???) = this() 45 | var letterSpacing: Double = js.native 46 | var lineHeight: Double = js.native 47 | var spaceWidth: Double = js.native 48 | var spriteSheet: SpriteSheet = js.native 49 | var text: String = js.native 50 | } 51 | 52 | @js.native 53 | @JSName("createjs.BitmapText") 54 | object BitmapText extends js.Object { 55 | var maxPoolSize: Double = js.native 56 | } 57 | 58 | @js.native 59 | @JSName("createjs.BlurFilter") 60 | class BlurFilter protected () extends Filter { 61 | def this(blurX: Double = ???, blurY: Double = ???, quality: Double = ???) = this() 62 | var blurX: Double = js.native 63 | var blurY: Double = js.native 64 | var quality: Double = js.native 65 | override def clone(): BlurFilter = js.native 66 | } 67 | 68 | @js.native 69 | @JSName("createjs.ButtonHelper") 70 | class ButtonHelper protected () extends js.Object { 71 | def this(target: Sprite, outLabel: String = ???, overLabel: String = ???, downLabel: String = ???, play: Boolean = ???, hitArea: DisplayObject = ???, hitLabel: String = ???) = this() 72 | var downLabel: String = js.native // TODO or Double 73 | var outLabel: String = js.native // TODO or Double 74 | var overLabel: String = js.native // TODO or Double 75 | var play: Boolean = js.native 76 | var target: Sprite = js.native // TODO or MovieClip 77 | var enabled: Boolean = js.native 78 | def setEnabled(value: Boolean): Unit = js.native 79 | def getEnabled(): Boolean = js.native 80 | override def toString(): String = js.native 81 | } 82 | 83 | @js.native 84 | @JSName("createjs.ColorFilter") 85 | class ColorFilter protected () extends Filter { 86 | def this(redMultiplier: Double = ???, greenMultiplier: Double = ???, blueMultiplier: Double = ???, alphaMultiplier: Double = ???, redOffset: Double = ???, greenOffset: Double = ???, blueOffset: Double = ???, alphaOffset: Double = ???) = this() 87 | var alphaMultiplier: Double = js.native 88 | var alphaOffset: Double = js.native 89 | var blueMultiplier: Double = js.native 90 | var blueOffset: Double = js.native 91 | var greenMultiplier: Double = js.native 92 | var greenOffset: Double = js.native 93 | var redMultiplier: Double = js.native 94 | var redOffset: Double = js.native 95 | override def clone(): ColorFilter = js.native 96 | } 97 | 98 | @js.native 99 | @JSName("createjs.ColorMatrix") 100 | class ColorMatrix protected () extends js.Object { 101 | def this(brightness: Double = ???, contrast: Double = ???, saturation: Double = ???, hue: Double = ???) = this() 102 | def adjustBrightness(value: Double): ColorMatrix = js.native 103 | def adjustColor(brightness: Double, contrast: Double, saturation: Double, hue: Double): ColorMatrix = js.native 104 | def adjustContrast(value: Double): ColorMatrix = js.native 105 | def adjustHue(value: Double): ColorMatrix = js.native 106 | def adjustSaturation(value: Double): ColorMatrix = js.native 107 | override def clone(): ColorMatrix = js.native 108 | def concat(matrix: Double*): ColorMatrix = js.native 109 | def copy(matrix: Double*): ColorMatrix = js.native 110 | def reset(): ColorMatrix = js.native 111 | def setColor(brightness: Double, contrast: Double, saturation: Double, hue: Double): ColorMatrix = js.native 112 | def toArray(): js.Array[Double] = js.native 113 | override def toString(): String = js.native 114 | } 115 | 116 | @js.native 117 | @JSName("createjs.ColorMatrixFilter") 118 | class ColorMatrixFilter protected () extends Filter { 119 | def this(matrix: js.Array[Double]) = this() 120 | def this(matrix: ColorMatrix) = this() 121 | var matrix: js.Array[Double] = js.native // TODO or ColorMatrix 122 | override def clone(): ColorMatrixFilter = js.native 123 | } 124 | 125 | @js.native 126 | @JSName("createjs.Container") 127 | class Container extends DisplayObject { 128 | var children: js.Array[DisplayObject] = js.native 129 | var mouseChildren: Boolean = js.native 130 | var numChildren: Double = js.native 131 | var tickChildren: Boolean = js.native 132 | def addChild(child: DisplayObject*): DisplayObject = js.native 133 | def addChildAt(child: DisplayObject, index: Double): DisplayObject = js.native 134 | def addChildAt(childOrIndex: js.Any*): DisplayObject = js.native 135 | def clone(recursive: Boolean = ???): Container = js.native 136 | def contains(child: DisplayObject): Boolean = js.native 137 | def getChildAt(index: Double): DisplayObject = js.native 138 | def getChildByName(name: String): DisplayObject = js.native 139 | def getChildIndex(child: DisplayObject): Double = js.native 140 | def getNumChildren(): Double = js.native 141 | def getObjectsUnderPoint(x: Double, y: Double, mode: Double): js.Array[DisplayObject] = js.native 142 | def getObjectUnderPoint(x: Double, y: Double, mode: Double): DisplayObject = js.native 143 | def removeAllChildren(): Unit = js.native 144 | def removeChild(child: DisplayObject*): Boolean = js.native 145 | def removeChildAt(index: Double*): Boolean = js.native 146 | def setChildIndex(child: DisplayObject, index: Double): Unit = js.native 147 | def sortChildren(sortFunction: js.Function2[DisplayObject, DisplayObject, Double]): Unit = js.native 148 | def swapChildren(child1: DisplayObject, child2: DisplayObject): Unit = js.native 149 | def swapChildrenAt(index1: Double, index2: Double): Unit = js.native 150 | } 151 | 152 | @js.native 153 | @JSName("createjs.DisplayObject") 154 | class DisplayObject extends EventDispatcher { 155 | var alpha: Double = js.native 156 | var cacheCanvas: HTMLCanvasElement = js.native // TODO or Object 157 | var cacheID: Double = js.native 158 | var compositeOperation: String = js.native 159 | var cursor: String = js.native 160 | var filters: js.Array[Filter] = js.native 161 | var hitArea: DisplayObject = js.native 162 | var id: Double = js.native 163 | var mask: Shape = js.native 164 | var mouseEnabled: Boolean = js.native 165 | var name: String = js.native 166 | var parent: Container = js.native 167 | var regX: Double = js.native 168 | var regY: Double = js.native 169 | var rotation: Double = js.native 170 | var scaleX: Double = js.native 171 | var scaleY: Double = js.native 172 | var shadow: Shadow = js.native 173 | var skewX: Double = js.native 174 | var skewY: Double = js.native 175 | var snapToPixel: Boolean = js.native 176 | var stage: Stage = js.native 177 | var tickEnabled: Boolean = js.native 178 | var transformMatrix: Matrix2D = js.native 179 | var visible: Boolean = js.native 180 | var x: Double = js.native 181 | var y: Double = js.native 182 | def cache(x: Double, y: Double, width: Double, height: Double, scale: Double = ???): Unit = js.native 183 | override def clone(): DisplayObject = js.native 184 | def draw(ctx: CanvasRenderingContext2D, ignoreCache: Boolean = ???): Boolean = js.native 185 | def getBounds(): Rectangle = js.native 186 | def getCacheDataURL(): String = js.native 187 | def getConcatenatedDisplayProps(props: DisplayProps = ???): DisplayProps = js.native 188 | def getConcatenatedMatrix(mtx: Matrix2D = ???): Matrix2D = js.native 189 | def getMatrix(matrix: Matrix2D = ???): Matrix2D = js.native 190 | def getStage(): Stage = js.native 191 | def getTransformedBounds(): Rectangle = js.native 192 | def globalToLocal(x: Double, y: Double, pt: Point = ???): Point = js.native 193 | def hitTest(x: Double, y: Double): Boolean = js.native 194 | def isVisible(): Boolean = js.native 195 | def localToGlobal(x: Double, y: Double, pt: Point = ???): Point = js.native 196 | def localToLocal(x: Double, y: Double, target: DisplayObject, pt: Point = ???): Point = js.native 197 | def set(props: AnyRef): DisplayObject = js.native 198 | def setBounds(x: Double, y: Double, width: Double, height: Double): Unit = js.native 199 | def setTransform(x: Double = ???, y: Double = ???, scaleX: Double = ???, scaleY: Double = ???, rotation: Double = ???, skewX: Double = ???, skewY: Double = ???, regX: Double = ???, regY: Double = ???): DisplayObject = js.native 200 | def uncache(): Unit = js.native 201 | def updateCache(compositeOperation: String = ???): Unit = js.native 202 | def updateContext(ctx: CanvasRenderingContext2D): Unit = js.native 203 | } 204 | 205 | @js.native 206 | @JSName("createjs.DisplayObject") 207 | object DisplayObject extends js.Object { 208 | var suppressCrossDomainErrors: Boolean = js.native 209 | } 210 | 211 | @js.native 212 | @JSName("createjs.DisplayProps") 213 | class DisplayProps protected () extends js.Object { 214 | def this(visible: Double = ???, alpha: Double = ???, shadow: Double = ???, compositeOperation: Double = ???, matrix: Double = ???) = this() 215 | var alpha: Double = js.native 216 | var compositeOperation: String = js.native 217 | var matrix: Matrix2D = js.native 218 | var shadow: Shadow = js.native 219 | var visible: Boolean = js.native 220 | def append(visible: Boolean, alpha: Double, shadow: Shadow, compositeOperation: String, matrix: Matrix2D = ???): DisplayProps = js.native 221 | override def clone(): DisplayProps = js.native 222 | def identity(): DisplayProps = js.native 223 | def prepend(visible: Boolean, alpha: Double, shadow: Shadow, compositeOperation: String, matrix: Matrix2D = ???): DisplayProps = js.native 224 | def setValues(visible: Boolean = ???, alpha: Double = ???, shadow: Double = ???, compositeOperation: Double = ???, matrix: Double = ???): DisplayProps = js.native 225 | } 226 | 227 | @js.native 228 | @JSName("createjs.DOMElement") 229 | class DOMElement protected () extends DisplayObject { 230 | def this(htmlElement: HTMLElement) = this() 231 | var htmlElement: HTMLElement = js.native 232 | override def clone(): DisplayObject = js.native 233 | override def set(props: AnyRef): DOMElement = js.native 234 | override def setTransform(x: Double = ???, y: Double = ???, scaleX: Double = ???, scaleY: Double = ???, rotation: Double = ???, skewX: Double = ???, skewY: Double = ???, regX: Double = ???, regY: Double = ???): DOMElement = js.native 235 | } 236 | 237 | @js.native 238 | @JSName("createjs.EaselJS") 239 | class EaselJS extends js.Object { 240 | } 241 | 242 | @js.native 243 | @JSName("createjs.EaselJS") 244 | object EaselJS extends js.Object { 245 | var buildDate: String = js.native 246 | var version: String = js.native 247 | } 248 | 249 | @js.native 250 | @JSName("createjs.Filter") 251 | class Filter extends js.Object { 252 | def applyFilter(ctx: CanvasRenderingContext2D, x: Double, y: Double, width: Double, height: Double, targetCtx: CanvasRenderingContext2D = ???, targetX: Double = ???, targetY: Double = ???): Boolean = js.native 253 | override def clone(): Filter = js.native 254 | def getBounds(): Rectangle = js.native 255 | override def toString(): String = js.native 256 | } 257 | 258 | @js.native 259 | @JSName("createjs.Graphics") 260 | class Graphics extends js.Object { 261 | var command: Object = js.native 262 | var instructions: js.Array[AnyRef] = js.native 263 | def append(command: AnyRef, clean: Boolean = ???): Graphics = js.native 264 | def arc(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean): Graphics = js.native 265 | def arcTo(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Graphics = js.native 266 | def beginBitmapFill(image: AnyRef, repetition: String = ???, matrix: Matrix2D = ???): Graphics = js.native 267 | def beginBitmapStroke(image: AnyRef, repetition: String = ???): Graphics = js.native 268 | def beginFill(color: String): Graphics = js.native 269 | def beginLinearGradientFill(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Graphics = js.native 270 | def beginLinearGradientStroke(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Graphics = js.native 271 | def beginRadialGradientFill(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Graphics = js.native 272 | def beginRadialGradientStroke(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Graphics = js.native 273 | def beginStroke(color: String): Graphics = js.native 274 | def bezierCurveTo(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Graphics = js.native 275 | def clear(): Graphics = js.native 276 | override def clone(): Graphics = js.native 277 | def closePath(): Graphics = js.native 278 | def curveTo(cpx: Double, cpy: Double, x: Double, y: Double): Graphics = js.native 279 | def decodePath(str: String): Graphics = js.native 280 | def draw(ctx: CanvasRenderingContext2D): Unit = js.native 281 | def drawAsPath(ctx: CanvasRenderingContext2D): Unit = js.native 282 | def drawCircle(x: Double, y: Double, radius: Double): Graphics = js.native 283 | def drawEllipse(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 284 | def drawPolyStar(x: Double, y: Double, radius: Double, sides: Double, pointSize: Double, angle: Double): Graphics = js.native 285 | def drawRect(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 286 | def drawRoundRect(x: Double, y: Double, w: Double, h: Double, radius: Double): Graphics = js.native 287 | def drawRoundRectComplex(x: Double, y: Double, w: Double, h: Double, radiusTL: Double, radiusTR: Double, radiusBR: Double, radisBL: Double): Graphics = js.native 288 | def endFill(): Graphics = js.native 289 | def endStroke(): Graphics = js.native 290 | def getInstructions(): js.Array[AnyRef] = js.native 291 | def inject(callback: js.Function1[js.Any, Any], data: js.Any): Graphics = js.native 292 | def isEmpty(): Boolean = js.native 293 | def lineTo(x: Double, y: Double): Graphics = js.native 294 | def moveTo(x: Double, y: Double): Graphics = js.native 295 | def quadraticCurveTo(cpx: Double, cpy: Double, x: Double, y: Double): Graphics = js.native 296 | def rect(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 297 | def setStrokeStyle(thickness: Double, caps: String = ???, joints: String = ???, miterLimit: Double = ???, ignoreScale: Boolean = ???): Graphics = js.native 298 | def store(): Graphics = js.native 299 | override def toString(): String = js.native 300 | def unstore(): Graphics = js.native 301 | def a(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Boolean): Graphics = js.native 302 | def at(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double): Graphics = js.native 303 | def bf(image: AnyRef, repetition: String = ???, matrix: Matrix2D = ???): Graphics = js.native 304 | def bs(image: AnyRef, repetition: String = ???): Graphics = js.native 305 | def f(color: String): Graphics = js.native 306 | def lf(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Graphics = js.native 307 | def ls(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Graphics = js.native 308 | def rf(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Graphics = js.native 309 | def rs(colors: js.Array[String], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Graphics = js.native 310 | def s(color: String): Graphics = js.native 311 | def bt(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double): Graphics = js.native 312 | def c(): Graphics = js.native 313 | def cp(): Graphics = js.native 314 | def p(str: String): Graphics = js.native 315 | def dc(x: Double, y: Double, radius: Double): Graphics = js.native 316 | def de(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 317 | def dp(x: Double, y: Double, radius: Double, sides: Double, pointSize: Double, angle: Double): Graphics = js.native 318 | def dr(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 319 | def rr(x: Double, y: Double, w: Double, h: Double, radius: Double): Graphics = js.native 320 | def rc(x: Double, y: Double, w: Double, h: Double, radiusTL: Double, radiusTR: Double, radiusBR: Double, radisBL: Double): Graphics = js.native 321 | def ef(): Graphics = js.native 322 | def es(): Graphics = js.native 323 | def lt(x: Double, y: Double): Graphics = js.native 324 | def mt(x: Double, y: Double): Graphics = js.native 325 | def qt(cpx: Double, cpy: Double, x: Double, y: Double): Graphics = js.native 326 | def r(x: Double, y: Double, w: Double, h: Double): Graphics = js.native 327 | def ss(thickness: Double, caps: String = ???, joints: String = ???, miterLimit: Double = ???, ignoreScale: Boolean = ???): Graphics = js.native 328 | } 329 | 330 | @js.native 331 | @JSName("createjs.Graphics") 332 | object Graphics extends js.Object { 333 | var BASE_64: AnyRef = js.native 334 | //var beginCmd: Graphics.BeginPath = js.native 335 | var STROKE_CAPS_MAP: js.Array[String] = js.native 336 | var STROKE_JOINTS_MAP: js.Array[String] = js.native 337 | def getHSL(hue: Double, saturation: Double, lightness: Double, alpha: Double = ???): String = js.native 338 | def getRGB(r: Double, g: Double, b: Double, alpha: Double = ???): String = js.native 339 | } 340 | 341 | @js.native 342 | @JSName("createjs.Matrix2D") 343 | class Matrix2D protected () extends js.Object { 344 | def this(a: Double = ???, b: Double = ???, c: Double = ???, d: Double = ???, tx: Double = ???, ty: Double = ???) = this() 345 | var a: Double = js.native 346 | var b: Double = js.native 347 | var c: Double = js.native 348 | var d: Double = js.native 349 | var tx: Double = js.native 350 | var ty: Double = js.native 351 | def append(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double): Matrix2D = js.native 352 | def appendMatrix(matrix: Matrix2D): Matrix2D = js.native 353 | def appendTransform(x: Double, y: Double, scaleX: Double, scaleY: Double, rotation: Double, skewX: Double, skewY: Double, regX: Double = ???, regY: Double = ???): Matrix2D = js.native 354 | override def clone(): Matrix2D = js.native 355 | def copy(matrix: Matrix2D): Matrix2D = js.native 356 | def decompose(): js.Any = js.native 357 | def decompose(target: AnyRef): Matrix2D = js.native 358 | def equals(matrix: Matrix2D): Boolean = js.native 359 | def identity(): Matrix2D = js.native 360 | def invert(): Matrix2D = js.native 361 | def isIdentity(): Boolean = js.native 362 | def prepend(a: Double, b: Double, c: Double, d: Double, tx: Double, ty: Double): Matrix2D = js.native 363 | def prependMatrix(matrix: Matrix2D): Matrix2D = js.native 364 | def prependTransform(x: Double, y: Double, scaleX: Double, scaleY: Double, rotation: Double, skewX: Double, skewY: Double, regX: Double = ???, regY: Double = ???): Matrix2D = js.native 365 | def rotate(angle: Double): Matrix2D = js.native 366 | def scale(x: Double, y: Double): Matrix2D = js.native 367 | def setValues(a: Double = ???, b: Double = ???, c: Double = ???, d: Double = ???, tx: Double = ???, ty: Double = ???): Matrix2D = js.native 368 | def skew(skewX: Double, skewY: Double): Matrix2D = js.native 369 | override def toString(): String = js.native 370 | def transformPoint(x: Double, y: Double, pt: Point = ???): Point = js.native 371 | def translate(x: Double, y: Double): Matrix2D = js.native 372 | } 373 | 374 | @js.native 375 | @JSName("createjs.Matrix2D") 376 | object Matrix2D extends js.Object { 377 | var DEG_TO_RAD: Double = js.native 378 | var identity: Matrix2D = js.native 379 | } 380 | 381 | @js.native 382 | @JSName("createjs.MouseEvent") 383 | class MouseEvent protected () extends Event { 384 | def this(`type`: String, bubbles: Boolean, cancelable: Boolean, stageX: Double, stageY: Double, nativeEvent: NativeMouseEvent, pointerID: Double, primary: Boolean, rawX: Double, rawY: Double) = this() 385 | var isTouch: Boolean = js.native 386 | var localX: Double = js.native 387 | var localY: Double = js.native 388 | var nativeEvent: NativeMouseEvent = js.native 389 | var pointerID: Double = js.native 390 | var primary: Boolean = js.native 391 | var rawX: Double = js.native 392 | var rawY: Double = js.native 393 | var stageX: Double = js.native 394 | var stageY: Double = js.native 395 | override def clone(): MouseEvent = js.native 396 | def addEventListener(`type`: String, listener: js.Function1[AnyRef, Boolean], useCapture: Boolean = ???): js.Function = js.native 397 | //def addEventListener(`type`: String, listener: js.Any, useCapture: Boolean = ???): Object = js.native 398 | def dispatchEvent(eventObj: AnyRef, target: AnyRef = ???): Boolean = js.native 399 | def hasEventListener(`type`: String): Boolean = js.native 400 | def off(`type`: String, listener: js.Function1[AnyRef, Boolean], useCapture: Boolean = ???): Unit = js.native 401 | def on(`type`: String, listener: js.Function1[AnyRef, Boolean], scope: AnyRef = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): js.Function = js.native 402 | //def on(`type`: String, listener: js.Any, scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): Object = js.native 403 | def removeAllEventListeners(`type`: String = ???): Unit = js.native 404 | def removeEventListener(`type`: String, listener: js.Function1[AnyRef, Boolean], useCapture: Boolean = ???): Unit = js.native 405 | override def toString(): String = js.native 406 | def willTrigger(`type`: String): Boolean = js.native 407 | } 408 | 409 | @js.native 410 | @JSName("createjs.MovieClip") 411 | class MovieClip protected () extends Container { 412 | def this(mode: String = ???, startPosition: Double = ???, loop: Boolean = ???, labels: AnyRef = ???) = this() 413 | var actionsEnabled: Boolean = js.native 414 | var autoReset: Boolean = js.native 415 | var currentFrame: Double = js.native 416 | var currentLabel: String = js.native 417 | var frameBounds: js.Array[Rectangle] = js.native 418 | var framerate: Double = js.native 419 | var labels: js.Array[AnyRef] = js.native 420 | var loop: Boolean = js.native 421 | var mode: String = js.native 422 | var paused: Boolean = js.native 423 | var startPosition: Double = js.native 424 | var timeline: Timeline = js.native 425 | def advance(time: Double = ???): Unit = js.native 426 | override def clone(): MovieClip = js.native 427 | def getCurrentLabel(): String = js.native 428 | def getLabels(): js.Array[AnyRef] = js.native 429 | def gotoAndPlay(positionOrLabel: String | Double): Unit = js.native 430 | def gotoAndStop(positionOrLabel: String | Double): Unit = js.native 431 | def play(): Unit = js.native 432 | def stop(): Unit = js.native 433 | } 434 | 435 | @js.native 436 | @JSName("createjs.MovieClip") 437 | object MovieClip extends js.Object { 438 | var buildDate: String = js.native 439 | var INDEPENDENT: String = js.native 440 | var SINGLE_FRAME: String = js.native 441 | var SYNCHED: String = js.native 442 | var version: String = js.native 443 | } 444 | 445 | @js.native 446 | @JSName("createjs.MovieClipPlugin") 447 | class MovieClipPlugin extends js.Object { 448 | def tween(tween: Tween, prop: String, value: String, startValues: js.Array[js.Any], endValues: js.Array[js.Any], ratio: Double, wait: AnyRef, end: AnyRef): Unit = js.native 449 | } 450 | 451 | @js.native 452 | @JSName("createjs.Point") 453 | class Point protected () extends js.Object { 454 | def this(x: Double = ???, y: Double = ???) = this() 455 | var x: Double = js.native 456 | var y: Double = js.native 457 | override def clone(): Point = js.native 458 | def copy(point: Point): Point = js.native 459 | def setValues(x: Double = ???, y: Double = ???): Point = js.native 460 | override def toString(): String = js.native 461 | } 462 | 463 | @js.native 464 | @JSName("createjs.Rectangle") 465 | class Rectangle protected () extends js.Object { 466 | def this(x: Double = ???, y: Double = ???, width: Double = ???, height: Double = ???) = this() 467 | var height: Double = js.native 468 | var width: Double = js.native 469 | var x: Double = js.native 470 | var y: Double = js.native 471 | override def clone(): Rectangle = js.native 472 | def contains(x: Double, y: Double, width: Double = ???, height: Double = ???): Boolean = js.native 473 | def copy(rectangle: Rectangle): Rectangle = js.native 474 | def extend(x: Double, y: Double, width: Double = ???, height: Double = ???): Rectangle = js.native 475 | def intersection(rect: Rectangle): Rectangle = js.native 476 | def intersects(rect: Rectangle): Boolean = js.native 477 | def isEmpty(): Boolean = js.native 478 | def setValues(x: Double = ???, y: Double = ???, width: Double = ???, height: Double = ???): Rectangle = js.native 479 | override def toString(): String = js.native 480 | def union(rect: Rectangle): Rectangle = js.native 481 | } 482 | 483 | @js.native 484 | @JSName("createjs.Shadow") 485 | class Shadow protected () extends js.Object { 486 | def this(color: String, offsetX: Double, offsetY: Double, blur: Double) = this() 487 | var blur: Double = js.native 488 | var color: String = js.native 489 | var offsetX: Double = js.native 490 | var offsetY: Double = js.native 491 | override def clone(): Shadow = js.native 492 | override def toString(): String = js.native 493 | } 494 | 495 | @js.native 496 | @JSName("createjs.Shadow") 497 | object Shadow extends js.Object { 498 | var identity: Shadow = js.native 499 | } 500 | 501 | @js.native 502 | @JSName("createjs.Shape") 503 | class Shape protected () extends DisplayObject { 504 | def this(graphics: Graphics = ???) = this() 505 | var graphics: Graphics = js.native 506 | def clone(recursive: Boolean = ???): Shape = js.native 507 | override def set(props: AnyRef): Shape = js.native 508 | override def setTransform(x: Double = ???, y: Double = ???, scaleX: Double = ???, scaleY: Double = ???, rotation: Double = ???, skewX: Double = ???, skewY: Double = ???, regX: Double = ???, regY: Double = ???): Shape = js.native 509 | } 510 | 511 | @js.native 512 | @JSName("createjs.Sprite") 513 | class Sprite protected () extends DisplayObject { 514 | def this(spriteSheet: SpriteSheet, frameOrAnimation: String = ???) = this() 515 | var currentAnimation: String = js.native 516 | var currentAnimationFrame: Double = js.native 517 | var currentFrame: Double = js.native 518 | var framerate: Double = js.native 519 | var offset: Double = js.native 520 | var paused: Boolean = js.native 521 | var spriteSheet: SpriteSheet = js.native 522 | def advance(time: Double = ???): Unit = js.native 523 | override def clone(): Sprite = js.native 524 | override def getBounds(): Rectangle = js.native 525 | def gotoAndPlay(frameOrAnimation: String | Double): Unit = js.native 526 | def gotoAndStop(frameOrAnimation: String | Double): Unit = js.native 527 | def play(): Unit = js.native 528 | override def set(props: AnyRef): Sprite = js.native 529 | override def setTransform(x: Double = ???, y: Double = ???, scaleX: Double = ???, scaleY: Double = ???, rotation: Double = ???, skewX: Double = ???, skewY: Double = ???, regX: Double = ???, regY: Double = ???): Sprite = js.native 530 | def stop(): Unit = js.native 531 | } 532 | 533 | @js.native 534 | @JSName("createjs.SpriteContainer") 535 | class SpriteContainer protected () extends Container { 536 | def this(spriteSheet: SpriteSheet = ???) = this() 537 | var spriteSheet: SpriteSheet = js.native 538 | } 539 | 540 | @js.native 541 | trait SpriteSheetAnimation extends js.Object { 542 | var frames: js.Array[Double] = js.native 543 | var speed: Double = js.native 544 | var name: String = js.native 545 | var next: String = js.native 546 | } 547 | 548 | @js.native 549 | trait SpriteSheetFrame extends js.Object { 550 | var image: HTMLImageElement = js.native 551 | var rect: Rectangle = js.native 552 | } 553 | 554 | @js.native 555 | @JSName("createjs.SpriteSheet") 556 | class SpriteSheet protected () extends EventDispatcher { 557 | def this(data: AnyRef) = this() 558 | var animations: js.Array[String] = js.native 559 | var complete: Boolean = js.native 560 | var framerate: Double = js.native 561 | override def clone(): SpriteSheet = js.native 562 | def getAnimation(name: String): SpriteSheetAnimation = js.native 563 | def getAnimations(): js.Array[String] = js.native 564 | def getFrame(frameIndex: Double): SpriteSheetFrame = js.native 565 | def getFrameBounds(frameIndex: Double, rectangle: Rectangle = ???): Rectangle = js.native 566 | def getNumFrames(animation: String): Double = js.native 567 | } 568 | 569 | @js.native 570 | @JSName("createjs.SpriteSheetBuilder") 571 | class SpriteSheetBuilder extends EventDispatcher { 572 | var maxHeight: Double = js.native 573 | var maxWidth: Double = js.native 574 | var padding: Double = js.native 575 | var progress: Double = js.native 576 | var scale: Double = js.native 577 | var spriteSheet: SpriteSheet = js.native 578 | var timeSlice: Double = js.native 579 | def addAnimation(name: String, frames: js.Array[Double], next: String = ???, frequency: Double = ???): Unit = js.native 580 | def addFrame(source: DisplayObject, sourceRect: Rectangle = ???, scale: Double = ???, setupFunction: js.Function0[Any] = ???, setupData: AnyRef = ???): Double = js.native 581 | def addMovieClip(source: MovieClip, sourceRect: Rectangle = ???, scale: Double = ???, setupFunction: js.Function0[Any] = ???, setupData: AnyRef = ???, labelFunction: js.Function0[Any] = ???): Unit = js.native 582 | def build(): SpriteSheet = js.native 583 | def buildAsync(timeSlice: Double = ???): Unit = js.native 584 | //override def clone(): Unit = js.native 585 | def stopAsync(): Unit = js.native 586 | } 587 | 588 | @js.native 589 | @JSName("createjs.SpriteSheetUtils") 590 | class SpriteSheetUtils extends js.Object { 591 | } 592 | 593 | @js.native 594 | @JSName("createjs.SpriteSheetUtils") 595 | object SpriteSheetUtils extends js.Object { 596 | def addFlippedFrames(spriteSheet: SpriteSheet, horizontal: Boolean = ???, vertical: Boolean = ???, both: Boolean = ???): Unit = js.native 597 | def extractFrame(spriteSheet: SpriteSheet, frameOrAnimation: Double): HTMLImageElement = js.native 598 | def extractFrame(spriteSheet: SpriteSheet, frameOrAnimation: String): HTMLImageElement = js.native 599 | def mergeAlpha(rgbImage: HTMLImageElement, alphaImage: HTMLImageElement, canvas: HTMLCanvasElement = ???): HTMLCanvasElement = js.native 600 | } 601 | 602 | @js.native 603 | @JSName("createjs.SpriteStage") 604 | class SpriteStage protected () extends Stage { 605 | def this(canvas: HTMLCanvasElement, preserveDrawingBuffer: Boolean = ???, antialias: Boolean = ???) = this() 606 | //def this(canvas: String, preserveDrawingBuffer: Boolean = ???, antialias: Boolean = ???) = this() 607 | var isWebGL: Boolean = js.native 608 | def clearImageTexture(image: AnyRef): Unit = js.native 609 | def updateViewport(width: Double, height: Double): Unit = js.native 610 | } 611 | 612 | @js.native 613 | @JSName("createjs.SpriteStage") 614 | object SpriteStage extends js.Object { 615 | var INDICES_PER_BOX: Double = js.native 616 | var MAX_BOXES_POINTS_INCREMENT: Double = js.native 617 | var MAX_INDEX_SIZE: Double = js.native 618 | var NUM_VERTEX_PROPERTIES: Double = js.native 619 | var NUM_VERTEX_PROPERTIES_PER_BOX: Double = js.native 620 | var POINTS_PER_BOX: Double = js.native 621 | } 622 | 623 | @js.native 624 | @JSName("createjs.Stage") 625 | class Stage protected () extends Container { 626 | def this(canvas: HTMLCanvasElement) = this() 627 | def this(canvas: String) = this() 628 | var autoClear: Boolean = js.native 629 | var canvas: HTMLCanvasElement = js.native // TODO or String 630 | var drawRect: Rectangle = js.native 631 | var handleEvent: js.Function = js.native 632 | var mouseInBounds: Boolean = js.native 633 | var mouseMoveOutside: Boolean = js.native 634 | var mouseX: Double = js.native 635 | var mouseY: Double = js.native 636 | var nextStage: Stage = js.native 637 | var preventSelection: Boolean = js.native 638 | var snapToPixelEnabled: Boolean = js.native 639 | var tickOnUpdate: Boolean = js.native 640 | def clear(): Unit = js.native 641 | override def clone(): Stage = js.native 642 | def enableDOMEvents(enable: Boolean = ???): Unit = js.native 643 | def enableMouseOver(frequency: Double = ???): Unit = js.native 644 | def tick(props: AnyRef = ???): Unit = js.native 645 | def toDataURL(backgroundColor: String, mimeType: String): String = js.native 646 | def update(arg: js.Any*): Unit = js.native 647 | } 648 | 649 | @js.native 650 | @JSName("createjs.Text") 651 | class Text protected () extends DisplayObject { 652 | def this(text: String = ???, font: String = ???, color: String = ???) = this() 653 | var color: String = js.native 654 | var font: String = js.native 655 | var lineHeight: Double = js.native 656 | var lineWidth: Double = js.native 657 | var maxWidth: Double = js.native 658 | var outline: Double = js.native 659 | var text: String = js.native 660 | var textAlign: String = js.native 661 | var textBaseline: String = js.native 662 | override def clone(): Text = js.native 663 | def getMeasuredHeight(): Double = js.native 664 | def getMeasuredLineHeight(): Double = js.native 665 | def getMeasuredWidth(): Double = js.native 666 | def getMetrics(): AnyRef = js.native 667 | override def set(props: AnyRef): Text = js.native 668 | override def setTransform(x: Double = ???, y: Double = ???, scaleX: Double = ???, scaleY: Double = ???, rotation: Double = ???, skewX: Double = ???, skewY: Double = ???, regX: Double = ???, regY: Double = ???): Text = js.native 669 | } 670 | 671 | @js.native 672 | @JSName("createjs.Ticker") 673 | class Ticker extends js.Object { 674 | } 675 | 676 | @js.native 677 | @JSName("createjs.Ticker") 678 | object Ticker extends js.Object { 679 | var framerate: Double = js.native 680 | var interval: Double = js.native 681 | var maxDelta: Double = js.native 682 | var paused: Boolean = js.native 683 | var RAF: String = js.native 684 | var RAF_SYNCHED: String = js.native 685 | var TIMEOUT: String = js.native 686 | var timingMode: String = js.native 687 | var useRAF: Boolean = js.native 688 | def getEventTime(runTime: Boolean = ???): Double = js.native 689 | def getFPS(): Double = js.native 690 | def getInterval(): Double = js.native 691 | def getMeasuredFPS(ticks: Double = ???): Double = js.native 692 | def getMeasuredTickTime(ticks: Double = ???): Double = js.native 693 | def getPaused(): Boolean = js.native 694 | def getTicks(pauseable: Boolean = ???): Double = js.native 695 | def getTime(runTime: Boolean = ???): Double = js.native 696 | def init(): Unit = js.native 697 | def reset(): Unit = js.native 698 | def setFPS(value: Double): Unit = js.native 699 | def setInterval(interval: Double): Unit = js.native 700 | def setPaused(value: Boolean): Unit = js.native 701 | def addEventListener(`type`: String, listener: Stage, useCapture: Boolean = ???): Stage = js.native 702 | //def addEventListener(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): js.Function = js.native 703 | //def addEventListener(`type`: String, listener: js.Any, useCapture: Boolean = ???): Object = js.native 704 | def dispatchEvent(eventObj: AnyRef, target: AnyRef = ???): Boolean = js.native 705 | def hasEventListener(`type`: String): Boolean = js.native 706 | def off(`type`: String, listener: js.Function1[AnyRef, Boolean], useCapture: Boolean = ???): Unit = js.native 707 | //def on(`type`: String, listener: js.Function1[Object, Boolean], scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): js.Function = js.native 708 | //def on(`type`: String, listener: js.Any, scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): Object = js.native 709 | def removeAllEventListeners(`type`: String = ???): Unit = js.native 710 | def removeEventListener(`type`: String, listener: js.Function1[AnyRef, Boolean], useCapture: Boolean = ???): Unit = js.native 711 | override def toString(): String = js.native 712 | def willTrigger(`type`: String): Boolean = js.native 713 | } 714 | 715 | @js.native 716 | @JSName("createjs.TickerEvent") 717 | class TickerEvent extends js.Object { 718 | var target: AnyRef = js.native 719 | var `type`: String = js.native 720 | var paused: Boolean = js.native 721 | var delta: Double = js.native 722 | var time: Double = js.native 723 | var runTime: Double = js.native 724 | } 725 | 726 | @js.native 727 | @JSName("createjs.Touch") 728 | class Touch extends js.Object { 729 | } 730 | 731 | @js.native 732 | @JSName("createjs.Touch") 733 | object Touch extends js.Object { 734 | def disable(stage: Stage): Unit = js.native 735 | def enable(stage: Stage, singleTouch: Boolean = ???, allowDefault: Boolean = ???): Boolean = js.native 736 | def isSupported(): Boolean = js.native 737 | } 738 | 739 | @js.native 740 | @JSName("createjs.UID") 741 | class UID extends js.Object { 742 | } 743 | 744 | @js.native 745 | @JSName("createjs.UID") 746 | object UID extends js.Object { 747 | def get(): Double = js.native 748 | } 749 | 750 | @js.native 751 | @JSName("createjs.Graphics.Arc") 752 | class Arc protected () extends js.Object { 753 | def this(x: Double, y: Double, radius: Double, startAngle: Double, endAngle: Double, anticlockwise: Double) = this() 754 | var anticlockwise: Double = js.native 755 | var endAngle: Double = js.native 756 | var radius: Double = js.native 757 | var startAngle: Double = js.native 758 | var x: Double = js.native 759 | var y: Double = js.native 760 | } 761 | 762 | @js.native 763 | @JSName("createjs.Graphics.ArcTo") 764 | class ArcTo protected () extends js.Object { 765 | def this(x1: Double, y1: Double, x2: Double, y2: Double, radius: Double) = this() 766 | var x1: Double = js.native 767 | var y1: Double = js.native 768 | var x2: Double = js.native 769 | var y2: Double = js.native 770 | var radius: Double = js.native 771 | } 772 | 773 | @js.native 774 | @JSName("createjs.Graphics.BeginPath") 775 | class BeginPath extends js.Object { 776 | } 777 | 778 | @js.native 779 | @JSName("createjs.Graphics.BezierCurveTo") 780 | class BezierCurveTo protected () extends js.Object { 781 | def this(cp1x: Double, cp1y: Double, cp2x: Double, cp2y: Double, x: Double, y: Double) = this() 782 | var cp1x: Double = js.native 783 | var cp1y: Double = js.native 784 | var cp2x: Double = js.native 785 | var cp2y: Double = js.native 786 | var x: Double = js.native 787 | var y: Double = js.native 788 | } 789 | 790 | @js.native 791 | @JSName("createjs.Graphics.Circle") 792 | class Circle protected () extends js.Object { 793 | def this(x: Double, y: Double, radius: Double) = this() 794 | var x: Double = js.native 795 | var y: Double = js.native 796 | var radius: Double = js.native 797 | } 798 | 799 | @js.native 800 | @JSName("createjs.Graphics.ClosePath") 801 | class ClosePath extends js.Object { 802 | } 803 | 804 | @js.native 805 | @JSName("createjs.Graphics.Fill") 806 | class Fill protected () extends js.Object { 807 | def this(style: AnyRef, matrix: Matrix2D = ???) = this() 808 | var style: AnyRef = js.native 809 | var matrix: Matrix2D = js.native 810 | def bitmap(image: HTMLImageElement, repetition: String = ???): Fill = js.native 811 | def linearGradient(colors: js.Array[Double], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Fill = js.native 812 | def radialGradient(colors: js.Array[Double], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Fill = js.native 813 | } 814 | 815 | @js.native 816 | @JSName("createjs.Graphics.LineTo") 817 | class LineTo protected () extends js.Object { 818 | def this(x: Double, y: Double) = this() 819 | var x: Double = js.native 820 | var y: Double = js.native 821 | } 822 | 823 | @js.native 824 | @JSName("createjs.Graphics.MoveTo") 825 | class MoveTo protected () extends js.Object { 826 | def this(x: Double, y: Double) = this() 827 | var x: Double = js.native 828 | var y: Double = js.native 829 | } 830 | 831 | @js.native 832 | @JSName("createjs.Graphics.PolyStar") 833 | class PolyStar protected () extends js.Object { 834 | def this(x: Double, y: Double, radius: Double, sides: Double, pointSize: Double, angle: Double) = this() 835 | var angle: Double = js.native 836 | var pointSize: Double = js.native 837 | var radius: Double = js.native 838 | var sides: Double = js.native 839 | var x: Double = js.native 840 | var y: Double = js.native 841 | } 842 | 843 | @js.native 844 | @JSName("createjs.Graphics.QuadraticCurveTo") 845 | class QuadraticCurveTo protected () extends js.Object { 846 | def this(cpx: Double, cpy: Double, x: Double, y: Double) = this() 847 | var cpx: Double = js.native 848 | var cpy: Double = js.native 849 | var x: Double = js.native 850 | var y: Double = js.native 851 | } 852 | 853 | @js.native 854 | @JSName("createjs.Graphics.Rect") 855 | class Rect protected () extends js.Object { 856 | def this(x: Double, y: Double, w: Double, h: Double) = this() 857 | var x: Double = js.native 858 | var y: Double = js.native 859 | var w: Double = js.native 860 | var h: Double = js.native 861 | } 862 | 863 | @js.native 864 | @JSName("createjs.Graphics.RoundRect") 865 | class RoundRect protected () extends js.Object { 866 | def this(x: Double, y: Double, w: Double, h: Double, radiusTL: Double, radiusTR: Double, radiusBR: Double, radiusBL: Double) = this() 867 | var x: Double = js.native 868 | var y: Double = js.native 869 | var w: Double = js.native 870 | var h: Double = js.native 871 | var radiusTL: Double = js.native 872 | var radiusTR: Double = js.native 873 | var radiusBR: Double = js.native 874 | var radiusBL: Double = js.native 875 | } 876 | 877 | @js.native 878 | @JSName("createjs.Graphics.Stroke") 879 | class Stroke protected () extends js.Object { 880 | def this(style: AnyRef, ignoreScale: Boolean) = this() 881 | var style: AnyRef = js.native 882 | var ignoreScale: Boolean = js.native 883 | def bitmap(image: HTMLImageElement, repetition: String = ???): Stroke = js.native 884 | def linearGradient(colors: js.Array[Double], ratios: js.Array[Double], x0: Double, y0: Double, x1: Double, y1: Double): Stroke = js.native 885 | def radialGradient(colors: js.Array[Double], ratios: js.Array[Double], x0: Double, y0: Double, r0: Double, x1: Double, y1: Double, r1: Double): Stroke = js.native 886 | } 887 | 888 | @js.native 889 | @JSName("createjs.Graphics.StrokeStyle") 890 | class StrokeStyle protected () extends js.Object { 891 | def this(width: Double, caps: String, joints: Double, miterLimit: Double) = this() 892 | var caps: String = js.native 893 | var joints: String = js.native 894 | var miterLimit: Double = js.native 895 | var width: Double = js.native 896 | } 897 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/createjs/PreloadJS.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs.createjs 2 | 3 | import org.scalajs.dom.raw.HTMLAudioElement 4 | 5 | import scala.scalajs.js 6 | import js.annotation._ 7 | 8 | @js.native 9 | @JSName("createjs.AbstractLoader") 10 | class AbstractLoader extends EventDispatcher { 11 | var canceled: Boolean = js.native 12 | var GET: String = js.native 13 | var loaded: Boolean = js.native 14 | var POST: String = js.native 15 | var progress: Double = js.native 16 | var resultFormatter: js.Function0[Any] = js.native 17 | var `type`: String = js.native 18 | def cancel(): Unit = js.native 19 | def destroy(): Unit = js.native 20 | def getItem(value: String = ???): Object = js.native 21 | def getLoadedItems(): js.Array[Object] = js.native 22 | def getResult(value: js.Any = ???, rawResult: Boolean = ???): Object = js.native 23 | def getTag(): Object = js.native 24 | def load(): Unit = js.native 25 | def setTag(tag: Object): Unit = js.native 26 | override def toString(): String = js.native 27 | } 28 | 29 | @js.native 30 | @JSName("createjs.AbstractLoader") 31 | object AbstractLoader extends js.Object { 32 | var BINARY: String = js.native 33 | var CSS: String = js.native 34 | var IMAGE: String = js.native 35 | var JAVASCRIPT: String = js.native 36 | var JSON: String = js.native 37 | var JSONP: String = js.native 38 | var MANIFEST: String = js.native 39 | var SOUND: String = js.native 40 | var SPRITESHEET: String = js.native 41 | var SVG: String = js.native 42 | var TEXT: String = js.native 43 | var VIDEO: String = js.native 44 | var XML: String = js.native 45 | } 46 | 47 | @js.native 48 | @JSName("createjs.AbstractMediaLoader") 49 | class AbstractMediaLoader protected () extends js.Object { 50 | def this(loadItem: Object, preferXHR: Boolean, `type`: String) = this() 51 | } 52 | 53 | @js.native 54 | @JSName("createjs.AbstractRequest") 55 | class AbstractRequest protected () extends js.Object { 56 | def this(item: LoadItem) = this() 57 | def cancel(): Unit = js.native 58 | def destroy(): Unit = js.native 59 | def load(): Unit = js.native 60 | } 61 | 62 | @js.native 63 | @JSName("createjs.BinaryLoader") 64 | class BinaryLoader protected () extends js.Object { 65 | def this(loadItem: Object) = this() 66 | } 67 | 68 | @js.native 69 | @JSName("createjs.BinaryLoader") 70 | object BinaryLoader extends js.Object { 71 | def canLoadItem(item: Object): Boolean = js.native 72 | } 73 | 74 | @js.native 75 | @JSName("createjs.CSSLoader") 76 | class CSSLoader protected () extends js.Object { 77 | def this(loadItem: Object, preferXHR: Boolean) = this() 78 | def canLoadItem(item: Object): Boolean = js.native 79 | } 80 | 81 | //@JSName("createjs.DataUtils") 82 | //package object DataUtils extends js.Object { 83 | // def parseJSON(value: String): Object = js.native 84 | // def parseXML(text: String, `type`: String): XMLDocument = js.native 85 | //} 86 | 87 | @js.native 88 | @JSName("createjs.ErrorEvent") 89 | class ErrorEvent protected () extends js.Object { 90 | def this(title: String = ???, message: String = ???, data: Object = ???) = this() 91 | var data: Object = js.native 92 | var message: String = js.native 93 | var title: String = js.native 94 | } 95 | 96 | @js.native 97 | @JSName("createjs.ImageLoader") 98 | class ImageLoader protected () extends js.Object { 99 | def this(loadItem: Object, preferXHR: Boolean) = this() 100 | } 101 | 102 | @js.native 103 | @JSName("createjs.ImageLoader") 104 | object ImageLoader extends js.Object { 105 | def canLoadItem(item: Object): Boolean = js.native 106 | } 107 | 108 | @js.native 109 | @JSName("createjs.JavaScriptLoader") 110 | class JavaScriptLoader protected () extends js.Object { 111 | def this(loadItem: Object, preferXHR: Boolean) = this() 112 | } 113 | 114 | @js.native 115 | @JSName("createjs.JavaScriptLoader") 116 | object JavaScriptLoader extends js.Object { 117 | def canLoadItem(item: Object): Boolean = js.native 118 | } 119 | 120 | @js.native 121 | @JSName("createjs.JSONLoader") 122 | class JSONLoader protected () extends js.Object { 123 | def this(loadItem: Object) = this() 124 | } 125 | 126 | @js.native 127 | @JSName("createjs.JSONLoader") 128 | object JSONLoader extends js.Object { 129 | def canLoadItem(item: Object): Boolean = js.native 130 | } 131 | 132 | @js.native 133 | @JSName("createjs.JSONPLoader") 134 | class JSONPLoader protected () extends js.Object { 135 | def this(loadItem: Object) = this() 136 | } 137 | 138 | @js.native 139 | @JSName("createjs.JSONPLoader") 140 | object JSONPLoader extends js.Object { 141 | def canLoadItem(item: Object): Boolean = js.native 142 | } 143 | 144 | @js.native 145 | @JSName("createjs.LoadItem") 146 | class LoadItem extends js.Object { 147 | var callback: String = js.native 148 | var crossOrigin: Boolean = js.native 149 | var data: Object = js.native 150 | var headers: Object = js.native 151 | var id: String = js.native 152 | var loadTimeout: Double = js.native 153 | var maintainOrder: Boolean = js.native 154 | var method: String = js.native 155 | var mimeType: String = js.native 156 | var src: String = js.native 157 | var `type`: String = js.native 158 | var values: Object = js.native 159 | var withCredentials: Boolean = js.native 160 | def set(props: Object): LoadItem = js.native 161 | } 162 | 163 | @js.native 164 | @JSName("createjs.LoadItem") 165 | object LoadItem extends js.Object { 166 | def create(value: Object): Object = js.native 167 | } 168 | 169 | @js.native 170 | @JSName("createjs.LoadQueue") 171 | class LoadQueue protected () extends AbstractLoader { 172 | def this(preferXHR: Boolean = ???, basePath: String = ???, crossOrigin: String = ???) = this() 173 | var maintainScriptOrder: Boolean = js.native 174 | var next: LoadQueue = js.native 175 | var stopOnError: Boolean = js.native 176 | def close(): Unit = js.native 177 | def getItems(loaded: Boolean): js.Array[Object] = js.native 178 | def installPlugin(plugin: js.Function0[Any]): Unit = js.native 179 | def loadFile(file: Object, loadNow: Boolean = ???, basePath: String = ???): Unit = js.native 180 | def loadManifest(manifest: Object, loadNow: Boolean = ???, basePath: String = ???): Unit = js.native 181 | def registerLoader(loader: AbstractLoader): Unit = js.native 182 | def remove(idsOrUrls: String): Unit = js.native 183 | def removeAll(): Unit = js.native 184 | def reset(): Unit = js.native 185 | def setMaxConnections(value: Double): Unit = js.native 186 | def setPaused(value: Boolean): Unit = js.native 187 | def setPreferXHR(value: Boolean): Boolean = js.native 188 | def setUseXHR(value: Boolean): Unit = js.native 189 | def unregisterLoader(loader: AbstractLoader): Unit = js.native 190 | } 191 | 192 | @js.native 193 | @JSName("createjs.ManifestLoader") 194 | class ManifestLoader protected () extends js.Object { 195 | def this(loadItem: LoadItem) = this() 196 | } 197 | 198 | @js.native 199 | @JSName("createjs.ManifestLoader") 200 | object ManifestLoader extends js.Object { 201 | def canLoadItem(item: LoadItem): Boolean = js.native 202 | } 203 | 204 | @js.native 205 | @JSName("createjs.MediaTagRequest") 206 | class MediaTagRequest protected () extends js.Object { 207 | def this(loadItem: LoadItem, tag: HTMLAudioElement, srcAttribute: String) = this() 208 | } 209 | 210 | @js.native 211 | @JSName("createjs.PreloadJS") 212 | class PreloadJS extends js.Object { 213 | } 214 | 215 | @js.native 216 | @JSName("createjs.PreloadJS") 217 | object PreloadJS extends js.Object { 218 | var buildDate: String = js.native 219 | var version: String = js.native 220 | } 221 | 222 | @js.native 223 | @JSName("createjs.ProgressEvent") 224 | class ProgressEvent protected () extends js.Object { 225 | def this(loaded: Double, total: Double = ???) = this() 226 | var loaded: Double = js.native 227 | var progress: Double = js.native 228 | var total: Double = js.native 229 | override def clone(): ProgressEvent = js.native 230 | } 231 | 232 | @js.native 233 | @JSName("createjs.RequestUtils") 234 | class RequestUtils extends js.Object { 235 | } 236 | 237 | @js.native 238 | @JSName("createjs.RequestUtils") 239 | object RequestUtils extends js.Object { 240 | var ABSOLUTE_PATH: js.RegExp = js.native 241 | var EXTENSION_PATT: js.RegExp = js.native 242 | var RELATIVE_PATH: js.RegExp = js.native 243 | def buildPath(src: String, data: Object = ???): String = js.native 244 | def formatQueryString(data: Object, query: js.Array[Object] = ???): String = js.native 245 | def getTypeByExtension(extension: String): String = js.native 246 | def isAudioTag(item: Object): Boolean = js.native 247 | def isBinary(`type`: String): Boolean = js.native 248 | def isCrossDomain(item: Object): Boolean = js.native 249 | def isImageTag(item: Object): Boolean = js.native 250 | def isLocal(item: Object): Boolean = js.native 251 | def isText(`type`: String): Boolean = js.native 252 | def isVideoTag(item: Object): Boolean = js.native 253 | def parseURI(path: String): Object = js.native 254 | } 255 | 256 | @js.native 257 | @JSName("createjs.SoundLoader") 258 | class SoundLoader protected () extends js.Object { 259 | def this(loadItem: Object, preferXHR: Boolean) = this() 260 | } 261 | 262 | @js.native 263 | @JSName("createjs.SoundLoader") 264 | object SoundLoader extends js.Object { 265 | def canLoadItem(item: Object): Boolean = js.native 266 | } 267 | 268 | @js.native 269 | @JSName("createjs.SpriteSheetLoader") 270 | class SpriteSheetLoader protected () extends js.Object { 271 | def this(loadItem: Object) = this() 272 | } 273 | 274 | @js.native 275 | @JSName("createjs.SpriteSheetLoader") 276 | object SpriteSheetLoader extends js.Object { 277 | def canLoadItem(item: Object): Boolean = js.native 278 | } 279 | 280 | @js.native 281 | @JSName("createjs.SVGLoader") 282 | class SVGLoader protected () extends js.Object { 283 | def this(loadItem: Object, preferXHR: Boolean) = this() 284 | } 285 | 286 | @js.native 287 | @JSName("createjs.SVGLoader") 288 | object SVGLoader extends js.Object { 289 | def canLoadItem(item: Object): Boolean = js.native 290 | } 291 | 292 | @js.native 293 | @JSName("createjs.TagRequest") 294 | class TagRequest extends js.Object { 295 | } 296 | 297 | @js.native 298 | @JSName("createjs.TextLoader") 299 | class TextLoader protected () extends js.Object { 300 | def this(loadItem: Object) = this() 301 | } 302 | 303 | @js.native 304 | @JSName("createjs.TextLoader") 305 | object TextLoader extends js.Object { 306 | def canLoadItem(item: Object): Boolean = js.native 307 | } 308 | 309 | @js.native 310 | @JSName("createjs.VideoLoader") 311 | class VideoLoader protected () extends js.Object { 312 | def this(loadItem: Object, preferXHR: Boolean) = this() 313 | } 314 | 315 | @js.native 316 | @JSName("createjs.VideoLoader") 317 | object VideoLoader extends js.Object { 318 | def canLoadItem(item: Object): Boolean = js.native 319 | } 320 | 321 | @js.native 322 | @JSName("createjs.XHRRequest") 323 | class XHRRequest protected () extends AbstractLoader { 324 | def this(item: Object) = this() 325 | def getAllResponseHeaders(): String = js.native 326 | def getResponseHeader(header: String): String = js.native 327 | } 328 | 329 | @js.native 330 | @JSName("createjs.XMLLoader") 331 | class XMLLoader protected () extends js.Object { 332 | def this(loadItem: Object) = this() 333 | } 334 | 335 | @js.native 336 | @JSName("createjs.XMLLoader") 337 | object XMLLoader extends js.Object { 338 | def canLoadItem(item: Object): Boolean = js.native 339 | } 340 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/createjs/SoundJS.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs.createjs 2 | 3 | import scala.scalajs.js 4 | import js.annotation._ 5 | import org.scalajs.dom.raw._ 6 | 7 | @js.native 8 | @JSName("createjs.AbstractPlugin") 9 | class AbstractPlugin extends js.Object { 10 | def create(src: String, startTime: Double, duration: Double): AbstractSoundInstance = js.native 11 | def getVolume(): Double = js.native 12 | def isPreloadComplete(src: String): Boolean = js.native 13 | def isPreloadStarted(src: String): Boolean = js.native 14 | def isSupported(): Boolean = js.native 15 | def preload(loader: Object): Unit = js.native 16 | def register(loadItem: String, instances: Double): Object = js.native 17 | def removeAllSounds(src: String): Unit = js.native 18 | def removeSound(src: String): Unit = js.native 19 | def setMute(value: Boolean): Boolean = js.native 20 | def setVolume(value: Double): Boolean = js.native 21 | } 22 | 23 | @js.native 24 | @JSName("createjs.AbstractSoundInstance") 25 | class AbstractSoundInstance protected () extends EventDispatcher { 26 | def this(src: String, startTime: Double, duration: Double, playbackResource: Object) = this() 27 | var duration: Double = js.native 28 | var loop: Double = js.native 29 | var muted: Boolean = js.native 30 | var pan: Double = js.native 31 | var paused: Boolean = js.native 32 | var playbackResource: Object = js.native 33 | var playState: String = js.native 34 | var position: Double = js.native 35 | var src: String = js.native 36 | var uniqueId: String = js.native 37 | var volume: Double = js.native 38 | def destroy(): Unit = js.native 39 | def getDuration(): Double = js.native 40 | def getLoop(): Double = js.native 41 | def getMute(): Boolean = js.native 42 | def getPan(): Double = js.native 43 | def getPaused(): Boolean = js.native 44 | def getPosition(): Double = js.native 45 | def getVolume(): Double = js.native 46 | def play(interrupt: String = ???, delay: Double = ???, offset: Double = ???, loop: Double = ???, volume: Double = ???, pan: Double = ???): AbstractSoundInstance = js.native 47 | def setDuration(value: Double): AbstractSoundInstance = js.native 48 | def setLoop(value: Double): Unit = js.native 49 | def setMute(value: Boolean): AbstractSoundInstance = js.native 50 | def setPan(value: Double): AbstractSoundInstance = js.native 51 | def setPlayback(value: Object): AbstractSoundInstance = js.native 52 | def setPosition(value: Double): AbstractSoundInstance = js.native 53 | def setVolume(value: Double): AbstractSoundInstance = js.native 54 | def stop(): AbstractSoundInstance = js.native 55 | } 56 | 57 | @js.native 58 | @JSName("createjs.FlashAudioLoader") 59 | class FlashAudioLoader extends AbstractLoader { 60 | var flashId: String = js.native 61 | def setFlash(flash: Object): Unit = js.native 62 | } 63 | 64 | @js.native 65 | @JSName("createjs.FlashAudioPlugin") 66 | class FlashAudioPlugin extends AbstractPlugin { 67 | var flashReady: Boolean = js.native 68 | var showOutput: Boolean = js.native 69 | } 70 | 71 | @js.native 72 | @JSName("createjs.FlashAudioPlugin") 73 | object FlashAudioPlugin extends js.Object { 74 | var swfPath: String = js.native 75 | def isSupported(): Boolean = js.native 76 | } 77 | 78 | @js.native 79 | @JSName("createjs.FlashAudioSoundInstance") 80 | class FlashAudioSoundInstance protected () extends AbstractSoundInstance { 81 | def this(src: String, startTime: Double, duration: Double, playbackResource: Object) = this() 82 | } 83 | 84 | @js.native 85 | @JSName("createjs.FlashPlugin") 86 | class FlashPlugin extends js.Object { 87 | var flashReady: Boolean = js.native 88 | var showOutput: Boolean = js.native 89 | def create(src: String): AbstractSoundInstance = js.native 90 | def getVolume(): Double = js.native 91 | def isPreloadStarted(src: String): Boolean = js.native 92 | def preload(src: String, instance: Object): Unit = js.native 93 | def register(src: String, instances: Double): Object = js.native 94 | def removeAllSounds(): Unit = js.native 95 | def removeSound(src: String): Unit = js.native 96 | def setMute(value: Boolean): Boolean = js.native 97 | def setVolume(value: Double): Boolean = js.native 98 | } 99 | 100 | @js.native 101 | @JSName("createjs.FlashPlugin") 102 | object FlashPlugin extends js.Object { 103 | var buildDate: String = js.native 104 | var swfPath: String = js.native 105 | var version: String = js.native 106 | def isSupported(): Boolean = js.native 107 | } 108 | 109 | @js.native 110 | @JSName("createjs.HTMLAudioPlugin") 111 | class HTMLAudioPlugin extends AbstractPlugin { 112 | var defaultNumChannels: Double = js.native 113 | var enableIOS: Boolean = js.native 114 | } 115 | 116 | @js.native 117 | @JSName("createjs.HTMLAudioPlugin") 118 | object HTMLAudioPlugin extends js.Object { 119 | var MAX_INSTANCES: Double = js.native 120 | def isSupported(): Boolean = js.native 121 | } 122 | 123 | @js.native 124 | @JSName("createjs.HTMLAudioSoundInstance") 125 | class HTMLAudioSoundInstance protected () extends AbstractSoundInstance { 126 | def this(src: String, startTime: Double, duration: Double, playbackResource: Object) = this() 127 | } 128 | 129 | @js.native 130 | @JSName("createjs.HTMLAudioTagPool") 131 | class HTMLAudioTagPool extends js.Object { 132 | } 133 | 134 | @js.native 135 | @JSName("createjs.Sound") 136 | class Sound extends EventDispatcher { 137 | } 138 | 139 | @js.native 140 | @JSName("createjs.Sound") 141 | object Sound extends js.Object { 142 | var activePlugin: Object = js.native 143 | var alternateExtensions: js.Array[js.Any] = js.native 144 | var defaultInterruptBehavior: String = js.native 145 | var EXTENSION_MAP: Object = js.native 146 | var INTERRUPT_ANY: String = js.native 147 | var INTERRUPT_EARLY: String = js.native 148 | var INTERRUPT_LATE: String = js.native 149 | var INTERRUPT_NONE: String = js.native 150 | var PLAY_FAILED: String = js.native 151 | var PLAY_FINISHED: String = js.native 152 | var PLAY_INITED: String = js.native 153 | var PLAY_INTERRUPTED: String = js.native 154 | var PLAY_SUCCEEDED: String = js.native 155 | var SUPPORTED_EXTENSIONS: js.Array[String] = js.native 156 | def createInstance(src: String): AbstractSoundInstance = js.native 157 | def getCapabilities(): Object = js.native 158 | def getCapability(key: String): Double = js.native 159 | def getMute(): Boolean = js.native 160 | def getVolume(): Double = js.native 161 | def initializeDefaultPlugins(): Boolean = js.native 162 | def isReady(): Boolean = js.native 163 | def loadComplete(src: String): Boolean = js.native 164 | def play(src: String, interrupt: js.Any = ???, delay: Double = ???, offset: Double = ???, loop: Double = ???, volume: Double = ???, pan: Double = ???): AbstractSoundInstance = js.native 165 | def registerManifest(manifest: js.Array[Object], basePath: String): Object = js.native 166 | def registerPlugins(plugins: js.Array[js.Any]): Boolean = js.native 167 | def registerSound(src: String, id: String = ???, data: Double = ???, basePath: String = ???): Object = js.native 168 | def registerSounds(sounds: js.Array[Object], basePath: String = ???): js.Array[Object] = js.native 169 | def removeAllSounds(): Unit = js.native 170 | def removeManifest(manifest: js.Array[js.Any], basePath: String): Object = js.native 171 | def removeSound(src: String, basePath: String): Boolean = js.native 172 | def setMute(value: Boolean): Boolean = js.native 173 | def setVolume(value: Double): Unit = js.native 174 | def stop(): Unit = js.native 175 | def addEventListener(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): js.Function = js.native 176 | //def addEventListener(`type`: String, listener: js.Any, useCapture: Boolean = ???): Object = js.native 177 | def dispatchEvent(eventObj: Object, target: Object = ???): Boolean = js.native 178 | def hasEventListener(`type`: String): Boolean = js.native 179 | def off(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): Unit = js.native 180 | def on(`type`: String, listener: js.Function1[Object, Boolean], scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): js.Function = js.native 181 | //def on(`type`: String, listener: js.Any, scope: Object = ???, once: Boolean = ???, data: js.Any = ???, useCapture: Boolean = ???): Object = js.native 182 | def removeAllEventListeners(`type`: String = ???): Unit = js.native 183 | def removeEventListener(`type`: String, listener: js.Function1[Object, Boolean], useCapture: Boolean = ???): Unit = js.native 184 | override def toString(): String = js.native 185 | def willTrigger(`type`: String): Boolean = js.native 186 | } 187 | 188 | @js.native 189 | @JSName("createjs.SoundJS") 190 | class SoundJS extends js.Object { 191 | } 192 | 193 | @js.native 194 | @JSName("createjs.SoundJS") 195 | object SoundJS extends js.Object { 196 | var buildDate: String = js.native 197 | var version: String = js.native 198 | } 199 | 200 | @js.native 201 | @JSName("createjs.WebAudioLoader") 202 | class WebAudioLoader extends js.Object { 203 | } 204 | 205 | @js.native 206 | @JSName("createjs.WebAudioLoader") 207 | object WebAudioLoader extends js.Object { 208 | var context: AudioContext = js.native 209 | } 210 | 211 | @js.native 212 | @JSName("createjs.WebAudioPlugin") 213 | class WebAudioPlugin extends AbstractPlugin { 214 | var context: AudioContext = js.native 215 | var dynamicsCompressorNode: DynamicsCompressorNode = js.native 216 | var gainNode: GainNode = js.native 217 | } 218 | 219 | @js.native 220 | @JSName("createjs.WebAudioPlugin") 221 | object WebAudioPlugin extends js.Object { 222 | var context: AudioContext = js.native 223 | def isSupported(): Boolean = js.native 224 | def playEmptySound(): Unit = js.native 225 | } 226 | 227 | @js.native 228 | @JSName("createjs.WebAudioSoundInstance") 229 | class WebAudioSoundInstance protected () extends AbstractSoundInstance { 230 | def this(src: String, startTime: Double, duration: Double, playbackResource: Object) = this() 231 | var gainNode: GainNode = js.native 232 | var panNode: PannerNode = js.native 233 | var sourceNode: AudioNode = js.native 234 | } 235 | 236 | @js.native 237 | @JSName("createjs.WebAudioSoundInstance") 238 | object WebAudioSoundInstance extends js.Object { 239 | var context: AudioContext = js.native 240 | var destinationNode: AudioNode = js.native 241 | } 242 | -------------------------------------------------------------------------------- /src/main/scala/com/scalawarrior/scalajs/createjs/TweenJS.scala: -------------------------------------------------------------------------------- 1 | package com.scalawarrior.scalajs.createjs 2 | 3 | import scala.scalajs.js 4 | import js.`|` 5 | import js.annotation._ 6 | 7 | @js.native 8 | @JSName("createjs.CSSPlugin") 9 | class CSSPlugin extends js.Object { 10 | } 11 | 12 | @js.native 13 | @JSName("createjs.CSSPlugin") 14 | object CSSPlugin extends js.Object { 15 | var cssSuffixMap: Object = js.native 16 | def install(): Unit = js.native 17 | } 18 | 19 | @js.native 20 | @JSName("createjs.Ease") 21 | class Ease extends js.Object { 22 | } 23 | 24 | @js.native 25 | @JSName("createjs.Ease") 26 | object Ease extends js.Object { 27 | var backIn: js.Function1[Double, Double] = js.native 28 | var backInOut: js.Function1[Double, Double] = js.native 29 | var backOut: js.Function1[Double, Double] = js.native 30 | var bounceIn: js.Function1[Double, Double] = js.native 31 | var bounceInOut: js.Function1[Double, Double] = js.native 32 | var bounceOut: js.Function1[Double, Double] = js.native 33 | var circIn: js.Function1[Double, Double] = js.native 34 | var circInOut: js.Function1[Double, Double] = js.native 35 | var circOut: js.Function1[Double, Double] = js.native 36 | var cubicIn: js.Function1[Double, Double] = js.native 37 | var cubicInOut: js.Function1[Double, Double] = js.native 38 | var cubicOut: js.Function1[Double, Double] = js.native 39 | var elasticIn: js.Function1[Double, Double] = js.native 40 | var elasticInOut: js.Function1[Double, Double] = js.native 41 | var elasticOut: js.Function1[Double, Double] = js.native 42 | def get(amount: Double): js.Function1[Double, Double] = js.native 43 | def getBackIn(amount: Double): js.Function1[Double, Double] = js.native 44 | def getBackInOut(amount: Double): js.Function1[Double, Double] = js.native 45 | def getBackOut(amount: Double): js.Function1[Double, Double] = js.native 46 | def getElasticIn(amplitude: Double, period: Double): js.Function1[Double, Double] = js.native 47 | def getElasticInOut(amplitude: Double, period: Double): js.Function1[Double, Double] = js.native 48 | def getElasticOut(amplitude: Double, period: Double): js.Function1[Double, Double] = js.native 49 | def getPowIn(pow: Double): js.Function1[Double, Double] = js.native 50 | def getPowInOut(pow: Double): js.Function1[Double, Double] = js.native 51 | def getPowOut(pow: Double): js.Function1[Double, Double] = js.native 52 | var linear: js.Function1[Double, Double] = js.native 53 | var none: js.Function1[Double, Double] = js.native 54 | var quadIn: js.Function1[Double, Double] = js.native 55 | var quadInOut: js.Function1[Double, Double] = js.native 56 | var quadOut: js.Function1[Double, Double] = js.native 57 | var quartIn: js.Function1[Double, Double] = js.native 58 | var quartInOut: js.Function1[Double, Double] = js.native 59 | var quartOut: js.Function1[Double, Double] = js.native 60 | var quintIn: js.Function1[Double, Double] = js.native 61 | var quintInOut: js.Function1[Double, Double] = js.native 62 | var quintOut: js.Function1[Double, Double] = js.native 63 | var sineIn: js.Function1[Double, Double] = js.native 64 | var sineInOut: js.Function1[Double, Double] = js.native 65 | var sineOut: js.Function1[Double, Double] = js.native 66 | } 67 | 68 | @js.native 69 | @JSName("createjs.MotionGuidePlugin") 70 | class MotionGuidePlugin extends js.Object { 71 | } 72 | 73 | @js.native 74 | @JSName("createjs.MotionGuidePlugin") 75 | object MotionGuidePlugin extends js.Object { 76 | def install(): Object = js.native 77 | } 78 | 79 | @js.native 80 | @JSName("createjs.Timeline") 81 | class Timeline protected () extends EventDispatcher { 82 | def this(tweens: js.Array[Tween], labels: Object, props: Object) = this() 83 | var duration: Double = js.native 84 | var ignoreGlobalPause: Boolean = js.native 85 | var loop: Boolean = js.native 86 | var position: Object = js.native 87 | def addLabel(label: String, position: Double): Unit = js.native 88 | def addTween(tween: Tween*): Unit = js.native 89 | def getCurrentLabel(): String = js.native 90 | def getLabels(): js.Array[Object] = js.native 91 | def gotoAndPlay(positionOrLabel: String | Double): Unit = js.native 92 | def gotoAndStop(positionOrLabel: String | Double): Unit = js.native 93 | def removeTween(tween: Tween*): Unit = js.native 94 | def resolve(positionOrLabel: String | Double): Double = js.native 95 | def setLabels(o: Object): Unit = js.native 96 | def setPaused(value: Boolean): Unit = js.native 97 | def setPosition(value: Double, actionsMode: Double = ???): Boolean = js.native 98 | def tick(delta: Double): Unit = js.native 99 | def updateDuration(): Unit = js.native 100 | } 101 | 102 | @js.native 103 | @JSName("createjs.Tween") 104 | class Tween protected () extends EventDispatcher { 105 | def this(target: Object, props: Object = ???, pluginData: Object = ???) = this() 106 | var duration: Double = js.native 107 | var ignoreGlobalPause: Boolean = js.native 108 | var loop: Boolean = js.native 109 | var onChange: js.Function = js.native 110 | var passive: Boolean = js.native 111 | var pluginData: Object = js.native 112 | var position: Double = js.native 113 | var target: Object = js.native 114 | def call(callback: js.Function1[Tween, Any], params: js.Array[js.Any] = ???, scope: Object = ???): Tween = js.native 115 | def pause(tween: Tween): Tween = js.native 116 | def play(tween: Tween): Tween = js.native 117 | def set(props: Object, target: Object = ???): Tween = js.native 118 | def setPaused(value: Boolean): Tween = js.native 119 | def setPosition(value: Double, actionsMode: Double): Boolean = js.native 120 | def tick(delta: Double): Unit = js.native 121 | def to(props: Object, duration: Double = ???, ease: js.Function1[Double, Double] = ???): Tween = js.native 122 | def wait(duration: Double, passive: Boolean = ???): Tween = js.native 123 | } 124 | 125 | @js.native 126 | @JSName("createjs.Tween") 127 | object Tween extends js.Object { 128 | var IGNORE: Object = js.native 129 | var LOOP: Double = js.native 130 | var NONE: Double = js.native 131 | var REVERSE: Double = js.native 132 | def get(target: Object, props: Object = ???, pluginData: Object = ???, `override`: Boolean = ???): Tween = js.native 133 | def hasActiveTweens(target: Object = ???): Boolean = js.native 134 | def installPlugin(plugin: Object, properties: js.Array[js.Any]): Unit = js.native 135 | def removeAllTweens(): Unit = js.native 136 | def removeTweens(target: Object): Unit = js.native 137 | def tick(delta: Double, paused: Boolean): Unit = js.native 138 | } 139 | 140 | @js.native 141 | @JSName("createjs.TweenJS") 142 | class TweenJS extends js.Object { 143 | } 144 | 145 | @js.native 146 | @JSName("createjs.TweenJS") 147 | object TweenJS extends js.Object { 148 | var buildDate: String = js.native 149 | var version: String = js.native 150 | } 151 | --------------------------------------------------------------------------------