Add syntax highlighting

This commit is contained in:
Joshua Granick
2018-07-18 22:18:15 -07:00
parent 78e99bf1d9
commit 31011fb6c6
16 changed files with 35 additions and 33 deletions

View File

@@ -7,7 +7,7 @@ package lime.app;
For example:
```
```haxe
var event = new Event<Int->Void> ();
event.add (function (value:Int):Void { trace (value); });
event.dispatch (100);

View File

@@ -12,7 +12,7 @@ import lime.utils.Log;
Lime `Future` introduces "progress" feedback as well to increase the value of
`Future` values.
```
```haxe
var future = Image.loadFromFile ("image.png");
future.onComplete (function (image) { trace ("Image loaded"); });
future.onProgress (function (loaded, total) { trace ("Loading: " + loaded + ", " + total); });

View File

@@ -10,7 +10,7 @@ package lime.app;
While `Future` is meant to be read-only, `Promise` can be used to set the state of a future
for receipients of it's `Future` object. For example:
```
```haxe
function examplePromise ():Future<String> {
var promise = new Promise<String> ();

View File

@@ -11,7 +11,7 @@ import lime.graphics.cairo.Cairo;
You can convert from `lime.graphics.RenderContext` to `CairoRenderContext` directly
if desired:
```
```haxe
var cairo:CairoRenderContext = window.context;
```
**/

View File

@@ -7,11 +7,11 @@ import js.html.CanvasRenderingContext2D;
/**
The `Canvas2DRenderContext` represents the primary `js.html.CanvasRenderingContext2D` instance when Canvas
is the render context type of the `Window`.
You can convert from `lime.graphics.RenderContext` to `Canvas2DRenderContext` directly
if desired:
```
```haxe
var ctx:CanvasRenderingContext2D = window.context;
```
**/
@@ -21,15 +21,15 @@ import js.html.CanvasRenderingContext2D;
abstract Canvas2DRenderContext(CanvasRenderingContext2D) from CanvasRenderingContext2D to CanvasRenderingContext2D {
@:from private static function fromRenderContext (context:RenderContext):Canvas2DRenderContext {
return context.canvas2D;
}
}
@@ -40,15 +40,15 @@ abstract Canvas2DRenderContext(CanvasRenderingContext2D) from CanvasRenderingCon
abstract Canvas2DRenderContext(Dynamic) from Dynamic to Dynamic {
@:from private static function fromRenderContext (context:RenderContext):Canvas2DRenderContext {
return null;
}
}

View File

@@ -11,7 +11,7 @@ import js.html.Element;
You can convert from `lime.graphics.RenderContext` to `DOMRenderContext` directly
if desired:
```
```haxe
var dom:DOMRenderContext = window.context;
```
**/

View File

@@ -11,7 +11,7 @@ import flash.display.Sprite;
You can convert from `lime.graphics.RenderContext` to `FlashRenderContext` directly
if desired:
```
```haxe
var sprite:FlashRenderContext = window.context;
```
**/

View File

@@ -20,7 +20,7 @@ import lime.graphics.opengl.*;
`lime.graphics.OpenGLES3RenderContext`, `lime.graphics.opengl.GL`, and can convert to
`lime.graphics.WebGLRenderContext` directly if desired:
```
```haxe
var gles2:OpenGLES2RenderContext = window.context;
var gles2:OpenGLES2RenderContext = gl;
var gles2:OpenGLES2RenderContext = gles3;

View File

@@ -30,7 +30,7 @@ import lime.utils.Int32Array;
`lime.graphics.WebGL2RenderContext` or `lime.graphics.WebGLRenderContext` directly
if desired:
```
```haxe
var gles3:OpenGLES3RenderContext = window.context;
var gles3:OpenGLES3RenderContext = gl;
var gles3:OpenGLES3RenderContext = GL;
@@ -38,6 +38,7 @@ import lime.utils.Int32Array;
var gles2:OpenGLES2RenderContext = gles3;
var webgl2:WebGL2RenderContext = gles3;
var webgl:WebGLRenderContext = gles3;
```
**/
@:forward

View File

@@ -21,7 +21,7 @@ import lime._internal.backend.native.NativeOpenGLRenderContext;
`lime.graphics.OpenGLES2RenderContext`, `lime.graphics.WebGL2RenderContext`, or
`lime.graphics.WebGLRenderContext` directly if desired:
```
```haxe
var gl:OpenGLRenderContext = window.context;
var gl:OpenGLRenderContext = GL;

View File

@@ -358,13 +358,14 @@ import lime.utils.UInt32Array;
`lime.graphics.OpenGLES3RenderContext` or `lime.graphics.opengl.GL`, and can convert to
`lime.graphics.WebGLRenderContext` directly if desired:
```
```haxe
var webgl2:WebGL2RenderContext = window.context;
var webgl2:WebGL2RenderContext = gl;
var webgl2:WebGL2RenderContext = gles3;
var webgl2:WebGL2RenderContext = GL;
var webgl:WebGLRenderContext = webgl2;
```
**/
@:access(lime.graphics.RenderContext)

View File

@@ -17,7 +17,7 @@ import lime.utils.Float32Array;
`lime.graphics.OpenGLES3RenderContext`, `lime.graphics.OpenGLES2RenderContext`,
`lime.graphics.WebGL2RenderContext` or `lime.graphics.opengl.GL` directly if desired:
```
```haxe
var webgl:WebGLRenderContext = window.context;
var webgl:WebGLRenderContext = gl;
var webgl:WebGLRenderContext = gles3;

View File

@@ -10,7 +10,7 @@ import lime.utils.UInt8Array;
A utility for storing, accessing and converting colors in an ARGB
(alpha, red, green, blue) color format.
```
```haxe
var color:ARGB = 0xFF883300;
trace (color.a); // 0xFF
trace (color.r); // 0x88

View File

@@ -10,7 +10,7 @@ import lime.utils.UInt8Array;
A utility for storing, accessing and converting colors in a BGRA
(blue, green, red, alpha) color format.
```
```haxe
var color:BGRA = 0x003388FF;
trace (color.b); // 0x00
trace (color.g); // 0x33

View File

@@ -170,7 +170,7 @@ abstract ColorMatrix(Float32Array) from Float32Array to Float32Array {
For example:
```
```haxe
var colorMatrix = new ColorMatrix ();
colorMatrix.alphaOffset = 12;
@@ -215,7 +215,7 @@ abstract ColorMatrix(Float32Array) from Float32Array to Float32Array {
For example:
```
```haxe
var colorMatrix = new ColorMatrix ();
colorMatrix.blueOffset = 16;
@@ -259,7 +259,7 @@ abstract ColorMatrix(Float32Array) from Float32Array to Float32Array {
For example:
```
```haxe
var colorMatrix = new ColorMatrix ();
colorMatrix.greenOffset = 16;
@@ -303,7 +303,7 @@ abstract ColorMatrix(Float32Array) from Float32Array to Float32Array {
For example:
```
```haxe
var colorMatrix = new ColorMatrix ();
colorMatrix.redOffset = 16;

View File

@@ -10,7 +10,7 @@ import lime.utils.UInt8Array;
A utility for storing, accessing and converting colors in an RGBA
(red, green, blue, alpha) color format.
```
```haxe
var color:RGBA = 0x883300FF;
trace (color.r); // 0x88
trace (color.g); // 0x33