Fork Heaps on GitHub


Heap's 2D API (H2D) defines a collection of classes for 2D graphics. The following sections covers its usage.

  • Introduction

    Before discussing H2D in-depth, let's introduce a few concepts that we will use throughout the documentation:..

    Read more
  • Animation

    Creating an animated sprite in H2D is relative easy...

    Read more
  • Displaying text

    h2d.Text can be used to draw text using bitmap fonts. It allows you to set textColor, maxWidth, textAlign, letterSpacing and lineSpacing. It's also possible to get the size of the text with textWidth/textHeight...

    Read more
  • Drawable

    H2D classes that can display something on screen usually extend the h2d.Drawable class...

    Read more
  • Drawing tiles

    This example draws tile layers from a Tiled file (json), it can be used for fast tile rendering...

    Read more
  • Events and interaction

    Making objects interactive is done creating a h2d.Interactive instance. You provide it an interaction area and attach it to a sprite...

    Read more
  • Filters

    Filters apply to the display tree, so can be used to create screen effects. You can assign a filter to a h2d.Sprite. ..

    Read more
  • Drawing Graphics

    Heaps offers an easy way to draw custom shapes and colors to the screen in the 2D context. Shapes can be filled with solid colors, gradients or custom bitmaps...

    Read more
  • Optimizing bitmaps

    Some tips:..

    Read more
  • Shaders

    You can add a Shader in H2D using drawable.addShader...

    Read more
  • Sprites

    The following properties and methods can be accessed on any Sprite:..

    Read more