https://kotlinlang.org logo
Title
t

tobsef

06/14/2020, 7:16 PM
My UI components in the runJS are not visible. Sadly this prevents me from commit my game. It uses a client-server architecture with websockets, which I got only working on the Browser. So testing it on the JVM in a Singleplayer Demo mode works, but does't make sense for the gameplay.
JVM
Web
n

Nico

06/14/2020, 7:16 PM
@Deactivated User quickfix ? 🙂
t
d

Deactivated User

06/14/2020, 7:17 PM
is tehere a way to reproduce it easy?
t

tobsef

06/14/2020, 7:19 PM
Of course the game is still not finished, and don't have the time to investigate the technical problem. But you can see it with
runJS
on my project.
I also tried it with websockets disabled... but it's the same (
NetworkBridge#init
)
d

Deactivated User

06/14/2020, 7:28 PM
checking
n

Nico

06/14/2020, 7:30 PM
on mac the gui is not displayed on
runJvm
nor
nativeDebug
either
d

Deactivated User

06/14/2020, 7:36 PM
it seems to be a similar problem to the pong, since if you change the initial JVM window size to not be the same as the virtua lsize reproduces again. So it seems to be a matter to using width and height values that are not right. I think we should hide a little bit the width and height values other than the normal virtualWidth, virtualHeight. I'm checking the places where it is used, I'll make a PR once I fix it
n

Nico

06/14/2020, 7:38 PM
@tobse You can of course still commit your game when you include the sources. If necessary, we build it ourselves against a new KorGE version
d

Deactivated User

06/14/2020, 7:40 PM
in this case it seems to be the align* variants, not the width/height itself. Going to investigate
Fixed here: https://github.com/korlibs/korge/pull/215 going to make a release and you will just need to update version. No code changes required in your code
Will be fixed in:
1.13.3.0
Just triggered publishing. So it will be available in around 30 minutes
t

tobsef

06/15/2020, 10:17 PM
Thanks for the late night fix. It solved a most of the relative positioning problems. But not all... The faq-image was position to the center of the root view:
centerOn(rootView)
And all
onClick
events are still broken on JS. And the position of my magnifier changed on both, Jar & JS:
val actionSearch = image(res.uiActionSearch) {
    anchor(0.0, 1)
    alignLeftToRightOf(movePlayerUp, 5.0)
    alignBottomToTopOf(movePlayerRight, 5.0)

    onClick { sendUiEvent(Action.ActionSearch) }
r

RezMike

06/15/2020, 10:30 PM
@tobsef try to remove
anchor(...)
t

tobsef

06/16/2020, 12:42 PM
@RezMike Tanks... Ok it makes sense.. without
anchor
I can move my magnifier to the correct pos.
d

Deactivated User

06/16/2020, 12:45 PM
align* doesn't fully support anchoring right now