Skip to content

Commit

Permalink
Create an IndigoOptions type for the plugin (#590)
Browse files Browse the repository at this point in the history
* Move existing build options into type, and refactor.

* Integrate the new IndigoOptions

* Improved IndigoOptions scaladoc
  • Loading branch information
davesmith00000 authored Aug 28, 2023
1 parent 24aa81d commit 5d985ca
Show file tree
Hide file tree
Showing 19 changed files with 480 additions and 306 deletions.
16 changes: 7 additions & 9 deletions demos/pirate/build.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import indigoplugin.ElectronInstall
import indigoplugin.IndigoOptions

Global / onChangedBuildSource := ReloadOnSourceChanges

Expand Down Expand Up @@ -26,14 +26,12 @@ lazy val pirate =
Test / scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.CommonJSModule) }
)
.settings( // Indigo specific settings
showCursor := true,
title := "The Cursed Pirate",
gameAssetsDirectory := "assets",
windowStartWidth := 1280,
windowStartHeight := 720,
disableFrameRateLimit := false,
electronInstall := ElectronInstall.Latest,
backgroundColor := "black",
indigoOptions :=
IndigoOptions.defaults
.withTitle("The Cursed Pirate")
.withWindowStartWidth(1280)
.withWindowStartHeight(720)
.withBackgroundColor("black"),
libraryDependencies ++= Seq(
"io.indigoengine" %%% "indigo-json-circe" % IndigoVersion.getVersion, // Needed for Aseprite & Tiled support
"io.indigoengine" %%% "indigo" % IndigoVersion.getVersion, // Important! :-)
Expand Down
16 changes: 7 additions & 9 deletions demos/snake/build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,18 @@ import mill.scalajslib.api._
import mill.scalalib.scalafmt._
import coursier.maven.MavenRepository

import $ivy.`io.indigoengine::mill-indigo:0.15.0-RC3`, millindigo._
import $ivy.`io.indigoengine::mill-indigo:0.15.0-RC4`, millindigo._

object snake extends ScalaJSModule with MillIndigo with ScalafmtModule {
def scalaVersion = "3.3.0"
def scalaJSVersion = "1.13.1"

val gameAssetsDirectory: os.Path = os.pwd / "assets"
val showCursor: Boolean = true
val title: String = "Snake - Made with Indigo"
val windowStartWidth: Int = 720
val windowStartHeight: Int = 516
val disableFrameRateLimit: Boolean = false
val electronInstall: ElectronInstall = ElectronInstall.Latest
val backgroundColor: String = "black"
val indigoOptions: IndigoOptions =
IndigoOptions.defaults
.withTitle("Snake - Made with Indigo")
.withWindowStartWidth(720)
.withWindowStartHeight(516)
.withBackgroundColor("black")

def buildGame() = T.command {
T {
Expand Down
Loading

0 comments on commit 5d985ca

Please sign in to comment.