Testing out JmonkeyEngine to make a game in Scala with Akka Actors within a pure FP layer
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.

66 lines
1.9 KiB

  1. package wow.doge.mygame.launcher
  2. import scalafx.geometry.Insets
  3. import scalafx.geometry.Orientation
  4. import scalafx.geometry.Pos
  5. import scalafx.scene.Scene
  6. import scalafx.scene.control.Button
  7. import scalafx.scene.effect.DropShadow
  8. import scalafx.scene.layout.FlowPane
  9. import scalafx.scene.layout.HBox
  10. import scalafx.scene.layout.VBox
  11. import scalafx.scene.paint.Color._
  12. import scalafx.scene.paint._
  13. import scalafx.scene.text.Text
  14. object DefaultUI {
  15. def scene(
  16. // stage: Stage,
  17. launchButton: Button,
  18. exitButton: Button
  19. ) =
  20. new Scene {
  21. fill = Color.rgb(38, 38, 38)
  22. content = new VBox {
  23. children = Seq(
  24. new HBox {
  25. padding = Insets(50, 80, 50, 80)
  26. children = Seq(
  27. new Text {
  28. text = "JMonkeyEngine"
  29. style = "-fx-font: normal bold 50pt sans-serif"
  30. fill = new LinearGradient(endX = 0, stops = Stops(Red, DarkRed))
  31. },
  32. new Text {
  33. text = " Game"
  34. style = "-fx-font: italic bold 50pt sans-serif"
  35. fill = new LinearGradient(
  36. endX = 0,
  37. stops = Stops(White, DarkGray)
  38. )
  39. effect = new DropShadow {
  40. color = DarkGray
  41. radius = 15
  42. spread = 0.25
  43. }
  44. }
  45. )
  46. },
  47. new FlowPane {
  48. hgap = 10
  49. padding = Insets(50, 80, 50, 80)
  50. orientation = Orientation.Horizontal
  51. alignment = Pos.Center
  52. children = Seq(launchButton, exitButton)
  53. }
  54. )
  55. }
  56. // onMousePressed = (pressEvent) => {
  57. // onMouseDragged = (dragEvent) => {
  58. // stage.setX(dragEvent.getScreenX() - pressEvent.getSceneX())
  59. // stage.setY(dragEvent.getScreenY() - pressEvent.getSceneY())
  60. // }
  61. // }
  62. }
  63. }