2048 icon indicating copy to clipboard operation
2048 copied to clipboard

Stage' can't be called in this context by implicit receiver in main.kt

Open jpolaczek opened this issue 3 years ago • 2 comments

i try to follow tutorial for building this game but when i get to using position function inside graphics block i get

fun <T : View> Stage.position(x: Double, y: Double): Stage' can't be called in this context by implicit receiver. Use the explicit one if necessary

i tried doing it with couple of different templates but still doesnt work

point of reference: https://github.com/RezMike/2048/blob/master/src/commonMain/kotlin/main.kt#L72

jpolaczek avatar Aug 28 '22 17:08 jpolaczek

I think it's related to a new korge version you have in your own project. I'm unfamiliar with the latest versions of korge, this project uses korge-gradle-plugin v2.4.1 (here). Regretfully, I can't help you with this problem since I haven't worked with korge since Sep 2021.

RezMike avatar Aug 28 '22 17:08 RezMike

You can simply reference explicitly it like this:

graphics {
  it.position(leftIndent, topIndent) // <===
}

JulienBe avatar Oct 29 '22 14:10 JulienBe