Created
June 21, 2015 15:16
-
-
Save akouryy/dc3533601ccdb982bd75 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package udon | |
import scalafx.Includes._ | |
import scalafx.application.JFXApp | |
import scalafx.application.JFXApp.PrimaryStage | |
import scalafx.geometry.Insets | |
import scalafx.scene.Scene | |
import scalafx.scene.effect.DropShadow | |
import scalafx.scene.layout.HBox | |
import scalafx.scene.paint.Color | |
import scalafx.scene.paint.{LinearGradient, Stops} | |
import scalafx.scene.text.Text | |
object ScalaFXHelloWorld extends JFXApp { | |
stage = new PrimaryStage { | |
title = "udon" | |
scene = new Scene { | |
fill = Color.web("#F9D1D3") | |
content = new HBox { | |
padding = Insets(20) | |
style = "-fx-font-size: 100pt" | |
effect = new DropShadow { | |
color = Color.web("#fff9f9") | |
radius = 25 | |
spread = 0.25 | |
} | |
def title_text(s: String) = new Text { | |
text = s | |
/*fill = new LinearGradient( | |
endX = 0, | |
stops = Stops(...) | |
)*/ | |
fill <== when(hover) choose Color.web("#FFFFFF") otherwise Color.web("#753329") | |
stroke <== when(hover) choose Color.web("#753329") otherwise Color.web("#00000000") | |
strokeWidth = 5 | |
padding = Insets(10) | |
} | |
children = Seq( | |
title_text("U"), title_text("D"), title_text("O"), title_text("N") | |
) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment