Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Clone this wiki locally
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.
- Setup — The preparations required to setup a JSFML application. Don't worry, it's not much!
- Windows — Creating a window and maintaining a basic refresh loop.
- Input — Handling user input via keyboard, mouse and gamepads.
- Vectors and Rectangles — About JSFML's vector and rectangle classes.
- Shapes — Displaying primitive shapes.
- Transformation and Bounds — Moving, rotating and scaling objects and retrieving their AABB.
- Timing — Using clocks for time measurement, timers and procedural animation.
- Textures and Sprites — Loading and displaying textures, and frame animation.
- Fonts and Texts — Loading fonts and printing texts using them.
- Views — Using views to scroll, zoom and rotate the whole scene; also coordinate conversion and viewports
- Images — Loading, manipulating and saving images.
- RenderTextures — Off-screen rendering to a texture.
- VertexArrays — Using vertex arrays to draw custom 2D meshes and gradients.
- Drawables and RenderStates — Implementing custom drawables and understanding how render states work.
- Shaders — Using GLSL shaders for post effects.
- SoundBuffers and Sounds — Loading and playing sound effects.
- 3D Sound — Sound spatialization and controlling the listener.
- Music — Playing music.
- SoundBufferRecorders — Recording and saving sounds.
- 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).