Java-Gaming.org Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  UIWindowManager HELP  (Read 1337 times)
0 Members and 1 Guest are viewing this topic.
Offline poluxxx

Senior Newbie




Java games rock!


« Posted 2004-05-27 08:17:43 »

I tested the SWING tute "SwingFPSCounter" and i've an error :

java.lang.NullPointerException
       at com.xith3d.userinterface.UIWindowManager.calcImagePlate(UIWindowManager.java:204)
       at com.xith3d.userinterface.UIWindowManager.<init>(UIWindowManager.java:137)
       at SwingFPSCounter.<init>(SwingFPSCounter.java:131)
       at SwingFPSCounter.<init>(SwingFPSCounter.java:112)
       at MsaEngine.<init>(MsaEngine.java:219)
       at AppLauncher.<init>(AppLauncher.java:15)
       at Engine.main(Engine.java:26)
Exception in thread "main" 


Thanks for help Smiley
Offline SpuTTer

Senior Devvie


Medals: 1
Exp: 14 years


Lazy Middle Class Intellectual


« Reply #1 - Posted 2004-05-27 15:49:45 »

Does the Xith Gui test work for you?

http://xith.org/jws/jws-com.xith3d.test.Xith3DGuiTest.jnlp

I use UIWindow in my game and the only problem I have so far is that the text gets squished and ugly when you dont run full screen.

Maybe give us a code example.

Sacramento Volleyball
"Whitty phrase goes here."
Offline orz

Senior Newbie




Java games rock!


« Reply #2 - Posted 2004-05-27 20:54:39 »

I had the same problem with the deformation of the text when not running fullscreen. However, a quick and dirty fix is putting the canvas inside a JPanel in a JFrame, eg:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
Dimension d = new Dimension(800, 600);
JFrame mainWindow = new JFrame("Xith3D");
JPanel panel = new JPanel();
panel.setPreferredSize(d);
panel.setMaximumSize(d);
panel.setMinimumSize(d);
mainWindow.getContentPane().add(panel);
mainWindow.pack();
mainWindow.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
mainWindow.setLocation(100,100);
RenderPeer renderPeer = new RenderPeerImpl();
CanvasPeer canvasPeer = renderPeer.makeCanvas(
                              panel,
                              d.width,
                              d.height,
                              16,
                              false);


The canvas will not resize with the window, but at least you get a window that can be moved and closed.

Terje
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline SpuTTer

Senior Devvie


Medals: 1
Exp: 14 years


Lazy Middle Class Intellectual


« Reply #3 - Posted 2004-05-27 21:18:27 »

Auh, excellent. I will have to give that a try tonight. Thanks.

Sacramento Volleyball
"Whitty phrase goes here."
Offline poluxxx

Senior Newbie




Java games rock!


« Reply #4 - Posted 2004-05-28 11:07:10 »

OK, i find the problem Smiley
That simple, i try to add my HUD before to add canvas to my VIEW.

BEFORE:

SwingFPSCounter counter = new SwingFPSCounter(canvas);
view.addCanvas3D(canvas);

NOW:

view.addCanvas3D(canvas);
SwingFPSCounter counter = new SwingFPSCounter(canvas);

AND WORK FINE BYE Smiley
Offline Yuri Vl. Gushchin

Senior Devvie




Speak Java!


« Reply #5 - Posted 2004-05-30 09:37:08 »

I would suggest you to add a feature request (with a test case) in Xith3D Issuezilla, so we do not forget to add such check in next versions of Xith3D.

Yuri

Yuri Vl. Gushchin
JProof Group
Pages: [1]
  ignore  |  Print  
 
 

 
DesertCoockie (52 views)
2018-05-13 18:23:11

nelsongames (83 views)
2018-04-24 18:15:36

nelsongames (74 views)
2018-04-24 18:14:32

ivj94 (759 views)
2018-03-24 14:47:39

ivj94 (87 views)
2018-03-24 14:46:31

ivj94 (643 views)
2018-03-24 14:43:53

Solater (102 views)
2018-03-17 05:04:08

nelsongames (184 views)
2018-03-05 17:56:34

Gornova (426 views)
2018-03-02 22:15:33

buddyBro (1086 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!