Skip to content

Commit

Permalink
Add release notes for v.0.2.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpsacha committed Nov 15, 2018
1 parent cf1c134 commit 7a17a98
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 6 deletions.
10 changes: 10 additions & 0 deletions notes/0.2.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
### ScalaFX-Extras Release v.0.2.1

Changes:

* Build is done now against ScalaFX 11

To post questions please use [ScalaFX Users Group][5] of [StackOverflow ScalaFX][6]

[5]: https://groups.google.com/forum/#!forum/scalafx-users
[6]: https://stackoverflow.com/questions/tagged/scalafx
32 changes: 29 additions & 3 deletions scalafx-extras/src/main/scala/org/scalafx/extras/pong/Paddle.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
/*
* Copyright (c) 2011-2018, ScalaFX Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the ScalaFX Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE SCALAFX PROJECT OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.scalafx.extras.pong

import scalafx.Includes._
import scalafx.beans.property.DoubleProperty
import scalafx.geometry.Bounds
import scalafx.scene.Cursor
import scalafx.scene.input.MouseEvent
import scalafx.scene.paint.Color
import scalafx.scene.shape.Rectangle

Expand All @@ -25,12 +51,12 @@ private[pong] class Paddle(val xPos: Int) {
fill = Color.LightBlue
cursor = Cursor.Hand
translateY <== positionY
onMousePressed = (me: MouseEvent) => {
onMousePressed = me => {
initPaddleTranslateY = rect.translateY()
dragAnchorY = me.sceneY
}

onMouseDragged = (me: MouseEvent) => {
onMouseDragged = me => {
val dragY = me.sceneY - dragAnchorY
positionY() = initPaddleTranslateY + dragY
}
Expand Down
33 changes: 30 additions & 3 deletions scalafx-extras/src/main/scala/org/scalafx/extras/pong/Pong.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
/*
* Copyright (c) 2011-2018, ScalaFX Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the ScalaFX Project nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE SCALAFX PROJECT OR ITS CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

package org.scalafx.extras.pong

import scalafx.Includes._
Expand All @@ -6,7 +33,7 @@ import scalafx.beans.property.BooleanProperty
import scalafx.event.ActionEvent
import scalafx.scene.Group
import scalafx.scene.control.Button
import scalafx.scene.input.{KeyCode, KeyEvent}
import scalafx.scene.input.KeyCode
import scalafx.scene.shape.Rectangle

import scala.language.postfixOps
Expand Down Expand Up @@ -64,14 +91,14 @@ class Pong {
startButton
)

onKeyPressed = (k: KeyEvent) => k.code match {
onKeyPressed = k => k.code match {
case KeyCode.L => rightPaddle.moveUp = true
case KeyCode.Comma => rightPaddle.moveDown = true
case KeyCode.A => leftPaddle.moveUp = true
case KeyCode.Z => leftPaddle.moveDown = true
case _ =>
}
onKeyReleased = (k: KeyEvent) => k.code match {
onKeyReleased = k => k.code match {
case KeyCode.L => rightPaddle.moveUp = false
case KeyCode.Comma => rightPaddle.moveDown = false
case KeyCode.A => leftPaddle.moveUp = false
Expand Down

0 comments on commit 7a17a98

Please sign in to comment.