Leander Hasty ca2a5cba9a HTML5Window.handleResize: various "prefer exact integers" fixes for the non-stretch case:
Avoid dividing by zero if we somehow come in with setWidth or setHeight 0 (taking a hint from recent handleTouchEvent changes -- we never witnessed this but it seemed worth a bit of paranoia while we were making changes).

Prefer meeting either element.clientWidth or element.clientHeight exactly if scaleX or scaleY are smaller, respectively.  This avoids introducing float inaccuracies in some cases by recomputing style.width or style.height later.

When multiplying the other dimension, round down. Similarly, when computing margins, round down.  This avoids a half-pixel offset (possible performance implications?) in cases where the difference between the computed dimension is different from the client dimension by an odd amount (could e.g. see "marginLeft: -0.5px" here due to this and the aforementioned recompute).

Also dedupes a bit of code between the "we have a canvas" vs "we have a div" branches.

Reviewed locally by Jon Meschino.
2016-04-22 15:26:16 -04:00
2015-12-08 09:56:55 -08:00
2015-09-15 14:55:01 -07:00
2015-02-13 08:34:17 -08:00
2016-04-05 15:13:56 -05:00
2014-09-30 17:41:57 -07:00
2015-08-22 14:32:35 -07:00
2015-08-22 23:45:13 -07:00
2016-03-29 08:46:53 -07:00
2016-03-28 10:37:52 -07:00
2014-10-18 13:05:29 -07:00
2015-12-31 14:41:54 -08:00
2014-08-13 09:05:01 -07:00
2016-01-08 10:10:06 -08:00
2015-12-28 13:43:53 -08:00

MIT License Haxelib Version Build Status

Lime

Lime is a flexible, lightweight layer for Haxe cross-platform developers.

Lime supports native, Flash and HTML5 targets with unified support for:

  • Windowing
  • Input
  • Events
  • Audio
  • Render contexts
  • Network access
  • Assets

Lime does not include a renderer, but exposes the current context:

  • Canvas
  • DOM
  • Flash
  • GL

The GL context is based upon the WebGL standard, implemented for both OpenGL and OpenGL ES as needed.

Lime provides a unified audio API, but also provides access to OpenAL for advanced audio on native targets.

License

Lime is free, open-source software under the MIT license.

Installation

First install the latest version of Haxe.

The current version of Lime has not been released on haxelib, yet, so please install the latest development build.

Development Builds

When there are changes, Lime is built nightly. Builds are available for download here.

To install a development build, use the "haxelib local" command:

haxelib local filename.zip

Building from Source

Clone the Lime repository, as well as the submodules:

git clone --recursive https://github.com/openfl/lime

Tell haxelib where your development copy of Lime is installed:

haxelib dev lime lime

The first time you run the "lime" command, it will attempt to build the Lime standard binary for your desktop platform as the command-line tools. To build these manually, use the following command (using "mac" or "linux" if appropriate):

haxelib install format
lime rebuild windows
lime rebuild tools

While current Lime projects (and the Lime tools) use the standard Lime binary, by default, OpenFL uses the legacy Lime 1 binary when targeting native platforms. To rebuild Lime legacy, you can use the "legacy" define:

lime rebuild windows -Dlegacy

You can build additional binaries, or rebuild binaries after making changes, using "lime rebuild":

lime rebuild windows
lime rebuild linux -64 -release -clean

You can also rebuild the tools if you make changes to them:

lime rebuild tools

On a Windows machine, you should have Microsoft Visual Studio C++ (Express is just fine) installed. You will need Xcode on a Mac. To build on a Linux machine, you may need the following packages (or similar):

sudo apt-get install libgl1-mesa-dev libglu1-mesa-dev g++ g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev

To switch away from a source build, use:

haxelib dev lime

Sample

You can build a sample Lime project with the following commands:

lime create HelloWorld
cd HelloWorld
lime test neko

You can also list other projects that are available using "lime create".

Targets

Lime currently supports the following targets:

lime test windows
lime test mac
lime test linux
lime test neko
lime test android
lime test html5
lime test flash

Native builds must be built on the same operating system as the target. As supported in Lime legacy, additional platforms (iOS, BlackBerry) will be restored in the near future.

Description
A foundational Haxe framework for cross-platform development
Readme 357 MiB
Languages
JavaScript 45.1%
Haxe 25.9%
C 14.6%
C++ 7.5%
CSS 4.2%
Other 2.4%