You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.4 KiB

4 years ago
  1. package nova.monadic_sfx.ui
  2. import scalafx.geometry.Insets
  3. import scalafx.scene.Scene
  4. import scalafx.scene.effect.DropShadow
  5. import scalafx.scene.layout.HBox
  6. import scalafx.scene.paint.Color._
  7. import scalafx.scene.paint._
  8. import scalafx.scene.text.Text
  9. import monix.eval.Coeval
  10. class DefaultUI {
  11. val scene =
  12. new Scene {
  13. fill = Color.rgb(38, 38, 38)
  14. content = new HBox {
  15. padding = Insets(50, 80, 50, 80)
  16. children = Seq(
  17. new Text {
  18. text = "Scala"
  19. style = "-fx-font: normal bold 100pt sans-serif"
  20. fill = new LinearGradient(endX = 0, stops = Stops(Red, DarkRed))
  21. },
  22. new Text {
  23. text = "FX"
  24. style = "-fx-font: italic bold 100pt sans-serif"
  25. fill = new LinearGradient(
  26. endX = 0,
  27. stops = Stops(White, DarkGray)
  28. )
  29. effect = new DropShadow {
  30. color = DarkGray
  31. radius = 15
  32. spread = 0.25
  33. }
  34. }
  35. )
  36. }
  37. }
  38. // val program = Coeval
  39. // .suspend {
  40. // Coeval(println("hello")) >>
  41. // Coeval(println(Thread.currentThread().getName())) >>
  42. // Coeval {
  43. // stage = new PrimaryStage {
  44. // // initStyle(StageStyle.Unified)
  45. // title = "ScalaFX Hello World"
  46. // scene = scn
  47. // }
  48. // }
  49. // }
  50. }