Portable Game Window for Kotlin for JVM, Android and HTML5

Related tags

App korgw
Overview

Korio

Korui

With Korui you can create your UI once, and run it in HTML5, Java AWT and Android.

Build Status Maven Version Discord

Support korgw

If you like korgw, or want your company logo here, please consider becoming a sponsor ★,
in addition to ensure the continuity of the project, you will get exclusive content.

All KOR libraries

KORIO - KORIM - KORUI

Use with gradle:

compile "com.soywiz:korui:$korVersion"

Online Example:

https://soywiz.github.io/korio_samples/korui1/index.html

HTML test:

npm -g install http-server
./gradlew distJs
cd korui-jtransc-example/build/jtransc-js
http-server
open http://127.0.0.1:8080
Comments
  • Problem with uiComboBox one above the other

    Problem with uiComboBox one above the other

    Good day,

    I stumble on a couple of problem where when two combo box are place one above the other. For instance:

    image

    1. When opening the top combo box, the bottom one shows over the items:

    image

    1. It's not possible to click on any items from the first combo box that are below the second combo box.

    2. Not sure if that's a bug or by design, but both combo box can be opened at the same time.

    Here's minimal code to demonstrate the behaviour:

    import com.soywiz.korge.Korge
    import com.soywiz.korge.ui.uiComboBox
    import com.soywiz.korim.color.Colors
    
    suspend fun main() = Korge(width = 512, height = 512, bgcolor = Colors["#2b2b2b"]) {
    	val cb1 = uiComboBox(items = listOf("A", "B", "C", "D", "E")) {
    		x = 20.0
    		y = 20.0
    	}
    
    	val cb2 = uiComboBox(items = listOf("A", "B", "C", "D", "E")) {
    		x = 20.0
    		y = 60.0
    	}
    }
    

    Thanks,

    J-F

    enhancement check 
    opened by jfbilodeau 5
  • Add proper support for fullscreen on Android

    Add proper support for fullscreen on Android

    Added flags to hide navigation and status bars. If system popups appear it will now rehide the bars after it is closed. Also switching between fullscreen modes yields right results. Default mode is fullscreen because it is true by default in korge gradle extension.

    opened by arnis71 3
  • KorgwView provided by Pablo Caviglia

    KorgwView provided by Pablo Caviglia

    Somehow on this computer I don't get autocompletion for the Android part, so it is pretty hard to work like that. I'm creating a WIP PR so I don't forget to finish this

    opened by soywiz 2
  • gradle 5

    gradle 5

    will you be upgrading to gradle 5 ?

    I'm getting "Unsupported format version '0.3' specified in module metadata. This version of Gradle supports format version 0.4 only."

    opened by dhakehurst 2
  • KorGW Documentation

    KorGW Documentation

    Hi all,

    Is there a plan to release documentation for KorGW? I am looking for information on how to use KorGW with conventional Android classes.

    Please advise.

    Thanks in advance, rey malahay

    opened by reymalahay 1
  • Error Compiling Shader: invalid token

    Error Compiling Shader: invalid token "compatibility" in version line

    After Upgrading from Korge 1.10.0.0 to 1.12.0.2 my HitKlack Game doesn't start anymore. https://github.com/TobseF/HitKlack/tree/UpgradeKorge Platform: runJVM

    Error Compiling Shader: invalid token "compatibility" in version line

    Stacktrace

    Initial window size: 800, 1440
    GL_VERSION: 4.6.0 NVIDIA 432.00
    GL_VENDOR: NVIDIA Corporation
    HELLO 3840, 2160 : native@0x17b10e0, 0
    OpenglAG: Created program BatchBuilder2D.Premultiplied.Tinted with id 1 because contextVersion: -1 != 0
    OpenglAG: Created program BatchBuilder2D.NoPremultiplied.Tinted with id 3 because contextVersion: -1 != 0
    java.lang.RuntimeException: Error Compiling Shader : 0 : '0(1) : error C0206: invalid token "compatibility" in version line
    ' : source='#version 100 compatibility
    #ifdef GL_ES
    	precision mediump float;
    	precision mediump int;
    	precision lowp sampler2D;
    	precision lowp samplerCube;
    #endif
    uniform sampler2D u_Tex;
    varying vec2 v_Tex;
    varying vec4 v_Col;
    varying vec4 v_Col2;
    void main() {
    	gl_FragColor = texture2D(u_Tex, v_Tex.xy);
    	gl_FragColor.rgb = (gl_FragColor.rgb / gl_FragColor.a);
    	gl_FragColor = ((gl_FragColor.rgba * v_Col.rgba) + ((v_Col2.rgba - vec4(0.5, 0.5, 0.5, 0.5)) * 2.0));
    	if ((gl_FragColor.a <= 0.0)) {
    		discard;
    	}
    }
    ', gl.versionInt=100, gl.versionString='4.60 NVIDIA', gl=com.soywiz.korgw.win32.Win32KmlGl@47a86fbb
    	at com.soywiz.korag.AGOpengl$GlProgram.createShader(OpenglAG.kt:480)
    	at com.soywiz.korag.AGOpengl$GlProgram.ensure(OpenglAG.kt:456)
    	at com.soywiz.korag.AGOpengl$GlProgram.use(OpenglAG.kt:486)
    	at com.soywiz.korag.AGOpengl.draw(OpenglAG.kt:192)
    	at com.soywiz.korag.AG.draw(AG.kt:509)
    	at com.soywiz.korag.AG.draw$default(AG.kt:508)
    	at com.soywiz.korge.render.BatchBuilder2D.flush(BatchBuilder2D.kt:518)
    	at com.soywiz.korge.render.BatchBuilder2D.setStateFast(BatchBuilder2D.kt:247)
    	at com.soywiz.korge.render.BatchBuilder2D.setStateFast(BatchBuilder2D.kt:240)
    	at com.soywiz.korge.render.BatchBuilder2D.drawVertices(BatchBuilder2D.kt:223)
    	at com.soywiz.korge.render.BatchBuilder2D.drawVertices$default(BatchBuilder2D.kt:222)
    	at com.soywiz.korge.view.RectBase.renderInternal(RectBase.kt:48)
    	at com.soywiz.korge.view.Graphics.renderInternal(Graphics.kt:229)
    	at com.soywiz.korge.view.View.render(View.kt:635)
    	at com.soywiz.korge.view.Container.renderInternal(Container.kt:201)
    	at com.soywiz.korge.view.Stage.renderInternal(Stage.kt:23)
    	at com.soywiz.korge.view.View.render(View.kt:635)
    	at com.soywiz.korge.view.Views.render(Views.kt:203)
    	at com.soywiz.korge.view.Views.frameUpdateAndRender-_rozLdE(Views.kt:230)
    	at com.soywiz.korge.Korge$prepareViews$21.invoke(Korge.kt:366)
    	at com.soywiz.korge.Korge$prepareViews$21.invoke(Korge.kt:34)
    	at com.soywiz.korev.EventDispatcher$Mixin.dispatch(EventDispatcher.kt:50)
    	at com.soywiz.korgw.GameWindow.dispatchRenderEvent(GameWindow.kt:450)
    	at com.soywiz.korgw.GameWindow.frameRender(GameWindow.kt:223)
    	at com.soywiz.korgw.GameWindow.frame(GameWindow.kt:215)
    	at com.soywiz.korgw.GameWindow.frame$default(GameWindow.kt:214)
    	at com.soywiz.korgw.win32.Win32GameWindow$windProc$1.callback(Win32GameWindow.kt:316)
    	at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
    	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)
    	at com.sun.jna.Native.invokeLong(Native Method)
    	at com.sun.jna.Function.invoke(Function.java:428)
    	at com.sun.jna.Function.invoke(Function.java:361)
    	at com.sun.jna.Library$Handler.invoke(Library.java:265)
    	at com.sun.proxy.$Proxy2.DispatchMessage(Unknown Source)
    	at com.soywiz.korgw.win32.MyUser32$Companion.DispatchMessage(Win32.kt)
    	at com.soywiz.korgw.win32.Win32.DispatchMessage(Win32.kt)
    	at com.soywiz.korgw.win32.Win32GameWindow.loop(Win32GameWindow.kt:497)
    	at com.soywiz.korge.Korge.KoruiWithLogger(Korge.kt:396)
    	at com.soywiz.korge.Korge.invoke-nom0QHw(Korge.kt:421)
    	at com.soywiz.korge.Korge.invoke-nom0QHw$default(Korge.kt:419)
    	at MainKt.main(main.kt:10)
    	at MainKt$$$main.invoke(Unknown Source)
    	at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:199)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:114)
    	at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
    	at MainKt.main(main.kt)
    java.lang.RuntimeException: Error Compiling Shader : 1282 : '0(1) : error C0206: invalid token "compatibility" in version line
    ' : source='#version 100 compatibility
    #ifdef GL_ES
    	precision mediump float;
    	precision mediump int;
    	precision lowp sampler2D;
    	precision lowp samplerCube;
    #endif
    uniform sampler2D u_Tex;
    varying vec2 v_Tex;
    varying vec4 v_Col;
    varying vec4 v_Col2;
    void main() {
    	gl_FragColor = texture2D(u_Tex, v_Tex.xy);
    	gl_FragColor = ((gl_FragColor.rgba * v_Col.rgba) + ((v_Col2.rgba - vec4(0.5, 0.5, 0.5, 0.5)) * 2.0));
    }
    ', gl.versionInt=100, gl.versionString='4.60 NVIDIA', gl=com.soywiz.korgw.win32.Win32KmlGl@47a86fbb
    	at com.soywiz.korag.AGOpengl$GlProgram.createShader(OpenglAG.kt:480)
    	at com.soywiz.korag.AGOpengl$GlProgram.ensure(OpenglAG.kt:456)
    	at com.soywiz.korag.AGOpengl$GlProgram.use(OpenglAG.kt:486)
    	at com.soywiz.korag.AGOpengl.draw(OpenglAG.kt:192)
    	at com.soywiz.korag.AG.draw(AG.kt:509)
    	at com.soywiz.korag.AG.draw$default(AG.kt:508)
    	at com.soywiz.korge.render.BatchBuilder2D.flush(BatchBuilder2D.kt:518)
    	at com.soywiz.korge.render.BatchBuilder2D.setStateFast(BatchBuilder2D.kt:247)
    	at com.soywiz.korge.render.BatchBuilder2D.setStateFast(BatchBuilder2D.kt:240)
    	at com.soywiz.korge.render.BatchBuilder2D.drawQuad-AUDDen0(BatchBuilder2D.kt:385)
    	at com.soywiz.korge.render.BatchBuilder2D.drawQuad-AUDDen0$default(BatchBuilder2D.kt:378)
    	at com.soywiz.korge.bitmapfont.BitmapFontExtKt.drawText-7Cvc0dA(BitmapFontExt.kt:66)
    	at com.soywiz.korge.view.Text.renderInternal(Text.kt:137)
    	at com.soywiz.korge.view.View.render(View.kt:635)
    	at com.soywiz.korge.view.Container.renderInternal(Container.kt:201)
    	at com.soywiz.korge.view.RectBase.renderInternal(RectBase.kt:50)
    	at com.soywiz.korge.view.Graphics.renderInternal(Graphics.kt:229)
    	at com.soywiz.korge.view.View.render(View.kt:635)
    	at com.soywiz.korge.view.Container.renderInternal(Container.kt:201)
    	at com.soywiz.korge.view.Stage.renderInternal(Stage.kt:23)
    	at com.soywiz.korge.view.View.render(View.kt:635)
    	at com.soywiz.korge.view.Views.render(Views.kt:203)
    	at com.soywiz.korge.view.Views.frameUpdateAndRender-_rozLdE(Views.kt:230)
    	at com.soywiz.korge.Korge$prepareViews$21.invoke(Korge.kt:366)
    	at com.soywiz.korge.Korge$prepareViews$21.invoke(Korge.kt:34)
    	at com.soywiz.korev.EventDispatcher$Mixin.dispatch(EventDispatcher.kt:50)
    	at com.soywiz.korgw.GameWindow.dispatchRenderEvent(GameWindow.kt:450)
    	at com.soywiz.korgw.GameWindow.frameRender(GameWindow.kt:223)
    	at com.soywiz.korgw.GameWindow.frame(GameWindow.kt:215)
    	at com.soywiz.korgw.GameWindow.frame$default(GameWindow.kt:214)
    	at com.soywiz.korgw.win32.Win32GameWindow$windProc$1.callback(Win32GameWindow.kt:316)
    	at jdk.internal.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    	at com.sun.jna.CallbackReference$DefaultCallbackProxy.invokeCallback(CallbackReference.java:520)
    	at com.sun.jna.CallbackReference$DefaultCallbackProxy.callback(CallbackReference.java:551)
    	at com.sun.jna.Native.invokeLong(Native Method)
    	at com.sun.jna.Function.invoke(Function.java:428)
    	at com.sun.jna.Function.invoke(Function.java:361)
    	at com.sun.jna.Library$Handler.invoke(Library.java:265)
    	at com.sun.proxy.$Proxy2.DispatchMessage(Unknown Source)
    	at com.soywiz.korgw.win32.MyUser32$Companion.DispatchMessage(Win32.kt)
    	at com.soywiz.korgw.win32.Win32.DispatchMessage(Win32.kt)
    	at com.soywiz.korgw.win32.Win32GameWindow.loop(Win32GameWindow.kt:497)
    	at com.soywiz.korge.Korge.KoruiWithLogger(Korge.kt:396)
    	at com.soywiz.korge.Korge.invoke-nom0QHw(Korge.kt:421)
    	at com.soywiz.korge.Korge.invoke-nom0QHw$default(Korge.kt:419)
    	at MainKt.main(main.kt:10)
    	at MainKt$$$main.invoke(Unknown Source)
    	at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$1.invokeSuspend(IntrinsicsJvm.kt:199)
    	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    	at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:114)
    	at kotlin.coroutines.jvm.internal.RunSuspendKt.runSuspend(RunSuspend.kt:19)
    	at MainKt.main(main.kt)
    Korge gameWindow.loop completed
    
    
    bug 
    opened by TobseF 1
  • Delaying time

    Delaying time

    Consider using the current time as the time of the start of the frame for delaying stuff to have consistent results when doing animations. We should cover here the delayFrame function

    enhancement 
    opened by soywiz 0
  • Do not use gl_FragColor on newer versions of GLSL

    Do not use gl_FragColor on newer versions of GLSL

    Tries to fix: https://github.com/korlibs/korge/issues/104

    git clone https://github.com/korlibs/korgw.git
    cd korgw
    git checkout fix/not_using_gl_fragColor
    sed -i.bak 's/^version=.*/version=1.10.0/g' gradle.properties && rm gradle.properties.bak
    ./gradlew publishToMavenLocal
    #./gradlew publishJvmPublicationToMavenLocal
    
    bug 
    opened by soywiz 0
Releases(v2.2.2)
Owner
Kotlin cORoutine Libraries for fullstack development - https://bintray.com/korlibs/korlibs - https://github.com/korlibs
null
androidx window manager sample taken from the original source and modified for easy deploy and test

androidx-window-samples This project contains the WindowManager samples located in the androidx WM project location The goal of this project is to pro

Cesar Valiente 0 Nov 22, 2021
Android samples built using Jetpack Window Manager for foldable and dual-screen devices like Microsoft Surface Duo.

Jetpack Window Manager samples for dual-screen and foldable devices like Microsoft Surface Duo Android app samples that use Jetpack Window Manager to

Microsoft 45 Dec 19, 2022
Cody Engel 2 Apr 20, 2022
잔여백신 조회 및 자동 예약 (Kotlin/JVM)

korea-covid-19-remaining-vaccine 파이썬 버전을 코틀린으로 포팅하고, 로직을 개선하여 성능을 향상시켰습니다. 사용 방법 여기를 참고하세요. 다운로드 실행 가능한 jar는 아래 링크에서 받을 수 있습니다. (GitHub Actions에서 빌드됨)

null 8 Jun 8, 2022
A Kotlin/JVM Project Template with Gradle

kotlin-project-template A Kotlin/JVM Project Template with Gradle. Clone or npx

cog25 0 Dec 23, 2021
A Kotlin/JVM based library for BitShares blockchain.

A Kotlin/JVM based library for BitShares blockchain. It implements most functions of BitShares Core including objects (de)serialization, transactions sign/broadcast, wallet create/restore, and more.

Husk 1 Apr 9, 2022
ArchGuard Scanner for scan Git change history, scan source code by Chapi for Java, TypeScript, Kotlin, Go..、Java bytecode use for JVM languages, scan Jacoco test coverage.

Arch Scanner Requirements: JDK 12 Scanner: scan_git - Git commit history scan scan_jacoco - Jacoco scan scan_bytecode - for JVM languages known issues

ArchGuard 27 Jul 28, 2022
Asynchronous Yandex.Predictor API wrapper for Kotlin/JVM.

Asynchronous Yandex.Predictor API wrapper for Kotlin/JVM.

Mikhail Titov 2 Jun 27, 2022
Romeo-and-juliet - A fun quote randomizer game for Romeo and Juliet

romeo-and-juliet A quote randomizer game for my English class. Input mappings fo

Subham 1 Jul 17, 2022
Bug Tablut is an artificial intelligence for the Tablut Game Competition written in Kotlin

Bug Tablut is an artificial intelligence for the Tablut Game Competition organized by the Foundations of Artificial Intelligence M AA 2021-2022 course at the Unibo. The project is written in Kotlin. The project realizes a player for an ancient Nordic strategy board game named "Tablut".

DaniDF 2 Jul 3, 2022
A manga series about a card game, written and illustrated by Kazuki Takahashi

Yu-Gi-Oh É uma série de mangá sobre um jogo de cartas, escrito e ilustrado por Kazuki Takahashi. A série foi originalmente publicada pela editora Shue

Samir Maciel 8 May 27, 2022
IMCL is a Minecraft launcher which supports Mod managment, game customizing and so on.

IDEA Minecraft Launcher A simple Minecraft launcher 简体中文 日本語 Esperanto Introduction IMCL is a Minecraft launcher which supports Mod managment, game cu

ResetPower 1 Jan 25, 2022
Abysl Asset Manager is an easy to use library management tool to index and search game assets

Abysl Asset Manager is an easy to use library management tool to index and search game assets. Features Itch.IO Library Import Hum

null 22 Oct 6, 2022
The android port of the 2048 game (for offline playing)

2048-android This is the Android port of the 2048 game made by Gabriele Cirulli https://github.com/gabrielecirulli/2048 It's nothing fancy; just a Web

Paul S 996 Dec 24, 2022
An open source clone of a famous flappy bird game for Android using AndEngine

OpenFlappyBird An open source clone of a famous flappy bird game for Android using the amazing AndEngine History When the original Flappy Bird game wa

Dean Wild 299 Dec 26, 2022
Google Play game services - Android samples

Google Play game services - Android Samples Copyright (C) 2014 Google Inc. Contents These are the Android samples for Google Play game services. Colle

Google Play Game Services 953 Jan 2, 2023
Android game to beat a Halloween Monster named Marnus! :)

RandomNumberGame I am developing a simple game to fight against the Halloween Monster Marnus for Halloween Pumpkins .Let's see who wins more Pumpkins

Tejas Khartude 1 Oct 31, 2021
Shotify aims to improve a largely forgotten about feature of the game: screenshots

A highly advanced screenshot mod. Modrinth • Curseforge Shotify aims to improve a largely forgotten about feature of the game: screenshots. Taking a s

Xander 6 Oct 24, 2022
An easy-to-use wrapper for Lunar Client's game api.

An easy-to-use wrapper for Lunar Client's game api.

Patrick 5 Oct 25, 2022