Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

game of life text size #44

Merged
merged 3 commits into from
Nov 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.