我已经在这个项目上工作了几个月,本周我又回到了它,似乎随着PlayN和三重播放的快照发生了一些问题,因为我得到了
Exception in thread "AWT-EventQueue-0" java.lang.Error: Unresolved compilation problem:
Cannot invoke fillRect(int, int, float, float) on the primitive type void
at tripleplay.ui.Background.createSolidLayer(Background.java:90)
at tripleplay.ui.bgs.SolidBackground.instantiate(SolidBackground.java:26)
at tripleplay.ui.Elements.layout(Elements.java:191)
at tripleplay.ui.Element.validate(Element.java:317)
at tripleplay.ui.Interface.paint(Interface.java:120)
at com.jengibre.h4ck1t.bouncer.Bouncer.paint(Bouncer.java:110)
at playn.java.JavaPlatform$1.paint(JavaPlatform.java:216)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5131)
at javax.swing.BufferStrategyPaintManager.paint(BufferStrategyPaintManager.java:278)
at javax.swing.RepaintManager.paint(RepaintManager.java:1224)
at javax.swing.JComponent.paint(JComponent.java:1015)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
at java.awt.Container.paint(Container.java:1780)
at java.awt.Window.paint(Window.java:3375)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:796)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:713)
at javax.swing.RepaintManager.seqPaintDirtyRegions(RepaintManager.java:693)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:125)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
这是我的元项目pom.xml:http://pastebin.com/raw.php?i=qaMWx72C
这是我的java项目pom.xml:http://pastebin.com/raw.php?i=z3BF45yr
谢谢!
答案 0 :(得分:0)
看起来你正在使用旧版本的PlayN,它在Surface / Canvas上没有流畅的界面。
你可以运行:
mvn dependency:tree
在您的core
子模块中(在该目录中),以查看正在使用哪些版本的PlayN jar文件来构建项目。以下是我的一个游戏中的示例:
[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @ atlantis-core ---
[INFO] com.threerings.atlantis:atlantis-core:jar:1.0-SNAPSHOT
[INFO] +- com.googlecode.playn:playn-core:jar:1.1-SNAPSHOT:compile
[INFO] +- com.threerings.nexus:nexus-core:jar:1.0-SNAPSHOT:compile
[INFO] | \- com.threerings:react:jar:1.1:compile
[INFO] +- com.threerings:tripleplay:jar:1.1-SNAPSHOT:compile
[INFO] +- com.samskivert:pythagoras:jar:1.2-SNAPSHOT:compile
[INFO] +- com.google.guava:guava:jar:10.0:compile
[INFO] | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] \- junit:junit:jar:4.8.1:test
如果你没有看到playn-core:jar:1.0.1或1.0.2,(如果你是根据你自己的PlayN版本建立的话,还是1.1-SNAPSHOT),那么有些不对劲。您最有可能通过直接向您的core/pom.xml
添加playn-core依赖来补救所述不幸事件。通常,您的顶级pom.xml
将定义您在项目中使用的PlayN版本:
<properties>
<playn.version>1.0.2</playn.version>
</properties>
然后您的core/pom.xml
将使用该属性声明playn-core
依赖项:
<dependency>
<groupId>com.googlecode.playn</groupId>
<artifactId>playn-core</artifactId>
<version>${playn.version}</version>
</dependency>