Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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  
  JavaFX media - yea or nay?  (Read 1649 times)
0 Members and 1 Guest are viewing this topic.
Offline Taisch

Junior Newbie

« Posted 2013-10-14 16:37:39 »


I've just started out with java and coding games in java. I made a simple minded little game and wanted to have some background music for it. I originally thought to use an mp3 for it. But no mp3 support in the java sound api... but it seems in java 7, javafx is included.  I don't really want to deal with javafx, but the Media and Mediaplayer part of it did exactly what I wanted (load mp3, play mp3, allow volume control and mute, all very simple to use). It seemed to have good speed, and didn't try to decompress the whole file at once or anything, etc.

However, when I tried to send the game to other people to test, I found that 2/3 of them didn't have Java 7 installed on their desktops.

Should I continue using the JavaFX bits and hope for the best? (everyone will update? Maybe?) Or try using some other library? (I did bash my head for awhile with javazoom... got jlayer player to work, but not basicplayer. Downloaded some of the suggested libraries from here but have only tried tinysound so far.).


Offline Mac70
« Reply #1 - Posted 2013-10-14 18:24:08 »

In my opinion Swing+Java2d/JavaFX are more suited for programs rather than games - you can do prototyping or tools using them, but I wouldn't write games in them - use LWJGL or LibGDX instead. Smiley
Offline gouessej
« Reply #2 - Posted 2013-10-14 18:46:45 »

I agree with Mac70. I don't find JavaFX really suited for games, its 3D API has some of the same design flaw than Java3D 1.5 (no more in 1.6), its memory footprint is higher than Swing and it is less reliable too. I advise you to use other libraries, the "hard" way with the sets of low level bindings like JogAmp (JOGL, JOAL and JOCL) or high level libraries (LibGDX, JMonkeyEngine, Ardor3D, Paul Lamb's Sound Library, ...). Why not using Ogg instead of MP3?

Julien Gouesse | Personal blog | Website | Jogamp
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Taisch

Junior Newbie

« Reply #3 - Posted 2013-10-14 19:31:53 »

Thanks for the replies.  Smiley Yeah, I didn't really like the look of JavaFX, though I do like Swing. Swing seems to do what it does very elegantly and robustly. Which isn't gaming, but ah well. (I did find that out by about my second learning-experience game, when I realized I would have to code everything more directly myself.)

I have nothing against ogg. I naively thought mp3 would be more widely supported. I probably will end up using Ogg if I don't go with the JavaFX media. I downloaded Paul Lamb's sound library yesterday. I'll try to figure it out later.

I'm going to do another newbie project first, then tackle LWJGL and 3D. If I ever do. 3D makes me dizzy.  Undecided
Pages: [1]
  ignore  |  Print  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (25 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

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

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

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

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

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

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

Solater (143 views)
2018-03-17 05:04:08
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 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‑
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!