Skip to content

Commit

Permalink
Merge pull request #44 from matejsemancik/feature/game-of-life-text-size
Browse files Browse the repository at this point in the history
game of life text size
  • Loading branch information
matejsemancik authored Nov 15, 2019
2 parents f130ea0 + 8a818de commit 069da3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/kotlin/dev/matsem/astral/Config.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dev.matsem.astral
object Config {

object Sketch {
const val DEFAULT_SELECTOR = 'o'
const val DEFAULT_SELECTOR = 'g'
}

object Color {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ import dev.matsem.astral.sketches.SketchLoader
import dev.matsem.astral.tools.audio.beatcounter.BeatCounter
import dev.matsem.astral.tools.audio.beatcounter.OnKick
import dev.matsem.astral.tools.automator.MidiAutomator
import dev.matsem.astral.tools.extensions.remap
import dev.matsem.astral.tools.extensions.resizeRatioAware
import dev.matsem.astral.tools.extensions.shorterDimension
import dev.matsem.astral.tools.extensions.translateCenter
import dev.matsem.astral.tools.extensions.*
import dev.matsem.astral.tools.galaxy.Galaxy
import org.koin.core.inject
import processing.core.PApplet.constrain
Expand Down Expand Up @@ -62,6 +59,7 @@ class GameOfLifeSketch : BaseSketch() {
private val outlineEnabledButton = galaxy.createToggleButton(channel = 11, cc = 12, defaultValue = true)

private val overlayButtons = galaxy.createButtonGroup(11, listOf(13, 14, 15, 16, 17, 18, 19, 20, 21), listOf())
private val overlaySizeSlider = galaxy.createPot(channel = 11, cc = 22, initialValue = 1f)

override fun onBecameActive() = with(sketch) {
rectMode(PConstants.CORNER)
Expand Down Expand Up @@ -131,7 +129,7 @@ class GameOfLifeSketch : BaseSketch() {
overlayText?.let { text ->
textFont(pixelFont)
textAlign(CENTER, CENTER)
textSize(24f)
textSize(overlaySizeSlider.rawValue.midiRange(12f, 24f))

// Text stroke hack
if (outlineEnabledButton.isPressed) {
Expand All @@ -148,8 +146,11 @@ class GameOfLifeSketch : BaseSketch() {
}

overlayImage?.let { image ->
pushMatrix()
translateCenter()
scale(overlaySizeSlider.rawValue.midiRange(0.8f, 1.4f))
image(image, -image.width / 2f, -image.height / 2f)
popMatrix()
}

endDraw()
Expand Down
Binary file modified touchosc/Astral.touchosc
Binary file not shown.

0 comments on commit 069da3b

Please sign in to comment.