Fork Heaps on GitHub
Menu

H2D

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 precomputed bitmap fonts...

    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
  • Layers

    Using layers starts here...

    Read more
  • Optimizing bitmaps

    Some tips:..

    Read more
  • Shaders

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

    Read more
  • Sprites

    DEPRECATION NOTE: h2d.Sprite is now h2d.Object. Sprite type is still accessible but is actually a typedef of h2d.Object in the API. It has been kept for compatibility reasons...

    Read more