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

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

Open
jpolaczek opened this issue Aug 28, 2022 · 2 comments
Open

Comments

@jpolaczek
Copy link

jpolaczek commented Aug 28, 2022

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

@RezMike
Copy link
Owner

RezMike commented Aug 28, 2022

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.

@JulienBe
Copy link

You can simply reference explicitly it like this:

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants