cping / lgame Goto Github PK
View Code? Open in Web Editor NEWA cross-platform Java game Engine (Framework) , support JavaFX / Android / IOS / HTML5 / Linux / MAC / Windows
License: Apache License 2.0
A cross-platform Java game Engine (Framework) , support JavaFX / Android / IOS / HTML5 / Linux / MAC / Windows
License: Apache License 2.0
什么时候才能有最新的文档,还有能不能出一些教程或者例子里的注释能不能解释的清楚些,
现在有很多问题想向您请教,希望兄台给个联系方式,谢谢,很紧急!
特别是有些关于LGame 0.5的问题和建议,耽搁兄台一些时间,万分感谢!
这段代码里,我给这个按钮添加了两张图片,显示是正常的。但是按下后就不正常了,是不是case 2里的代码有问题,这是源码
public void setImages(LTexture... images) {
LTexture[] buttons = new LTexture[4];
if (images != null) {
int size = images.length;
this.type = size;
switch (size) {
case 1:
buttons[0] = images[0];
buttons[1] = images[0];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 2:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[0];
buttons[3] = images[0];
break;
case 3:
buttons[0] = images[0];
buttons[1] = images[1];
buttons[2] = images[2];
buttons[3] = images[0];
break;
case 4:
buttons = images;
break;
default:
exception = true;
break;
}
}
if (!exception) {
this.setImageUI(buttons, true);
}
}
新版LGame0.5只能加载Assets里的普通图片文件,有两个问题:
1,游戏稍微大一点,几十兆或者几百兆的资源文件,对于现在的游戏来说很平常,
如果只能从Assets里加载,那么随便改动游戏代码调试一下,都要等十多分钟,
这样的情况是无法接受的;
2,图片资源直接暴露在Assets里,等于是直接把图片送给有心人,没有任何保护,
这样似乎很不妥当。
因此,建议作者大哥给LTexture增加一个可以从字节数组byte[] 加载图片,对各方面都有很大好处,
谢谢!
hi~老哥可以出个极简版的javaFX集成live2d的demo学习一下嘛
大哥. 如果身体不好,至少把你的文档转移到新的网址吧, 现在的都登录不上去啦. readme上说你的博客里有安装说明等等文档,然而网站都打不开啊.
另, 祝早日康复.
高手,您好:
Assets.background = LTextures.loadTexture("background.png");
图片路径报错java.lang.RuntimeException: Path background.png is null !
不知道怎么放这个assets文件夹
我在用你的0.4.1版本物理引擎时,发现很多代码都改了。
你有个新的样本代码是使用0.4.1版本物理引擎寄给我吗?
regards,
Ken Choo
[email protected]
如题,具体什么原因过两天我再仔细调一下。
错误如下:
02-18 19:31:31.963: E/AndroidRuntime(11254): FATAL EXCEPTION: main
02-18 19:31:31.963: E/AndroidRuntime(11254): Process: com.mygame, PID: 11254
02-18 19:31:31.963: E/AndroidRuntime(11254): java.lang.RuntimeException: Unable to pause activity {com.mygame/com.mygame.Main}: java.lang.IllegalArgumentException: buffer not allocated with newUnsafeByteBuffer or already disposed
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3736)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3695)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.handlePauseActivity(ActivityThread.java:3670)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.access$1100(ActivityThread.java:177)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1466)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.os.Handler.dispatchMessage(Handler.java:102)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.os.Looper.loop(Looper.java:145)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.main(ActivityThread.java:5942)
02-18 19:31:31.963: E/AndroidRuntime(11254): at java.lang.reflect.Method.invoke(Native Method)
02-18 19:31:31.963: E/AndroidRuntime(11254): at java.lang.reflect.Method.invoke(Method.java:372)
02-18 19:31:31.963: E/AndroidRuntime(11254): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
02-18 19:31:31.963: E/AndroidRuntime(11254): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
02-18 19:31:31.963: E/AndroidRuntime(11254): Caused by: java.lang.IllegalArgumentException: buffer not allocated with newUnsafeByteBuffer or already disposed
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.jni.NativeSupport.disposeUnsafeByteBuffer(NativeSupport.java:520)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LTextureBatch.dispose(LTextureBatch.java:1069)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LTextureBatch.destoryAll(LTextureBatch.java:1048)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LSTRFont.dispose(LSTRFont.java:472)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LSTRDictionary$Dict.dispose(LSTRDictionary.java:65)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LSTRDictionary.clearStringLazy(LSTRDictionary.java:85)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LSTRDictionary.dispose(LSTRDictionary.java:234)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.core.graphics.opengl.LTextures.disposeAll(LTextures.java:209)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.LProcess.onDestroy(LProcess.java:683)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.AndroidView.destroy(AndroidView.java:400)
02-18 19:31:31.963: E/AndroidRuntime(11254): at loon.LGame.onPause(LGame.java:775)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.Activity.performPause(Activity.java:6446)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.Instrumentation.callActivityOnPause(Instrumentation.java:1308)
02-18 19:31:31.963: E/AndroidRuntime(11254): at android.app.ActivityThread.performPauseActivity(ActivityThread.java:3722)
02-18 19:31:31.963: E/AndroidRuntime(11254): ... 11 more
虽然我查看了引擎的源码,但是对他内部绘制的复杂部分没有精力去了解如何实现的。
举个例子,LButton这个到底在哪里使用才有效果呢?我觉得我们或许可以加个qq好友,在我开发游戏过程中遇到的问题或许可以整理成一个api文档,善于使用。否则过段时间后又忘的差不多了。
QQ1559215761
cping大大是否考虑过移植lgame 到unity3d开发环境上去呢?
playsound显然不能用播放背景音乐,而例子也没有
loon类里默认是横屏。而我需要开发竖屏游戏,不得不更改loon安卓包并且发展里面调用了一些过时的opengles函数。还好我把它注释掉了目前还没有发现什么问题,另外图片按钮怎么用呢。有没有教程或者api呢
When released ios version?
Examples need some Common File Config Project
我只是想跑跑demo,项目依赖有安卓的。有没有办法区分调。
能不能开发出腾讯斗地主那样的软件呢?
隔壁libGDX和jMonkeyEngine都部署了......
E/AndroidRuntime: FATAL EXCEPTION: main
Process: loon.template.mygame, PID: 2828
java.lang.NoSuchMethodError: No virtual method setSize(II)V in class Lloon/geom/Dimension; or its super classes (declaration of 'loon.geom.Dimension' appears in /data/app/loon.template.mygame-IlfOsUsmX6V1fLbn48UimA==/base.apk)
at loon.android.Loon.updateViewSize(Loon.java:896)
大神,能否给个联系方式,ripple方面咨询你一个问题,万分感谢,我的联系方式[email protected],
QQ:493288,请务必联系我,谢谢
Hello! I am a Korean who is interested in this program.
It is sad that there is no Korean translation version as a Korean.
If you are interested in the Korean version, I will help you translate it into Korean.
I'd appreciate it if you could be positive about the proposal.
催更......
LGame/Java/Loon-Neo/src/loon/utils/ConfigReader.java
问题方法:
private final String loadItem(final String mes, final boolean save)
TDTest例子里的map.txt
begin name = "test"
等于号后面有个空格,解析出来的key是“ test”,也有一个空格。导致例子加载瓦片地图文件的时候通过test找配置文件返回空。规避方法是begin name ="test"。去掉这个空格。
高手,我是一个java爱好者,一直喜欢您这个项目,有个问题是java_Neo中的Neo是什么东东,其他的百度可以理解,就是这个Neo我一直不明白是什么?
Tiled编辑器里面有些层不可见,在游戏中绘制时也应该不绘制出来。而且tmx文件中的layer确实自带visible属性,希望能加上
@cping 大神,你好。。
在使用\LGame\Java\Android\OpenGLES\examples\PhysicsTest例子时
1、在Android2.1模拟器上运行出现如下警告:
01-29 11:01:40.429: W/dalvikvm(248): JNI WARNING: method declared to return 'Ljava/nio/ByteBuffer;' returned 'Ljava/nio/ReadWriteDirectByteBuffer;'
01-29 11:01:40.429: W/dalvikvm(248): failed in
。。。。。。
01-29 11:01:40.439: E/dalvikvm(248): VM aborting
最后VM崩溃了,
2、在Android2.3模拟器上都能够正常运行
3、在Android2.1部分真机上也是同样异常信息
4、在Android2.3、Android4.0真机上正常运行
所以基本可以肯定libplus.so库在Android2.1无法兼容
这个问题是什么原因,可以解决吗?
我无意间发现一个14年项目xyqlite安卓端的,用的就是和你一样的引擎,现在我想重制它,用了很旧的api
需要吧Bitmap转LTexture,其实我也不知道如何绘制LTexture
我的qq是1559215761
Java cord.jar is missing import loon.action.sprite.SpriteBatchScreen;
why
鹏哥,有个问题请教一下!SLGTest在我的手机(联想S880)上使用时,当我方人物移动到敌人旁边时,在菜单中无法选择待机,请问怎么解决?另外,请问鹏哥有最新的SLG例子吗?
我新建了一个LTexture数组,里面放两个图片,一个正常状态,一个按下状态,为什么给LButton后,在屏幕上点击,没有变化???
。。。大佬,就更新。
TMXTiledMap map;
public void onLoad() {
//加载TMX地图,XML中图片加载路径在assets文件夹下
map = new TMXTiledMap("assets/desert.tmx","assets");
}
public void draw(GLEx g) {
//当onLoad中资源全部加载完毕时
if (isOnLoadComplete()) {
//绘制TMX地图到屏幕,由TMX坐标的1,5位置开始显示(换算为像素坐标就是1_tileWidth,5_tileHeight)
map.draw(g,1,5);
}
}
按照这个方法,画出来的地图没有纹理,全是白色方块。这个问题只出现在opengles版本引擎上。
根据我的排察验证,gles版本引擎如果在onLoad方法中使用了loadTexture方法,那么载入的图片就会变成一片白色,具体原因不知。
如上面的代码,如果把map的初始化放到 draw方法里,就能正常显示。
@cping 大神到底会不会看这里的信息啊!!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.