Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - liesard

Pages: [1]
Java / Re: JSFML Text with texture as a background
« on: April 17, 2015, 08:16:01 pm »
Wait, do you want an image behind the text or to have the text itself be filled with an image?
Also, join the IRC channel
They might be able to help better than here

Java / Re: JSFML for SFML 2.2
« on: March 04, 2015, 11:10:20 pm »
I have the shared object files, but my version of GLEW is 1.12 so I'll compile the older version from source if needed.  As for libjpeg8d, I only have libjpeg (I don't know if they're the same thing)
I don't know how to use ant, but I have the JSFML shared object files in the home directory

If that's everything that's needed, then I'll be glad to try compiling it at once :3

Java / Re: Can't get sprite to move
« on: January 26, 2015, 02:16:14 am »
I hope that you managed to get it fixed after all this time, but it's late and I feel like solving problems.

The first thing I noticed was that in both moveLeft() and moveRight(), only the variable changes.  The player itself doesn't.  Apart from that, it should normally work, but I haven't tried it.

A few other notes:
  • You can make Player extend Sprite.  This makes it easier to manage as you will be dealing with the player as a drawable object and not as something which holds a drawable object.  It's much more direct this way.
  • You can put the getInput() function in the Player class as it doesn't rely on a RenderWindow and all the events are about the player.  You would then call the method from the player object in the Main class.
  • Don't make everything static! It's unnecessary.  The way to avoid conflicts is to put what's in the main method into Main's constructor.  You would then call new Main(); in the main method.
  • Work on your naming conventions.  It's a little hard to explain, but, for example, booleans should be in the form of questions.  id est: isJumping, isAdded.  There are other things, but it's a little hard to explain

Also, please refer to this for practicing good practice: http://www.roxie.org/books/bleeding/appendices/ap01.html

Java / Re: GUI for JSFML
« on: January 26, 2015, 01:53:45 am »
It isn't very difficult to use vanilla JSFML to make a GUI application.  You would just have to make the sprites for the buttons and text boxes and the key handler yourself.  I'm sure it's doable.

Java / Re: How to depoly JSFML game?
« on: January 26, 2015, 12:47:56 am »
Well first of all, you shouldn't be putting your resources into the bin/ directory, as that is for binary files (.class files) and not for resources (images and sounds).  Those should be put into the res/ directory for organisation.
Try using the 'Package required libraries into generated JAR' option.  It's what I normally use and it works for me.  Also, make sure that you have put the JAR package into the same directory as the project, as that's where all the resources are.  If that doesn't work, then run it from the command line and tell us what the error message is.
If your class files are in the bin/ directory, then the command will be:
Code: [Select]
java -cp bin/;lib/jsfml.jar com.your.package.name.Main(Main will be replaced with the name off the class with the main method in it.  If you're on OS X, Linux or *BSD, then replace that semicolon with a colon)

Java / Re: Update window?
« on: January 26, 2015, 12:27:21 am »
Also, you can totally check out this thing that I wrote: https://liesard.wordpress.com/2015/01/11/basic-jsfml-setup/
(Shameless self-promotion, I know :P )

Just keep in mind that the forum is not here to teach you how to program, but rather to solve problems specific to your need.  For example, gravity and collision in a game.  Something like that.

Java / Re: JSFML for SFML 2.2
« on: January 26, 2015, 12:20:24 am »
I run Linux 64-bit, so I might be able to help with that part of it ^.^

Java / Re: MouseEvent problems
« on: January 22, 2015, 03:34:11 pm »
You can read the GitHub tutorial on it here: https://github.com/pdinklag/JSFML/wiki/Input
You can also read the Javadoc here: http://jsfml.org/javadoc/org/jsfml/window/Mouse.html and here: http://jsfml.org/javadoc/org/jsfml/window/event/Event.html

Remember: the fun of programming is trying things out and solving problems.  Google around before asking on a forum

Pages: [1]