Skip to content
This repository has been archived by the owner on Jun 12, 2019. It is now read-only.
pdinklag edited this page Jan 30, 2013 · 21 revisions

JSFML is the offical Java binding to the Simple and Fast Multimedia Library (SFML), a multimedia library written by Laurent Gomila.

This is the official documentation wiki for JSFML. It will guide you from setting up a basic JSFML application to understanding its very details in order to build complex applications like scene graphs or games.

The articles provided in this documentation wiki often refer to the Javadoc, which is a very useful source of information as well.

Note that the documentation is currently a work in progress before the first actual release of JSFML.

Table of Contents

These tutorials get you started with JSFML. After these, you should know your way around well enough to create simple games, for example.

  1. Setup — The preparations required to setup a JSFML application. Don't worry, it's not much!
  2. Windows — Creating a window and maintaining a basic refresh loop.
  3. Input — Handling user input via keyboard, mouse and gamepads.
  4. Vectors and Rectangles — About JSFML's vector and rectangle classes.
  5. Shapes — Displaying primitive shapes.
  6. Transformation and Bounds — Moving, rotating and scaling objects and retrieving their AABB.
  7. Timing — Using clocks for time measurement, timers and procedural animation.
  8. Textures and Sprites — Loading and displaying textures, and frame animation.
  9. Fonts and Texts — Loading fonts and printing texts using them.
  10. Views — Using views to scroll, zoom and rotate the whole scene; also coordinate conversion and viewports
  11. Images — Loading, manipulating and saving images.
  12. RenderTextures — Off-screen rendering to a texture.
  13. VertexArrays — Using vertex arrays to draw custom 2D meshes and gradients.
  14. Drawables and RenderStates — Implementing custom drawables and understanding how render states work.
  15. Shaders — Using GLSL shaders for post effects.
  16. SoundBuffers and Sounds — Loading and playing sound effects.
  17. 3D Sound — Sound spatialization and controlling the listener.
  18. Music — Playing music.
  19. SoundBufferRecorders — Recording and saving sounds.
  20. SoundStreams — Implementing custom sound streams.


This is a collection of useful tutorials for common tasks that do not really fit into the basic documentation. These range from beginner to advanced experience levels.

  • MP3 — Streaming MP3 audio files using a custom SoundStream and the MP3 SPI.
  • Multithreading — Working with JSFML using multiple threads.
  • Screenshots — Taking screenshots using Textures and Images.
  • Styled Text — Creating a custom text implementation that supports style and color flags similar to Quake or TrackMania.


The following articles are for advanced developers who want to understand how JSFML works or would like to build the native part from the C++ sources.

  • Building JSFML — Notes on building the native C++ part of JSFML from the source code.
  • Intercom — How SFML types are converted between C++ and Java representations.
  • SFMLNativeObject — How SFML objects (C++) are linked to JSFML objects (Java).