This module takes care of the Graphics.
You will want to add PixelEngine.Graphics.Image or PixelEngine.Graphics.Tile to actually draw something.
The main idea of this graphic engine is to arrage the content into horizontal stripes, so called areas.
An area for using tilesets.
It supports one tileset at a time, that means all sprites must be of the same size and stored as a grid in one single file. This area is useful for displaying the playing field of a game.
Checkout PixelEngine.Graphics.Tile for more information.
This area has the following options:
rows - The amount of rows of the grid. This value defines the height of the Area.tileset - The tileset that will be used for all elements in the Area.background - The background of the Area.An area containing images that can be arranged freely.
This is a complete contrast to the way how tiledArea is working.
Usefull applications are GUIs, menus or loading screens.
Checkout PixelEngine.Graphics.Image for more information.
This area has the following options:
height - The height or the Area in pixels.background - The background of the Area.Returns the height of a list of Areas
This can be used to return the height of a tiledArea.
For a imageArea this function is trivial.
An alias for a PixelEngine program.
Your main function will have this type.
If one wants to use just use this module on its own, you can use toHtml instead
of the game function from the main module.
Displays content of the game.
A prewired PixelEngine frame.
Use it just like document from elm/browser.
A game with no controls.
Use it just like document from elm/browser.
A game using custom controls.
The default controls should be enough to start, but maybe you want to write a spelling game, or its nessesary that very specifc keys are used?
The graphic engine provides a touch-controller for mobile devices.
all possible Inputs.
The default layout:
InputLeftInputUpInputRightInputDownInputAInputBInputXInputYEvery area has a background.
An image that gets repeated.
Image "groundTile.png"A single color background. It uses avh4/elm-color.
colorBackground (Color.rgb255 20 12 28)Subscribes to a keypress and sends the corresponding msg. This Function uses the default key layout.
Subscribes to a keypress using custom key layouts.
It uses key values for the String. You can use this website to find out the key value.
Adds mobile support to the options. It needs the window size.
provides a fully wired program that takes care of everything.
A horizontal area of the content. A
Areadefines how the content should be displayed.Note: An area can only contain elements of the same type. So either you have tiles or images.