0

我已经在这个项目上工作了几个月,这周我又回来了,似乎随着 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

谢谢!

4

1 回答 1

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,(或者 1.1-SNAPSHOT,如果你正在构建你自己的 PlayN 版本),那么有些不对劲。您最有可能通过将 playn-core 依赖项直接添加到您的core/pom.xml. 通常,您的顶层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>
于 2011-12-06T03:55:50.520 回答